-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 This patch looks good to me. acked. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlD+plIACgkQrlYvE4MpobOMaACgub+fxDDIMgAhtw7uS17/QkZm TpYAniPp6hIqrsxL2etuj0Yf4AmAwhXx =PgW0 -----END PGP SIGNATURE-----
>From d6693c4722db7cb06b071f234a0ed52c55107658 Mon Sep 17 00:00:00 2001 From: Eric Paris <eparis@xxxxxxxxxx> Date: Wed, 14 Nov 2012 15:36:36 -0500 Subject: [PATCH 34/84] policycoreutils: sandbox: use sepolicy to look for sandbox_t Signed-off-by: Eric Paris <eparis@xxxxxxxxxx> --- policycoreutils/sandbox/sandbox | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/policycoreutils/sandbox/sandbox b/policycoreutils/sandbox/sandbox index 0ecb6be..4546014 100644 --- a/policycoreutils/sandbox/sandbox +++ b/policycoreutils/sandbox/sandbox @@ -26,7 +26,7 @@ import signal from tempfile import mkdtemp import pwd import commands -import setools +import sepolicy PROGNAME = "policycoreutils" SEUNSHARE = "/usr/sbin/seunshare" @@ -275,7 +275,7 @@ kill -TERM $WM_PID 2> /dev/null types = _(""" Policy defines the following types for use with the -t: \t%s -""") % "\n\t".join(setools.seinfo(setools.ATTRIBUTE, "sandbox_type")[0]['types']) +""") % "\n\t".join(sepolicy.info(sepolicy.ATTRIBUTE, "sandbox_type")[0]['types']) except RuntimeError: pass @@ -349,7 +349,12 @@ sandbox [-h] [-c] [-l level ] [-[X|M] [-H homedir] [-T tempdir]] [-I includefile if self.__options.X_ind: self.setype = DEFAULT_X_TYPE - + else: + try: + sepolicy.info(sepolicy.TYPE, "sandbox_t") + except RuntimeError: + raise ValueError(_("Sandbox Policy is currently disabled.\nYou need to enable the policy by executing the following as root\n# semodule -e sandbox")) + if self.__options.setype: self.setype = self.__options.setype -- 1.8.1