From 87674a86bb56decce9bb66d65969c2f05be88bb4 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Fri, 26 May 2006 12:49:40 +0000 Subject: [PATCH] * Fri May 26 2006 Dan Walsh 1.30.10-4 - Fix seobject.py to not sort the file_context file. - move setfiles to /sbin --- policycoreutils-rhat.patch | 98 ++++++++++++++++++++++++++++++++++++++ policycoreutils.spec | 10 ++-- 2 files changed, 105 insertions(+), 3 deletions(-) diff --git a/policycoreutils-rhat.patch b/policycoreutils-rhat.patch index 323b2a9..240ce7b 100644 --- a/policycoreutils-rhat.patch +++ b/policycoreutils-rhat.patch @@ -5902,3 +5902,101 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/po/te.po policycoreutils +#, c-format +msgid "Options Error: %s " +msgstr "" +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/restorecon/restorecon.8 policycoreutils-1.30.10/restorecon/restorecon.8 +--- nsapolicycoreutils/restorecon/restorecon.8 2006-05-15 09:42:56.000000000 -0400 ++++ policycoreutils-1.30.10/restorecon/restorecon.8 2006-05-23 23:55:08.000000000 -0400 +@@ -50,6 +50,8 @@ + .SH "ARGUMENTS" + .B pathname... + The pathname for the file(s) to be relabeled. ++.SH NOTE ++restorecon does not follow symbolic links. + + .SH "AUTHOR" + This man page was written by Dan Walsh . +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/scripts/fixfiles policycoreutils-1.30.10/scripts/fixfiles +--- nsapolicycoreutils/scripts/fixfiles 2006-05-15 09:42:56.000000000 -0400 ++++ policycoreutils-1.30.10/scripts/fixfiles 2006-05-24 00:12:54.000000000 -0400 +@@ -30,7 +30,8 @@ + OUTFILES="" + LOGFILE=/dev/null + SYSLOGFLAG="-l" +-SETFILES=/usr/sbin/setfiles ++LOGGER=/usr/sbin/logger ++SETFILES=/sbin/setfiles + RESTORECON=/sbin/restorecon + FILESYSTEMSRW=`mount | grep -v "context=" | egrep -v '\((|.*,)bind(,.*|)\)' | awk '/(ext[23]| xfs | jfs ).*\(rw/{print $3}';` + FILESYSTEMSRO=`mount | grep -v "context=" | egrep -v '\((|.*,)bind(,.*|)\)' | awk '/(ext[23]| xfs | jfs ).*\(ro/{print $3}';` +@@ -48,8 +49,6 @@ + # + logit () { + if [ -z $LOGFILE ]; then +- logger -i $1 +-else + echo $1 >> $LOGFILE + fi + } +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/semanage/seobject.py policycoreutils-1.30.10/semanage/seobject.py +--- nsapolicycoreutils/semanage/seobject.py 2006-05-23 06:19:30.000000000 -0400 ++++ policycoreutils-1.30.10/semanage/seobject.py 2006-05-26 08:25:25.000000000 -0400 +@@ -1145,7 +1145,7 @@ + semanage_fcontext_key_free(k) + + def get_all(self): +- ddict = {} ++ l = [] + (rc, self.flist) = semanage_fcontext_list(self.sh) + if rc < 0: + raise ValueError(_("Could not list file contexts")) +@@ -1156,29 +1156,24 @@ + ftype_str = semanage_fcontext_get_type_str(ftype) + con = semanage_fcontext_get_con(fcontext) + if con: +- ddict[expr, ftype_str] = (semanage_context_get_user(con), semanage_context_get_role(con), semanage_context_get_type(con), semanage_context_get_mls(con)) ++ l.append((expr, ftype_str, semanage_context_get_user(con), semanage_context_get_role(con), semanage_context_get_type(con), semanage_context_get_mls(con))) + else: +- ddict[expr, ftype_str] = con ++ l.append((expr, ftype_str, con)) + +- return ddict ++ return l + + def list(self, heading = 1): + if heading: + print "%-50s %-18s %s\n" % ("SELinux fcontext", "type", "Context") +- ddict = self.get_all() +- keys = ddict.keys() +- if is_mls_enabled: +- for k in keys: +- if ddict[k]: +- print "%-50s %-18s %s:%s:%s:%s " % (k[0], k[1], ddict[k][0], ddict[k][1],ddict[k][2], translate(ddict[k][3],False)) +- else: +- print "%-50s %-18s <>" % (k[0], k[1]) +- else: +- for k in keys: +- if ddict[k]: +- print "%-50s %-18s %s:%s:%s " % (k[0], k[1], ddict[k][0], ddict[k][1],ddict[k][2]) ++ fcon_list = self.get_all() ++ for fcon in fcon_list: ++ if len(fcon) > 3: ++ if is_mls_enabled: ++ print "%-50s %-18s %s:%s:%s:%s " % (fcon[0], fcon[1], fcon[2], fcon[3], fcon[4], translate(fcon[5],False)) + else: +- print "%-50s %-18s <>" % (k[0], k[1]) ++ print "%-50s %-18s %s:%s:%s " % (fcon[0], fcon[1], fcon[2], fcon[3],fcon[4]) ++ else: ++ print "%-50s %-18s <>" % (fcon[0], fcon[1]) + + class booleanRecords(semanageRecords): + def __init__(self): +diff --exclude-from=exclude -N -u -r nsapolicycoreutils/setfiles/Makefile policycoreutils-1.30.10/setfiles/Makefile +--- nsapolicycoreutils/setfiles/Makefile 2006-05-15 09:43:12.000000000 -0400 ++++ policycoreutils-1.30.10/setfiles/Makefile 2006-05-24 00:05:39.000000000 -0400 +@@ -1,6 +1,6 @@ + # Installation directories. + PREFIX ?= ${DESTDIR}/usr +-SBINDIR ?= $(PREFIX)/sbin ++SBINDIR ?= $(DESTDIR)/sbin + MANDIR = $(PREFIX)/share/man + LIBDIR ?= $(PREFIX)/lib + diff --git a/policycoreutils.spec b/policycoreutils.spec index 01bc618..00f4e58 100644 --- a/policycoreutils.spec +++ b/policycoreutils.spec @@ -5,7 +5,7 @@ Summary: SELinux policy core utilities. Name: policycoreutils Version: 1.30.10 -Release: 3 +Release: 4 License: GPL Group: System Environment/Base Source: http://www.nsa.gov/selinux/archives/policycoreutils-%{version}.tgz @@ -47,7 +47,7 @@ make LOG_AUDIT_PRIV=y LIBDIR="%{_libdir}" CFLAGS="%{optflags}" all %install rm -rf %{buildroot} -mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d +mkdir -p %{buildroot}/etc/rc.d/init.d mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_sbindir} mkdir -p %{buildroot}/sbin @@ -65,8 +65,8 @@ rm -rf %{buildroot} %defattr(-,root,root) /sbin/restorecon /sbin/fixfiles +/sbin/setfiles %{_sbindir}/restorecond -%{_sbindir}/setfiles %{_sbindir}/setsebool %{_sbindir}/semodule %{_sbindir}/semanage @@ -114,6 +114,10 @@ rm -rf %{buildroot} [ -x /sbin/service ] && /sbin/service restorecond condrestart %changelog +* Fri May 26 2006 Dan Walsh 1.30.10-4 +- Fix seobject.py to not sort the file_context file. +- move setfiles to /sbin + * Wed May 24 2006 James Antill 1.30.10-3 - secon man page and getopt fixes. - Enable mass relabel audit, even though it doesn't work.