From 913872747b53b408f3fa8a72b7f4ceaee85531b0 Mon Sep 17 00:00:00 2001 From: Dan Walsh Date: Dec 14 2010 14:28:34 +0000 Subject: - Fix sandbox handling of sandbox_type --- diff --git a/policycoreutils-rhat.patch b/policycoreutils-rhat.patch index 62b0a42..a825f0f 100644 --- a/policycoreutils-rhat.patch +++ b/policycoreutils-rhat.patch @@ -2162,7 +2162,7 @@ diff -up policycoreutils-2.0.83/sandbox/sandbox.init.rhat policycoreutils-2.0.83 # Source function library. diff -up policycoreutils-2.0.83/sandbox/sandbox.rhat policycoreutils-2.0.83/sandbox/sandbox --- policycoreutils-2.0.83/sandbox/sandbox.rhat 2010-06-16 08:04:12.000000000 -0400 -+++ policycoreutils-2.0.83/sandbox/sandbox 2010-12-07 09:23:49.000000000 -0500 ++++ policycoreutils-2.0.83/sandbox/sandbox 2010-12-14 09:25:56.000000000 -0500 @@ -1,5 +1,6 @@ -#! /usr/bin/python -E +#! /usr/bin/python -Es @@ -2290,7 +2290,7 @@ diff -up policycoreutils-2.0.83/sandbox/sandbox.rhat policycoreutils-2.0.83/sand kill -TERM $WM_PID 2> /dev/null """ % (command, wm, command)) fd.close() -@@ -226,14 +245,20 @@ kill -TERM $WM_PID 2> /dev/null +@@ -226,14 +245,25 @@ kill -TERM $WM_PID 2> /dev/null def usage(self, message = ""): error_exit("%s\n%s" % (self.__parser.usage, message)) @@ -2298,16 +2298,21 @@ diff -up policycoreutils-2.0.83/sandbox/sandbox.rhat policycoreutils-2.0.83/sand + def __parse_options(self): from optparse import OptionParser -+ types = "\t" + "\n\t".join(setools.seinfo(setools.ATTRIBUTE, "sandbox_type")[0]['types']) ++ types = "" ++ try: ++ types = _(""" ++Policy defines the following types for use with the -t: ++\t%s ++""") % "\n\t".join(setools.seinfo(setools.ATTRIBUTE, "sandbox_type")[0]['types']) ++ except RuntimeError: ++ pass ++ usage = _(""" -sandbox [-h] [-[X|M] [-l level ] [-H homedir] [-T tempdir]] [-I includefile ] [-W windowmanager ] [[-i file ] ...] [ -t type ] command +sandbox [-h] [-l level ] [-[X|M] [-H homedir] [-T tempdir]] [-I includefile ] [-W windowmanager ] [ -w windowsize ] [[-i file ] ...] [ -t type ] command + +sandbox [-h] [-l level ] [-[X|M] [-H homedir] [-T tempdir]] [-I includefile ] [-W windowmanager ] [ -w windowsize ] [[-i file ] ...] [ -t type ] -S -+ -+Policy defines the following types for use with the -t: +%s -+ +""") % types -sandbox [-h] [-[X|M] [-l level ] [-H homedir] [-T tempdir]] [-I includefile ] [-W windowmanager ] [[-i file ] ...] [ -t type ] -S @@ -2315,7 +2320,7 @@ diff -up policycoreutils-2.0.83/sandbox/sandbox.rhat policycoreutils-2.0.83/sand parser = OptionParser(version=self.VERSION, usage=usage) parser.disable_interspersed_args() -@@ -268,6 +293,10 @@ sandbox [-h] [-[X|M] [-l level ] [-H hom +@@ -268,6 +298,10 @@ sandbox [-h] [-[X|M] [-l level ] [-H hom action="callback", callback=self.__validdir, help=_("alternate /tmp directory to use for mounting")) @@ -2326,7 +2331,7 @@ diff -up policycoreutils-2.0.83/sandbox/sandbox.rhat policycoreutils-2.0.83/sand parser.add_option("-W", "--windowmanager", dest="wm", type="string", default="/usr/bin/matchbox-window-manager -use_titlebar no", -@@ -276,13 +305,17 @@ sandbox [-h] [-[X|M] [-l level ] [-H hom +@@ -276,13 +310,17 @@ sandbox [-h] [-[X|M] [-l level ] [-H hom parser.add_option("-l", "--level", dest="level", help=_("MCS/MLS level for the sandbox")) @@ -2345,7 +2350,7 @@ diff -up policycoreutils-2.0.83/sandbox/sandbox.rhat policycoreutils-2.0.83/sand if self.__options.setype: self.setype = self.__options.setype -@@ -299,6 +332,9 @@ sandbox [-h] [-[X|M] [-l level ] [-H hom +@@ -299,6 +337,9 @@ sandbox [-h] [-[X|M] [-l level ] [-H hom self.__options.X_ind = True self.__homedir = self.__options.homedir self.__tmpdir = self.__options.tmpdir @@ -2355,7 +2360,7 @@ diff -up policycoreutils-2.0.83/sandbox/sandbox.rhat policycoreutils-2.0.83/sand else: if len(cmds) == 0: self.usage(_("Command required")) -@@ -351,22 +387,24 @@ sandbox [-h] [-[X|M] [-l level ] [-H hom +@@ -351,22 +392,24 @@ sandbox [-h] [-[X|M] [-l level ] [-H hom def __execute(self): try: diff --git a/policycoreutils.spec b/policycoreutils.spec index a9077b1..cd8b31a 100644 --- a/policycoreutils.spec +++ b/policycoreutils.spec @@ -7,7 +7,7 @@ Summary: SELinux policy core utilities Name: policycoreutils Version: 2.0.83 -Release: 33.4%{?dist} +Release: 33.5%{?dist} License: GPLv2 Group: System Environment/Base Source: http://www.nsa.gov/selinux/archives/policycoreutils-%{version}.tgz @@ -64,7 +64,7 @@ context. %patch4 -p1 -b .sepolgen %build -make LSPP_PRIV=y LIBDIR="%{_libdir}" CFLAGS="%{optflags} -fPIE" LDFLAGS="-pie -Wl,-z,relro" all +make LSPP_PRIV=y LIBDIR="%{_libdir}" CFLAGS="%{optflags} -fPIE " LDFLAGS="-pie -Wl,-z,relro" all make -C sepolgen-%{sepolgenver} LSPP_PRIV=y LIBDIR="%{_libdir}" CFLAGS="%{optflags} -fPIE" LDFLAGS="-pie -Wl,-z,relro" all %install @@ -315,6 +315,9 @@ fi exit 0 %changelog +* Tue Dec 14 2010 Dan Walsh 2.0.83-33.5 +- Fix sandbox handling of sandbox_type + * Tue Dec 7 2010 Dan Walsh 2.0.83-33.4 - Fix fixfiles to not complain on missing directories.