diff --git a/policycoreutils-rhat.patch b/policycoreutils-rhat.patch index 811e968..467021a 100644 --- a/policycoreutils-rhat.patch +++ b/policycoreutils-rhat.patch @@ -30,30 +30,57 @@ diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po rc |= cap_set_flag(new_caps, CAP_PERMITTED, 6, cap_list, CAP_SET); diff --exclude-from=exclude --exclude=sepolgen-1.0.13 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/semanage/seobject.py policycoreutils-2.0.57/semanage/seobject.py --- nsapolicycoreutils/semanage/seobject.py 2008-09-12 11:48:15.000000000 -0400 -+++ policycoreutils-2.0.57/semanage/seobject.py 2008-10-23 14:05:27.000000000 -0400 -@@ -1430,7 +1430,7 @@ - if rc < 0: - raise ValueError(_("Could not create key for %s") % target) ++++ policycoreutils-2.0.57/semanage/seobject.py 2008-10-28 15:48:14.000000000 -0400 +@@ -35,7 +35,7 @@ + import __builtin__ + __builtin__.__dict__['_'] = unicode -- (rc,exists) = semanage_fcontext_exists(self.sh, k) -+ (rc,exists) = semanage_fcontext_exists_local(self.sh, k) +-is_mls_enabled = selinux.is_selinux_mls_enabled() ++is_mls_enabled = not selinux.is_selinux_enabled() or selinux.is_selinux_mls_enabled() + + import syslog + +@@ -1433,8 +1433,14 @@ + (rc,exists) = semanage_fcontext_exists(self.sh, k) if rc < 0: raise ValueError(_("Could not check if file context for %s is defined") % target) - if exists: -@@ -1485,7 +1485,11 @@ +- if exists: +- raise ValueError(_("File context for %s already defined") % target) ++ ++ if not exists: ++ (rc,exists) = semanage_fcontext_exists_local(self.sh, k) ++ if rc < 0: ++ raise ValueError(_("Could not check if file context for %s is defined") % target) ++ ++ if exists: ++ raise ValueError(_("File context for %s already defined") % target) + + (rc,fcontext) = semanage_fcontext_create(self.sh) + if rc < 0: +@@ -1481,15 +1487,19 @@ + if rc < 0: + raise ValueError(_("Could not create a key for %s") % target) + +- (rc,exists) = semanage_fcontext_exists_local(self.sh, k) ++ (rc,exists) = semanage_fcontext_exists(self.sh, k) if rc < 0: raise ValueError(_("Could not check if file context for %s is defined") % target) if not exists: - raise ValueError(_("File context for %s is not defined") % target) -+ (rc,exists) = semanage_fcontext_exists(self.sh, k) -+ if exists: -+ return self.__add(target, setype, ftype, serange, seuser) -+ else: ++ (rc,exists) = semanage_fcontext_exists_local(self.sh, k) ++ if not exists: + raise ValueError(_("File context for %s is not defined") % target) (rc,fcontext) = semanage_fcontext_query_local(self.sh, k) if rc < 0: -@@ -1591,30 +1595,33 @@ +- raise ValueError(_("Could not query file context for %s") % target) ++ (rc,fcontext) = semanage_fcontext_query(self.sh, k) ++ if rc < 0: ++ raise ValueError(_("Could not query file context for %s") % target) + + if setype != "<>": + con = semanage_fcontext_get_con(fcontext) +@@ -1591,30 +1601,33 @@ self.flist += fclocal