-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Avoid bad data getting through semanage command. This patch looks good to me. acked. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlJpNq0ACgkQrlYvE4MpobNiaQCgjNSzsoiRwa31KlLiGTUj1wxs EhEAoJpZUhnIDL66td2Lq3BjPTe3No59 =4dO1 -----END PGP SIGNATURE-----
>From f043061e83611e9ff26309b8708a690c9c0d81e4 Mon Sep 17 00:00:00 2001 From: Dan Walsh <dwalsh@xxxxxxxxxx> Date: Fri, 11 Oct 2013 09:10:31 -0400 Subject: [PATCH 57/74] If users of seobject set serange or seuser to "", we need to override. Do not want bad data getting into the system --- policycoreutils/semanage/seobject.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/policycoreutils/semanage/seobject.py b/policycoreutils/semanage/seobject.py index b0c88cd..ba7c013 100644 --- a/policycoreutils/semanage/seobject.py +++ b/policycoreutils/semanage/seobject.py @@ -1788,9 +1788,15 @@ class fcontextRecords(semanageRecords): raise ValueError(_("File spec %s conflicts with equivalency rule '%s %s'; Try adding '%s' instead") % (target, i, fdict[i], t)) - def __add(self, target, type, ftype = "", serange = "", seuser = "system_u"): + def __add(self, target, type, ftype = "", serange = "s0", seuser = "system_u"): self.validate(target) + if seuser == "": + seuser = "system_u" + + if serange == "": + serange = "s0" + if is_mls_enabled == 1: serange = untranslate(serange) -- 1.8.3.1