Fix dpi handling in sandbox

Make sure semanage fcontext -l -C prints if only local equiv have changed
This commit is contained in:
Dan Walsh 2011-11-29 15:58:56 -05:00
parent 656414a035
commit 6b9bc0eb8f
2 changed files with 31 additions and 6 deletions

View File

@ -614,7 +614,7 @@ index 48d7baa..2c0cfdd 100644
errorExit(error.args[0])
except KeyError, error:
diff --git a/policycoreutils/semanage/seobject.py b/policycoreutils/semanage/seobject.py
index a7008fc..aae1b59 100644
index a7008fc..9445b76 100644
--- a/policycoreutils/semanage/seobject.py
+++ b/policycoreutils/semanage/seobject.py
@@ -30,11 +30,10 @@ from IPy import IP
@ -784,12 +784,36 @@ index a7008fc..aae1b59 100644
(rc, fcontext) = semanage_fcontext_create(self.sh)
if rc < 0:
@@ -1825,9 +1850,17 @@ class fcontextRecords(semanageRecords):
print "%-50s %-18s %s:%s:%s " % (k[0], k[1], fcon_dict[k][0], fcon_dict[k][1],fcon_dict[k][2])
else:
print "%-50s %-18s <<None>>" % (k[0], k[1])
@@ -1811,23 +1836,28 @@ class fcontextRecords(semanageRecords):
def list(self, heading = 1, locallist = 0 ):
fcon_dict = self.get_all(locallist)
keys = fcon_dict.keys()
- if len(keys) == 0:
- return
- keys.sort()
-
- if heading:
- print "%-50s %-18s %s\n" % (_("SELinux fcontext"), _("type"), _("Context"))
- for k in keys:
- if fcon_dict[k]:
- if is_mls_enabled:
- print "%-50s %-18s %s:%s:%s:%s " % (k[0], k[1], fcon_dict[k][0], fcon_dict[k][1], fcon_dict[k][2], translate(fcon_dict[k][3],False))
+ if len(keys) != 0:
+ keys.sort()
+ if heading:
+ print "%-50s %-18s %s\n" % (_("SELinux fcontext"), _("type"), _("Context"))
+ for k in keys:
+ if fcon_dict[k]:
+ if is_mls_enabled:
+ print "%-50s %-18s %s:%s:%s:%s " % (k[0], k[1], fcon_dict[k][0], fcon_dict[k][1], fcon_dict[k][2], translate(fcon_dict[k][3],False))
+ else:
+ print "%-50s %-18s %s:%s:%s " % (k[0], k[1], fcon_dict[k][0], fcon_dict[k][1],fcon_dict[k][2])
else:
- print "%-50s %-18s %s:%s:%s " % (k[0], k[1], fcon_dict[k][0], fcon_dict[k][1],fcon_dict[k][2])
- else:
- print "%-50s %-18s <<None>>" % (k[0], k[1])
- if len(self.equiv.keys()) > 0:
+
+ print "%-50s %-18s <<None>>" % (k[0], k[1])
+
+ if len(self.equiv_dist):
+ if not locallist:

View File

@ -354,6 +354,7 @@ fi
%changelog
* Tue Nov 29 2011 Dan Walsh <dwalsh@redhat.com> - 2.1.8-7
- Fix dpi handling in sandbox
- Make sure semanage fcontext -l -C prints if only local equiv have changed
* Wed Nov 16 2011 Dan Walsh <dwalsh@redhat.com> - 2.1.8-6
- Add listing of distribution equivalence class from semanage fcontext -l