From 37eaabdd9591b4c86d4ae341f617afd1185409fc Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Sat, 14 Jan 2006 13:54:25 +0000 Subject: [PATCH] * Sat Jan 14 2006 Dan Walsh 1.29.7-3 - Add check for root for semanage, genhomedircon --- policycoreutils-rhat.patch | 35 ++++++++++++++++++++++++++++++++--- policycoreutils.spec | 5 ++++- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/policycoreutils-rhat.patch b/policycoreutils-rhat.patch index be7d512..495ca0f 100644 --- a/policycoreutils-rhat.patch +++ b/policycoreutils-rhat.patch @@ -1,7 +1,35 @@ +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/genhomedircon policycoreutils-1.29.7/scripts/genhomedircon +--- nsapolicycoreutils/scripts/genhomedircon 2006-01-13 09:47:40.000000000 -0500 ++++ policycoreutils-1.29.7/scripts/genhomedircon 2006-01-14 08:39:02.000000000 -0500 +@@ -327,6 +327,9 @@ + sys.stderr.write("%s: %s\n" % ( sys.argv[0], error )) + + ++if os.getuid() > 0 or os.geteuid() > 0: ++ print "You must be root to run %s." % sys.argv[0] ++ sys.exit(0) + + # + # This script will generate home dir file context diff --exclude-from=exclude -N -u -r nsapolicycoreutils/semanage/semanage policycoreutils-1.29.7/semanage/semanage --- nsapolicycoreutils/semanage/semanage 2006-01-13 09:47:40.000000000 -0500 -+++ policycoreutils-1.29.7/semanage/semanage 2006-01-14 01:50:09.000000000 -0500 -@@ -186,6 +186,7 @@ ++++ policycoreutils-1.29.7/semanage/semanage 2006-01-14 08:38:35.000000000 -0500 +@@ -20,10 +20,13 @@ + # 02111-1307 USA + # + # +-import sys, getopt ++import os, sys, getopt + import seobject + + if __name__ == '__main__': ++ if os.getuid() > 0 or os.geteuid() > 0: ++ print "You must be root to run %s." % sys.argv[0] ++ sys.exit(0) + + def usage(message = ""): + print '\ +@@ -186,6 +189,7 @@ if object == "fcontext": OBJECT.add(target, setype, ftype, serange, seuser) @@ -9,7 +37,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/semanage/semanage policy sys.exit(0); if modify: -@@ -210,8 +211,13 @@ +@@ -210,8 +214,13 @@ if delete: if object == "port": OBJECT.delete(target, proto) @@ -930,3 +958,4 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/semanage/seobject.py pol - - + print "%-50s %-18s " % (k[0], dict[k][0]) +Binary files nsapolicycoreutils/semanage/seobject.pyc and policycoreutils-1.29.7/semanage/seobject.pyc differ diff --git a/policycoreutils.spec b/policycoreutils.spec index 61750a5..33ce6e1 100644 --- a/policycoreutils.spec +++ b/policycoreutils.spec @@ -4,7 +4,7 @@ Summary: SELinux policy core utilities. Name: policycoreutils Version: 1.29.7 -Release: 2 +Release: 3 License: GPL Group: System Environment/Base Source: http://www.nsa.gov/selinux/archives/policycoreutils-%{version}.tgz @@ -97,6 +97,9 @@ rm -rf ${RPM_BUILD_ROOT} %{_libdir}/python2.4/site-packages/seobject.py* %changelog +* Sat Jan 14 2006 Dan Walsh 1.29.7-3 +- Add check for root for semanage, genhomedircon + * Sat Jan 14 2006 Dan Walsh 1.29.7-2 - Add ivans patch