All of lore.kernel.org
 help / color / mirror / Atom feed
* [Fwd: policycoreutils patches]
@ 2007-04-13 12:53 Daniel J Walsh
  2007-04-13 14:31 ` Stephen Smalley
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Daniel J Walsh @ 2007-04-13 12:53 UTC (permalink / raw)
  To: Stephen Smalley, SE Linux

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

Moved audit2allow to sbin to match audit2why.

Fix chcat to handle case where there are no categories.

Change fixfiles to run setfiles in quiet mode

Change genhomedircon to verify context before setting homedir file
context. This can happen if you have different user types, where one
type has a homedir file context while another one does not.

restorecond init script does not return status properly

Fix output of restorecon.c errors to show correct error message.




[-- Attachment #2: audit2allow.patch --]
[-- Type: text/x-patch, Size: 374 bytes --]

--- nsapolicycoreutils/audit2allow/Makefile	2007-02-07 12:11:49.000000000 -0500
+++ policycoreutils-2.0.7/audit2allow/Makefile	2007-03-23 09:03:56.000000000 -0400
@@ -1,6 +1,6 @@
 # Installation directories.
 PREFIX ?= ${DESTDIR}/usr
-BINDIR ?= $(PREFIX)/bin
+BINDIR ?= $(PREFIX)/sbin
 LIBDIR ?= $(PREFIX)/lib
 MANDIR ?= $(PREFIX)/share/man
 LOCALEDIR ?= /usr/share/locale


[-- Attachment #3: chcat.patch --]
[-- Type: text/x-patch, Size: 1266 bytes --]

--- nsapolicycoreutils/scripts/chcat	2007-02-22 08:53:22.000000000 -0500
+++ policycoreutils-2.0.7/scripts/chcat	2007-03-23 09:03:56.000000000 -0400
@@ -74,9 +74,11 @@
             if i not in cats:
                 cats.append(i)
 
-        new_serange = "%s-%s:%s" % (serange[0], top[0], string.join(cats, ","))
-        if new_serange[-1:] == ":":
-            new_serange = new_serange[:-1]
+            
+        if len(cats) > 0:
+            new_serange = "%s-%s:%s" % (serange[0], top[0], ",".join(cats))
+        else
+            new_serange = "%s-%s" % (serange[0], top[0])
             
         if add_ind:
             cmd = "semanage login -a -r %s -s %s %s" % (new_serange, user[0], u)
@@ -151,10 +153,11 @@
             if i in cats:
                 cats.remove(i)
 
-        new_serange = "%s-%s:%s" % (serange[0], top[0], string.join(cats, ","))
-        if new_serange[-1:] == ":":
-            new_serange = new_serange[:-1]
-        
+        if len(cats) > 0:
+            new_serange = "%s-%s:%s" % (serange[0], top[0], ",".join(cats))
+        else
+            new_serange = "%s-%s" % (serange[0], top[0])
+            
         if add_ind:
             cmd = "semanage login -a -r %s -s %s %s" % (new_serange, user[0], u)
         else:


[-- Attachment #4: fixfiles.patch --]
[-- Type: text/x-patch, Size: 413 bytes --]

--- nsapolicycoreutils/scripts/fixfiles	2007-01-11 08:56:30.000000000 -0500
+++ policycoreutils-2.0.7/scripts/fixfiles	2007-03-23 14:24:15.000000000 -0400
@@ -138,7 +138,7 @@
     exit $?
 fi
 LogReadOnly
-${SETFILES} ${OUTFILES} ${SYSLOGFLAG} ${FORCEFLAG} $* ${FC} ${FILESYSTEMSRW} 2>&1 >> $LOGFILE
+${SETFILES} -q ${OUTFILES} ${SYSLOGFLAG} ${FORCEFLAG} $* ${FC} ${FILESYSTEMSRW} 2>&1 >> $LOGFILE
 exit $?
 }
 


[-- Attachment #5: genhomedircon.patch --]
[-- Type: text/x-patch, Size: 674 bytes --]

--- nsapolicycoreutils/scripts/genhomedircon	2006-11-28 09:24:33.000000000 -0500
+++ policycoreutils-2.0.7/scripts/genhomedircon	2007-04-09 15:44:47.000000000 -0400
@@ -26,6 +26,7 @@
 
 import sys, os, pwd, string, getopt, re
 from semanage import *;
+import selinux
 import gettext
 gettext.install('policycoreutils')
 
@@ -249,7 +250,10 @@
 				i = i.replace("HOME_DIR", home)
 				i = i.replace("ROLE", prefix)
 				i = i.replace("system_u", seuser)
-				ret = ret+i
+				# Validate if the generated context exists.  Some user types may not exist
+				scon = i.split()[-1]
+				if selinux.security_check_context(scon) == 0:
+					ret = ret+i
 		fd.close()
 		return ret


[-- Attachment #6: restorecon.patch --]
[-- Type: text/x-patch, Size: 427 bytes --]

--- nsapolicycoreutils/restorecon/restorecon.c	2006-11-16 17:14:26.000000000 -0500
+++ policycoreutils-2.0.7/restorecon/restorecon.c	2007-03-23 09:03:56.000000000 -0400
@@ -336,8 +336,8 @@
 				if (!file_exist && errno == ENOENT)
 					return;
 				fprintf(stderr,
-					"%s:  error while labeling files under %s\n",
-					progname, buf);
+					"%s: %s: %s\n",
+					progname, buf, strerror(errno));
 				errors++;
 			}
 		}


[-- Attachment #7: restorecond.patch --]
[-- Type: text/x-patch, Size: 288 bytes --]

--- nsapolicycoreutils/restorecond/restorecond.init	2007-03-01 17:23:40.000000000 -0500
+++ policycoreutils-2.0.7/restorecond/restorecond.init	2007-03-23 09:03:56.000000000 -0400
@@ -73,6 +73,7 @@
         ;;
   status)
 	status restorecond
+	RETVAL=$?
 	;;
   restart|reload)
 	restart


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2007-04-24 14:04 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-13 12:53 [Fwd: policycoreutils patches] Daniel J Walsh
2007-04-13 14:31 ` Stephen Smalley
2007-04-13 14:39   ` Daniel J Walsh
2007-04-13 14:49     ` Stephen Smalley
2007-04-13 14:52       ` Stephen Smalley
2007-04-13 15:10         ` Daniel J Walsh
2007-04-13 15:18           ` Stephen Smalley
2007-04-13 15:17       ` Karl MacMillan
2007-04-13 18:43         ` Stephen Smalley
2007-04-13 18:50           ` Karl MacMillan
2007-04-13 18:33 ` Karl MacMillan
2007-04-24 14:04 ` Stephen Smalley

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.