All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel J Walsh <dwalsh@redhat.com>
To: Stephen Smalley <sds@epoch.ncsc.mil>, SELinux <SELinux@tycho.nsa.gov>
Subject: policycoreutils fixes
Date: Wed, 23 Feb 2005 09:46:40 -0500	[thread overview]
Message-ID: <421C9750.4080402@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 274 bytes --]

Fix genhomedircon:
     always add "\n"
    Strip extra spaces off of config files (SELINUXPOLICYTYPE)

Fix fixfiles:
    Use find recursion instead of restorecon to walk directory tree so 
that it will
not go into file systems that do not support extended attributes.

Dan

[-- Attachment #2: policycoreutils-rhat.patch --]
[-- Type: text/plain, Size: 2516 bytes --]

diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/fixfiles policycoreutils-1.21.19/scripts/fixfiles
--- nsapolicycoreutils/scripts/fixfiles	2005-02-08 13:27:03.000000000 -0500
+++ policycoreutils-1.21.19/scripts/fixfiles	2005-02-23 09:31:45.000000000 -0500
@@ -78,8 +78,8 @@
                   esac; \
                fi; \
             done | \
-	while read pattern ; do find $pattern -maxdepth 0 -print; done 2> /dev/null | \
-	 ${RESTORECON} -R $2 -v -e /root -e /home -e /tmp -e /var/tmp -e /dev -f - 
+	while read pattern ; do find $pattern -fstype ext2 -fstype ext3 -fstype reiserfs -fstype xfs -print; done 2> /dev/null | \
+	 ${RESTORECON} $2 -v -e /root -e /home -e /tmp -e /var/tmp -e /dev -f - 
 	rm -f ${TEMPFILE}
 fi
 }
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/genhomedircon policycoreutils-1.21.19/scripts/genhomedircon
--- nsapolicycoreutils/scripts/genhomedircon	2005-02-17 14:28:23.000000000 -0500
+++ policycoreutils-1.21.19/scripts/genhomedircon	2005-02-23 09:33:26.000000000 -0500
@@ -154,13 +154,13 @@
 def getDefaultHomeDir():
     rc=commands.getstatusoutput("grep ^HOME= /etc/default/useradd | tail -1")
     if rc[0]==0:
-        return rc[1].split("=")[-1]
+        return rc[1].split("=")[-1].strip()
     return "/home"
 
 def getSELinuxType(directory):
     rc=commands.getstatusoutput("grep ^SELINUXTYPE= %s/config | tail -1" % directory)
     if rc[0]==0:
-        return rc[1].split("=")[-1]
+        return rc[1].split("=")[-1].strip()
     return "targeted"
 
 def usage(error = ""):
@@ -203,7 +203,7 @@
     def getHomeRootContext(self, homedir):
 	    rc=commands.getstatusoutput("grep HOME_ROOT  %s | sed -e \"s|^HOME_ROOT|%s|\"" % ( self.getHomeDirTemplate(), homedir))
 	    if rc[0] == 0:
-		    return rc[1]
+		    return rc[1]+"\n"
 	    else:
 		    errorExit(string.join("sed error ", rc[1]))
 
@@ -254,7 +254,7 @@
 	# Fill in HOME and ROLE for users that are defined
 	for u in users.keys():
 		ret += self.getHomeDirContext (u, users[u]["home"], users[u]["role"])
-	return ret
+	return ret+"\n"
 
     def checkExists(self, home):
         return commands.getstatusoutput("grep -E '^%s[^[:alnum:]_-]' %s" % (home, self.getFileContextFile()))[0]
@@ -285,7 +285,6 @@
 	ret= self.heading()
         for h in self.getHomeDirs():
             ret += self.getHomeDirContext ("user_u" , h+'/[^/]*', "user")
-            ret += "\n"
             ret += self.getHomeRootContext(h)
         ret += self.genHomeDirContext()
         return ret

             reply	other threads:[~2005-02-23 14:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-23 14:46 Daniel J Walsh [this message]
2005-02-24 14:14 ` policycoreutils fixes Stephen Smalley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=421C9750.4080402@redhat.com \
    --to=dwalsh@redhat.com \
    --cc=SELinux@tycho.nsa.gov \
    --cc=sds@epoch.ncsc.mil \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.