From a97a5f63af4f886db3a9af1e0d73a39531215ba6 Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Fri, 8 Jan 2016 23:25:39 +0100 Subject: [PATCH] policycoreutils-2.5-0.99.rc1.1.fc24 Update to upstream rc1 release 2016-01-07 --- make-rhat-patches.sh | 11 +- policycoreutils-rhat.patch | 6946 +++++++++--------------------------- policycoreutils.spec | 47 +- sepolgen-rhat.patch | 2558 +------------ 4 files changed, 1729 insertions(+), 7833 deletions(-) diff --git a/make-rhat-patches.sh b/make-rhat-patches.sh index 4721f6e..d50bfe3 100755 --- a/make-rhat-patches.sh +++ b/make-rhat-patches.sh @@ -1,13 +1,14 @@ #!/bin/bash -POLICYCOREUTILS_VERSION=2.4 -SEPOLGEN_VERSION=1.2.2 -BRANCH=master +POLICYCOREUTILS_VERSION=2.5-rc1 +SEPOLGEN_VERSION=1.2.3-rc1 +REPO=https://github.com/fedora-selinux/selinux +BRANCH=master-rc REBASEDIR=`mktemp -d rebase.XXXXXX` pushd $REBASEDIR -git clone git@github.com:fedora-selinux/selinux.git +git clone $REPO pushd selinux; git checkout $BRANCH; COMMIT=`git rev-parse --verify HEAD`; popd # prepare policycoreutils-rhat.patch @@ -37,4 +38,4 @@ popd popd # echo rm -rf $REBASEDIR -echo policycoreutils-rhat.patch and sepolgen-rhat.patch created from https://github.com/fedora-selinux/selinux/commit/$COMMIT +echo policycoreutils-rhat.patch and sepolgen-rhat.patch created from $REPO/$COMMIT diff --git a/policycoreutils-rhat.patch b/policycoreutils-rhat.patch index b8c7877..8f24657 100644 --- a/policycoreutils-rhat.patch +++ b/policycoreutils-rhat.patch @@ -1,412 +1,17 @@ -diff --git a/policycoreutils-2.4/Makefile b/policycoreutils-2.4/Makefile +diff --git a/policycoreutils-2.5-rc1/Makefile b/policycoreutils-2.5-rc1/Makefile index 962ac12..6a9c40c 100644 ---- a/policycoreutils-2.4/Makefile -+++ b/policycoreutils-2.4/Makefile +--- a/policycoreutils-2.5-rc1/Makefile ++++ b/policycoreutils-2.5-rc1/Makefile @@ -1,4 +1,4 @@ -SUBDIRS = sepolicy setfiles semanage load_policy newrole run_init sandbox secon audit2allow sestatus semodule_package semodule semodule_link semodule_expand semodule_deps sepolgen-ifgen setsebool scripts po man gui hll +SUBDIRS = sepolicy setfiles semanage load_policy newrole run_init sandbox secon audit2allow sestatus semodule_package semodule semodule_link semodule_expand semodule_deps sepolgen-ifgen setsebool scripts po man gui hll semanage/default_encoding INOTIFYH = $(shell ls /usr/include/sys/inotify.h 2>/dev/null) -diff --git a/policycoreutils-2.4/audit2allow/audit2allow b/policycoreutils-2.4/audit2allow/audit2allow -index c9713a2..ffdbc2e 100644 ---- a/policycoreutils-2.4/audit2allow/audit2allow -+++ b/policycoreutils-2.4/audit2allow/audit2allow -@@ -1,4 +1,4 @@ --#! /usr/bin/python -Es -+#! /usr/bin/python3 -Es - # Authors: Karl MacMillan - # Authors: Dan Walsh - # -@@ -31,7 +31,10 @@ import sepolgen.module as module - from sepolgen.sepolgeni18n import _ - import selinux.audit2why as audit2why - import locale --locale.setlocale(locale.LC_ALL, '') -+try: -+ locale.setlocale(locale.LC_ALL, '') -+except: -+ pass - - class AuditToPolicy: - VERSION = "%prog .1" -@@ -135,13 +138,13 @@ class AuditToPolicy: - elif self.__options.audit: - try: - messages = audit.get_audit_msgs() -- except OSError, e: -+ except OSError as e: - sys.stderr.write('could not run ausearch - "%s"\n' % str(e)) - sys.exit(1) - elif self.__options.boot: - try: - messages = audit.get_audit_boot_msgs() -- except OSError, e: -+ except OSError as e: - sys.stderr.write('could not run ausearch - "%s"\n' % str(e)) - sys.exit(1) - else: -@@ -152,7 +155,7 @@ class AuditToPolicy: - if filename is not None: - try: - f = open(filename) -- except IOError, e: -+ except IOError as e: - sys.stderr.write('could not open file %s - "%s"\n' % (filename, str(e))) - sys.exit(1) - -@@ -214,7 +217,7 @@ class AuditToPolicy: - - try: - fd = open(filename, "w") -- except IOError, e: -+ except IOError as e: - sys.stderr.write("could not write output file: %s\n" % str(e)) - sys.exit(1) - -@@ -225,8 +228,8 @@ class AuditToPolicy: - - try: - mc.create_module_package(filename, self.__options.refpolicy) -- except RuntimeError, e: -- print e -+ except RuntimeError as e: -+ print(e) - sys.exit(1) - - sys.stdout.write(_("******************** IMPORTANT ***********************\n")) -@@ -240,44 +243,44 @@ class AuditToPolicy: - rc = i.type - data = i.data - if rc >= 0: -- print "%s\n\tWas caused by:" % i.message -+ print("%s\n\tWas caused by:" % i.message) - if rc == audit2why.ALLOW: -- print "\t\tUnknown - would be allowed by active policy\n", -- print "\t\tPossible mismatch between this policy and the one under which the audit message was generated.\n" -- print "\t\tPossible mismatch between current in-memory boolean settings vs. permanent ones.\n" -+ print("\t\tUnknown - would be allowed by active policy") -+ print("\t\tPossible mismatch between this policy and the one under which the audit message was generated.\n") -+ print("\t\tPossible mismatch between current in-memory boolean settings vs. permanent ones.\n") - continue - if rc == audit2why.DONTAUDIT: -- print "\t\tUnknown - should be dontaudit'd by active policy\n", -- print "\t\tPossible mismatch between this policy and the one under which the audit message was generated.\n" -- print "\t\tPossible mismatch between current in-memory boolean settings vs. permanent ones.\n" -+ print("\t\tUnknown - should be dontaudit'd by active policy") -+ print("\t\tPossible mismatch between this policy and the one under which the audit message was generated.\n") -+ print("\t\tPossible mismatch between current in-memory boolean settings vs. permanent ones.\n") - continue - if rc == audit2why.BOOLEAN: - if len(data) > 1: -- print "\tOne of the following booleans was set incorrectly." -+ print("\tOne of the following booleans was set incorrectly.") - for b in data: -- print "\tDescription:\n\t%s\n" % seobject.boolean_desc(b[0]) -- print "\tAllow access by executing:\n\t# setsebool -P %s %d" % (b[0], b[1]) -+ print("\tDescription:\n\t%s\n" % seobject.boolean_desc(b[0])) -+ print("\tAllow access by executing:\n\t# setsebool -P %s %d" % (b[0], b[1])) - else: -- print "\tThe boolean %s was set incorrectly. " % (data[0][0]) -- print "\tDescription:\n\t%s\n" % seobject.boolean_desc(data[0][0]) -- print "\tAllow access by executing:\n\t# setsebool -P %s %d" % (data[0][0], data[0][1]) -+ print("\tThe boolean %s was set incorrectly. " % (data[0][0])) -+ print("\tDescription:\n\t%s\n" % seobject.boolean_desc(data[0][0])) -+ print("\tAllow access by executing:\n\t# setsebool -P %s %d" % (data[0][0], data[0][1])) - continue - - if rc == audit2why.TERULE: -- print "\t\tMissing type enforcement (TE) allow rule.\n" -- print "\t\tYou can use audit2allow to generate a loadable module to allow this access.\n" -+ print("\t\tMissing type enforcement (TE) allow rule.\n") -+ print("\t\tYou can use audit2allow to generate a loadable module to allow this access.\n") - continue - - if rc == audit2why.CONSTRAINT: -- print #!!!! This avc is a constraint violation. You would need to modify the attributes of either the source or target types to allow this access.\n" -- print "#Constraint rule:" -- print "\n\t" + data[0] -+ print() #!!!! This avc is a constraint violation. You would need to modify the attributes of either the source or target types to allow this access.\n" -+ print("#Constraint rule:") -+ print("\n#\t" + data[0]) - for reason in data[1:]: -- print "#\tPossible cause is the source %s and target %s are different.\n" % reason -+ print("#\tPossible cause is the source %s and target %s are different.\n" % reason) - - if rc == audit2why.RBAC: -- print "\t\tMissing role allow rule.\n" -- print "\t\tAdd an allow rule for the role pair.\n" -+ print("\t\tMissing role allow rule.\n") -+ print("\t\tAdd an allow rule for the role pair.\n") - continue - - audit2why.finish() -@@ -288,8 +291,8 @@ class AuditToPolicy: - if self.__options.audit2why: - try: - return self.__output_audit2why() -- except RuntimeError, e: -- print e -+ except RuntimeError as e: -+ print(e) - sys.exit(1) - - g = policygen.PolicyGenerator() -@@ -348,11 +351,11 @@ class AuditToPolicy: - self.__output() - except KeyboardInterrupt: - sys.exit(0) -- except ValueError, e: -- print e -+ except ValueError as e: -+ print(e) - sys.exit(1) -- except IOError, e: -- print e -+ except IOError as e: -+ print(e) - sys.exit(1) - - if __name__ == "__main__": -diff --git a/policycoreutils-2.4/audit2allow/audit2why b/policycoreutils-2.4/audit2allow/audit2why -index 323eddd..0fa4c26 100644 ---- a/policycoreutils-2.4/audit2allow/audit2why -+++ b/policycoreutils-2.4/audit2allow/audit2why -@@ -1,4 +1,4 @@ --#! /usr/bin/python -Es -+#! /usr/bin/python3 -Es - # Authors: Karl MacMillan - # Authors: Dan Walsh - # -@@ -31,7 +31,10 @@ import sepolgen.module as module - from sepolgen.sepolgeni18n import _ - import selinux.audit2why as audit2why - import locale --locale.setlocale(locale.LC_ALL, '') -+try: -+ locale.setlocale(locale.LC_ALL, '') -+except: -+ pass - - class AuditToPolicy: - VERSION = "%prog .1" -@@ -135,13 +138,13 @@ class AuditToPolicy: - elif self.__options.audit: - try: - messages = audit.get_audit_msgs() -- except OSError, e: -+ except OSError as e: - sys.stderr.write('could not run ausearch - "%s"\n' % str(e)) - sys.exit(1) - elif self.__options.boot: - try: - messages = audit.get_audit_boot_msgs() -- except OSError, e: -+ except OSError as e: - sys.stderr.write('could not run ausearch - "%s"\n' % str(e)) - sys.exit(1) - else: -@@ -152,7 +155,7 @@ class AuditToPolicy: - if filename is not None: - try: - f = open(filename) -- except IOError, e: -+ except IOError as e: - sys.stderr.write('could not open file %s - "%s"\n' % (filename, str(e))) - sys.exit(1) - -@@ -214,7 +217,7 @@ class AuditToPolicy: - - try: - fd = open(filename, "w") -- except IOError, e: -+ except IOError as e: - sys.stderr.write("could not write output file: %s\n" % str(e)) - sys.exit(1) - -@@ -225,8 +228,8 @@ class AuditToPolicy: - - try: - mc.create_module_package(filename, self.__options.refpolicy) -- except RuntimeError, e: -- print e -+ except RuntimeError as e: -+ print(e) - sys.exit(1) - - sys.stdout.write(_("******************** IMPORTANT ***********************\n")) -@@ -240,43 +243,43 @@ class AuditToPolicy: - rc = i.type - data = i.data - if rc >= 0: -- print "%s\n\tWas caused by:" % i.message -+ print("%s\n\tWas caused by:" % i.message) - if rc == audit2why.ALLOW: -- print "\t\tUnknown - would be allowed by active policy\n", -- print "\t\tPossible mismatch between this policy and the one under which the audit message was generated.\n" -- print "\t\tPossible mismatch between current in-memory boolean settings vs. permanent ones.\n" -+ print("\t\tUnknown - would be allowed by active policy") -+ print("\t\tPossible mismatch between this policy and the one under which the audit message was generated.\n") -+ print("\t\tPossible mismatch between current in-memory boolean settings vs. permanent ones.\n") - continue - if rc == audit2why.DONTAUDIT: -- print "\t\tUnknown - should be dontaudit'd by active policy\n", -- print "\t\tPossible mismatch between this policy and the one under which the audit message was generated.\n" -- print "\t\tPossible mismatch between current in-memory boolean settings vs. permanent ones.\n" -+ print("\t\tUnknown - should be dontaudit'd by active policy") -+ print("\t\tPossible mismatch between this policy and the one under which the audit message was generated.\n") -+ print("\t\tPossible mismatch between current in-memory boolean settings vs. permanent ones.\n") - continue - if rc == audit2why.BOOLEAN: - if len(data) > 1: -- print "\tOne of the following booleans was set incorrectly." -+ print("\tOne of the following booleans was set incorrectly.") - for b in data: -- print "\tDescription:\n\t%s\n" % seobject.boolean_desc(b[0]) -- print "\tAllow access by executing:\n\t# setsebool -P %s %d" % (b[0], b[1]) -+ print("\tDescription:\n\t%s\n" % seobject.boolean_desc(b[0])) -+ print("\tAllow access by executing:\n\t# setsebool -P %s %d" % (b[0], b[1])) - else: -- print "\tThe boolean %s was set incorrectly. " % (data[0][0]) -- print "\tDescription:\n\t%s\n" % seobject.boolean_desc(data[0][0]) -- print "\tAllow access by executing:\n\t# setsebool -P %s %d" % (data[0][0], data[0][1]) -+ print("\tThe boolean %s was set incorrectly. " % (data[0][0])) -+ print("\tDescription:\n\t%s\n" % seobject.boolean_desc(data[0][0])) -+ print("\tAllow access by executing:\n\t# setsebool -P %s %d" % (data[0][0], data[0][1])) - continue - - if rc == audit2why.TERULE: -- print "\t\tMissing type enforcement (TE) allow rule.\n" -- print "\t\tYou can use audit2allow to generate a loadable module to allow this access.\n" -+ print("\t\tMissing type enforcement (TE) allow rule.\n") -+ print("\t\tYou can use audit2allow to generate a loadable module to allow this access.\n") - continue - - if rc == audit2why.CONSTRAINT: -- print #!!!! This avc is a constraint violation. You would need to modify the attributes of either the source or target types to allow this access.\n" -- print "#Constraint rule: \n\t" + data[0] -+ print() #!!!! This avc is a constraint violation. You would need to modify the attributes of either the source or target types to allow this access.\n" -+ print("#Constraint rule: \n\t" + data[0]) - for reason in data[1:]: -- print "#\tPossible cause is the source %s and target %s are different.\n\b" % reason -+ print("#\tPossible cause is the source %s and target %s are different.\n\b" % reason) - - if rc == audit2why.RBAC: -- print "\t\tMissing role allow rule.\n" -- print "\t\tAdd an allow rule for the role pair.\n" -+ print("\t\tMissing role allow rule.\n") -+ print("\t\tAdd an allow rule for the role pair.\n") - continue - - audit2why.finish() -@@ -287,8 +290,8 @@ class AuditToPolicy: - if self.__options.audit2why: - try: - return self.__output_audit2why() -- except RuntimeError, e: -- print e -+ except RuntimeError as e: -+ print(e) - sys.exit(1) - - g = policygen.PolicyGenerator() -@@ -347,11 +350,11 @@ class AuditToPolicy: - self.__output() - except KeyboardInterrupt: - sys.exit(0) -- except ValueError, e: -- print e -+ except ValueError as e: -+ print(e) - sys.exit(1) -- except IOError, e: -- print e -+ except IOError as e: -+ print(e) - sys.exit(1) - - if __name__ == "__main__": -diff --git a/policycoreutils-2.4/audit2allow/sepolgen-ifgen b/policycoreutils-2.4/audit2allow/sepolgen-ifgen -index 83c7ecf..0504608 100644 ---- a/policycoreutils-2.4/audit2allow/sepolgen-ifgen -+++ b/policycoreutils-2.4/audit2allow/sepolgen-ifgen -@@ -1,4 +1,4 @@ --#! /usr/bin/python -Es -+#! /usr/bin/python3 -Es - # - # Authors: Karl MacMillan - # -@@ -82,7 +82,7 @@ def get_attrs(policy_path): - sys.stderr.write("No installed policy to check\n") - return None - outfile = tempfile.NamedTemporaryFile() -- except IOError, e: -+ except IOError as e: - sys.stderr.write("could not open attribute output file\n") - return None - except OSError: -@@ -100,7 +100,7 @@ def get_attrs(policy_path): - try: - attrs.from_file(outfile) - except: -- print "error parsing attribute info" -+ print("error parsing attribute info") - return None - - return attrs -@@ -111,7 +111,7 @@ def main(): - # Open the output first to generate errors before parsing - try: - f = open(options.output, "w") -- except IOError, e: -+ except IOError as e: - sys.stderr.write("could not open output file [%s]\n" % options.output) - return 1 - -@@ -130,9 +130,9 @@ def main(): - # Parse the headers - try: - headers = refparser.parse_headers(options.headers, output=log, debug=options.debug) -- except ValueError, e: -- print "error parsing headers" -- print str(e) -+ except ValueError as e: -+ print("error parsing headers") -+ print(str(e)) - return 1 - - if_set = interfaces.InterfaceSet(output=log) -diff --git a/policycoreutils-2.4/audit2allow/test_audit2allow.py b/policycoreutils-2.4/audit2allow/test_audit2allow.py -index 794673e..d6bd60b 100644 ---- a/policycoreutils-2.4/audit2allow/test_audit2allow.py -+++ b/policycoreutils-2.4/audit2allow/test_audit2allow.py -@@ -4,18 +4,18 @@ from subprocess import Popen, PIPE - - class Audit2allowTests(unittest.TestCase): - def assertDenied(self, err): -- self.assert_('Permission denied' in err, -+ self.assertTrue('Permission denied' in err, - '"Permission denied" not found in %r' % err) - def assertNotFound(self, err): -- self.assert_('not found' in err, -+ self.assertTrue('not found' in err, - '"not found" not found in %r' % err) - - def assertFailure(self, status): -- self.assert_(status != 0, -+ self.assertTrue(status != 0, - '"Succeeded when it should have failed') - - def assertSuccess(self, cmd, status, err): -- self.assert_(status == 0, -+ self.assertTrue(status == 0, - '"%s should have succeeded for this test %r' % (cmd, err)) - - def test_sepolgen_ifgen(self): -diff --git a/policycoreutils-2.4/gui/Makefile b/policycoreutils-2.4/gui/Makefile +diff --git a/policycoreutils-2.5-rc1/gui/Makefile b/policycoreutils-2.5-rc1/gui/Makefile index 9d9f820..0c2b390 100644 ---- a/policycoreutils-2.4/gui/Makefile -+++ b/policycoreutils-2.4/gui/Makefile +--- a/policycoreutils-2.5-rc1/gui/Makefile ++++ b/policycoreutils-2.5-rc1/gui/Makefile @@ -12,7 +12,6 @@ domainsPage.py \ fcontextPage.py \ html_util.py \ @@ -415,11 +20,11 @@ index 9d9f820..0c2b390 100644 modulesPage.py \ polgen.glade \ portsPage.py \ -diff --git a/policycoreutils-2.4/gui/booleansPage.py b/policycoreutils-2.4/gui/booleansPage.py -index eee954d..0c4b14b 100644 ---- a/policycoreutils-2.4/gui/booleansPage.py -+++ b/policycoreutils-2.4/gui/booleansPage.py -@@ -18,20 +18,17 @@ +diff --git a/policycoreutils-2.5-rc1/gui/booleansPage.py b/policycoreutils-2.5-rc1/gui/booleansPage.py +index 507a79d..7fbd50c 100644 +--- a/policycoreutils-2.5-rc1/gui/booleansPage.py ++++ b/policycoreutils-2.5-rc1/gui/booleansPage.py +@@ -18,23 +18,20 @@ # You should have received a copy of the GNU General Public License # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # @@ -433,17 +38,23 @@ index eee954d..0c4b14b 100644 import seobject import semanagePage - INSTALLPATH='/usr/share/system-config-selinux' + INSTALLPATH = '/usr/share/system-config-selinux' sys.path.append(INSTALLPATH) -import commands +-ENFORCING = 0 +-PERMISSIVE = 1 +-DISABLED = 2 +import subprocess - ENFORCING=0 - PERMISSIVE=1 - DISABLED=2 ++ENFORCING=0 ++PERMISSIVE=1 ++DISABLED=2 + + ## + ## I18N @@ -50,10 +47,8 @@ try: unicode=False, - codeset = 'utf-8') + codeset='utf-8') except IOError: - import __builtin__ - __builtin__.__dict__['_'] = unicode @@ -452,9 +63,9 @@ index eee954d..0c4b14b 100644 + import builtins + builtins.__dict__['_'] = str + class Modifier: - def __init__(self,name, on, save): -@@ -103,8 +98,6 @@ class booleansPage: +@@ -109,8 +104,6 @@ class booleansPage: self.revertButton = xml.get_widget("booleanRevertButton") self.revertButton.set_sensitive(self.local) self.revertButton.connect("clicked", self.on_revert_clicked) @@ -463,16 +74,7 @@ index eee954d..0c4b14b 100644 self.store = gtk.ListStore(gobject.TYPE_BOOLEAN, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING) self.store.set_sort_column_id(1, gtk.SORT_ASCENDING) -@@ -123,7 +116,7 @@ class booleansPage: - self.booleansView.append_column(col) - - col = gtk.TreeViewColumn("Description", gtk.CellRendererText(), text=DESC) -- col.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED) -+ col.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED) - col.set_fixed_width(400) - col.set_sort_column_id(DESC) - col.set_resizable(True) -@@ -170,16 +163,15 @@ class booleansPage: +@@ -176,16 +169,15 @@ class booleansPage: # change cursor if boolean == None: return @@ -495,15 +97,17 @@ index eee954d..0c4b14b 100644 + self.ready() def filter_changed(self, *arg): - filter = arg[0].get_text() -@@ -224,17 +216,25 @@ class booleansPage: - self.store.set_value(iter, ACTIVE , not val) + filter = arg[0].get_text() +@@ -228,18 +220,26 @@ class booleansPage: + key = self.store.get_value(iter, BOOLEAN) + self.store.set_value(iter, ACTIVE, not val) self.wait() - setsebool="/usr/sbin/setsebool -P %s %d" % (key, not val) -- rc,out = commands.getstatusoutput(setsebool) +- setsebool = "/usr/sbin/setsebool -P %s %d" % (key, not val) +- rc, out = commands.getstatusoutput(setsebool) - if rc != 0: - self.error(out) - self.load(self.filter) ++ setsebool="/usr/sbin/setsebool -P %s %d" % (key, not val) + try: + subprocess.check_output(setsebool, + stderr=subprocess.STDOUT, @@ -515,9 +119,10 @@ index eee954d..0c4b14b 100644 def on_revert_clicked(self, button): self.wait() - setsebool="semanage boolean --deleteall" +- setsebool = "semanage boolean --deleteall" - commands.getstatusoutput(setsebool) - self.load(self.filter) ++ setsebool="semanage boolean --deleteall" + try: + subprocess.check_output(setsebool, + stderr=subprocess.STDOUT, @@ -528,10 +133,10 @@ index eee954d..0c4b14b 100644 self.ready() def on_local_clicked(self, button): -diff --git a/policycoreutils-2.4/gui/domainsPage.py b/policycoreutils-2.4/gui/domainsPage.py -index 6af1e9a..39a4574 100644 ---- a/policycoreutils-2.4/gui/domainsPage.py -+++ b/policycoreutils-2.4/gui/domainsPage.py +diff --git a/policycoreutils-2.5-rc1/gui/domainsPage.py b/policycoreutils-2.5-rc1/gui/domainsPage.py +index 56c66fe..f4a281f 100644 +--- a/policycoreutils-2.5-rc1/gui/domainsPage.py ++++ b/policycoreutils-2.5-rc1/gui/domainsPage.py @@ -20,7 +20,7 @@ import string import gtk import gtk.glade @@ -543,16 +148,16 @@ index 6af1e9a..39a4574 100644 import seobject @@ -41,8 +41,8 @@ try: unicode=False, - codeset = 'utf-8') + codeset='utf-8') except IOError: - import __builtin__ - __builtin__.__dict__['_'] = unicode + import builtins + builtins.__dict__['_'] = str + class domainsPage(semanagePage): - def __init__(self, xml): -@@ -115,18 +115,17 @@ class domainsPage(semanagePage): +@@ -117,18 +117,17 @@ class domainsPage(semanagePage): selection = self.view.get_selection() store, iter = selection.get_selected() domain = store.get_value(iter, 0) @@ -581,7 +186,7 @@ index 6af1e9a..39a4574 100644 def propertiesDialog(self): # Do nothing -@@ -140,15 +139,14 @@ class domainsPage(semanagePage): +@@ -142,15 +141,14 @@ class domainsPage(semanagePage): selection = self.view.get_selection() store, iter = selection.get_selected() domain = store.get_value(iter, 0) @@ -607,10 +212,10 @@ index 6af1e9a..39a4574 100644 + except subprocess.CalledProcessError as e: + self.error(e.output) + self.ready() -diff --git a/policycoreutils-2.4/gui/fcontextPage.py b/policycoreutils-2.4/gui/fcontextPage.py -index 131f1c2..9a34143 100644 ---- a/policycoreutils-2.4/gui/fcontextPage.py -+++ b/policycoreutils-2.4/gui/fcontextPage.py +diff --git a/policycoreutils-2.5-rc1/gui/fcontextPage.py b/policycoreutils-2.5-rc1/gui/fcontextPage.py +index c8d6ba8..154e8e2 100644 +--- a/policycoreutils-2.5-rc1/gui/fcontextPage.py ++++ b/policycoreutils-2.5-rc1/gui/fcontextPage.py @@ -18,10 +18,9 @@ ## Author: Dan Walsh import gtk @@ -620,12 +225,12 @@ index 131f1c2..9a34143 100644 import seobject -import commands +import subprocess - from semanagePage import *; + from semanagePage import * SPEC_COL = 0 -@@ -55,8 +54,8 @@ try: +@@ -57,8 +56,8 @@ try: unicode=False, - codeset = 'utf-8') + codeset='utf-8') except IOError: - import __builtin__ - __builtin__.__dict__['_'] = unicode @@ -634,35 +239,16 @@ index 131f1c2..9a34143 100644 class fcontextPage(semanagePage): -@@ -72,16 +71,16 @@ class fcontextPage(semanagePage): - self.view.set_search_equal_func(self.search) - - col = gtk.TreeViewColumn(_("File\nSpecification"), gtk.CellRendererText(), text=SPEC_COL) -- col.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED) -- col.set_fixed_width(250) -+ col.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED) -+ col.set_fixed_width(250) - - col.set_sort_column_id(SPEC_COL) - col.set_resizable(True) - self.view.append_column(col) - col = gtk.TreeViewColumn(_("Selinux\nFile Type"), gtk.CellRendererText(), text=TYPE_COL) - -- col.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED) -- col.set_fixed_width(250) -+ col.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED) -+ col.set_fixed_width(250) - col.set_sort_column_id(TYPE_COL) - col.set_resizable(True) - self.view.append_column(col) -@@ -97,16 +96,16 @@ class fcontextPage(semanagePage): - liststore=self.fcontextFileTypeCombo.get_model() +@@ -99,17 +98,17 @@ class fcontextPage(semanagePage): + self.fcontextFileTypeCombo = xml.get_widget("fcontextFileTypeCombo") + liststore = self.fcontextFileTypeCombo.get_model() for k in seobject.file_types: - if len(k) > 0 and k[0] != '-': -- iter=liststore.append() +- if len(k) > 0 and k[0] != '-': +- iter = liststore.append() - liststore.set_value(iter, 0, k) - iter = liststore.get_iter_first() - self.fcontextFileTypeCombo.set_active_iter(iter) ++ if len(k) > 0 and k[0] != '-': + it=liststore.append() + liststore.set_value(it, 0, k) + it = liststore.get_iter_first() @@ -673,45 +259,49 @@ index 131f1c2..9a34143 100644 - def match(self, fcon_dict, k, filter): + def match(self, fcon_dict, k, filt): try: -- f=filter.lower() +- f = filter.lower() + f=filt.lower() for con in k: - k=con.lower() + k = con.lower() if k.find(f) >= 0: -@@ -119,46 +118,46 @@ class fcontextPage(semanagePage): +@@ -122,46 +121,46 @@ class fcontextPage(semanagePage): pass return False - def load(self, filter=""): -- self.filter=filter +- self.filter = filter +- self.fcontext = seobject.fcontextRecords() + def load(self, filt=""): + self.filter=filt - self.fcontext=seobject.fcontextRecords() ++ self.fcontext=seobject.fcontextRecords() self.store.clear() - fcon_dict=self.fcontext.get_all(self.local) +- fcon_dict = self.fcontext.get_all(self.local) - keys = fcon_dict.keys() ++ fcon_dict=self.fcontext.get_all(self.local) + keys = list(fcon_dict.keys()) keys.sort() for k in keys: - if not self.match(fcon_dict, k, filter): + if not self.match(fcon_dict, k, filt): continue -- iter=self.store.append() +- iter = self.store.append() - self.store.set_value(iter, SPEC_COL, k[0]) - self.store.set_value(iter, FTYPE_COL, k[1]) + it=self.store.append() + self.store.set_value(it, SPEC_COL, k[0]) + self.store.set_value(it, FTYPE_COL, k[1]) if fcon_dict[k]: - rec="%s:%s" % (fcon_dict[k][2], seobject.translate(fcon_dict[k][3],False)) + rec = "%s:%s" % (fcon_dict[k][2], seobject.translate(fcon_dict[k][3], False)) else: - rec="<>" +- rec = "<>" - self.store.set_value(iter, TYPE_COL, rec) +- self.view.get_selection().select_path((0,)) ++ rec="<>" + self.store.set_value(it, TYPE_COL, rec) - self.view.get_selection().select_path ((0,)) ++ self.view.get_selection().select_path ((0,)) def filter_changed(self, *arg): -- filter = arg[0].get_text() +- filter = arg[0].get_text() - if filter != self.filter: - self.load(filter) + filt = arg[0].get_text() @@ -725,18 +315,20 @@ index 131f1c2..9a34143 100644 + self.fcontextEntry.set_text(store.get_value(it, SPEC_COL)) self.fcontextEntry.set_sensitive(False) - scontext = store.get_value(iter, TYPE_COL) +- scon = context(scontext) + scontext = store.get_value(it, TYPE_COL) - scon=context(scontext) ++ scon=context(scontext) self.fcontextTypeEntry.set_text(scon.type) self.fcontextMLSEntry.set_text(scon.mls) -- type=store.get_value(iter, FTYPE_COL) -+ setype=store.get_value(it, FTYPE_COL) - liststore=self.fcontextFileTypeCombo.get_model() +- type = store.get_value(iter, FTYPE_COL) +- liststore = self.fcontextFileTypeCombo.get_model() - iter = liststore.get_iter_first() -- while iter != None and liststore.get_value(iter,0) != type: +- while iter != None and liststore.get_value(iter, 0) != type: - iter = liststore.iter_next(iter) - if iter != None: - self.fcontextFileTypeCombo.set_active_iter(iter) ++ setype=store.get_value(it, FTYPE_COL) ++ liststore=self.fcontextFileTypeCombo.get_model() + it = liststore.get_iter_first() + while it != None and liststore.get_value(it,0) != setype: + it = liststore.iter_next(it) @@ -745,7 +337,7 @@ index 131f1c2..9a34143 100644 self.fcontextFileTypeCombo.set_sensitive(False) def dialogClear(self): -@@ -169,55 +168,60 @@ class fcontextPage(semanagePage): +@@ -172,55 +171,60 @@ class fcontextPage(semanagePage): self.fcontextMLSEntry.set_text("s0") def delete(self): @@ -755,8 +347,8 @@ index 131f1c2..9a34143 100644 + ftype=store.get_value(it, FTYPE_COL) + self.wait() try: -- fspec=store.get_value(iter, SPEC_COL) -- ftype=store.get_value(iter, FTYPE_COL) +- fspec = store.get_value(iter, SPEC_COL) +- ftype = store.get_value(iter, FTYPE_COL) - self.wait() - (rc, out) = commands.getstatusoutput("semanage fcontext -d -f '%s' '%s'" % (ftype, fspec)) - self.ready() @@ -764,24 +356,29 @@ index 131f1c2..9a34143 100644 - if rc != 0: - return self.error(out) - store.remove(iter) +- self.view.get_selection().select_path((0,)) +- except ValueError, e: +- self.error(e.args[0]) + subprocess.check_output("semanage fcontext -d -f '%s' '%s'" % (ftype, fspec), + stderr=subprocess.STDOUT, + shell=True) + store.remove(it) - self.view.get_selection().select_path ((0,)) -- except ValueError, e: -- self.error(e.args[0]) ++ self.view.get_selection().select_path ((0,)) + except subprocess.CalledProcessError as e: + self.error(e.output) + self.ready() def add(self): - ftype=["", "--", "-d", "-c", "-b", "-s", "-l", "-p" ] - fspec=self.fcontextEntry.get_text().strip() -- type=self.fcontextTypeEntry.get_text().strip() +- ftype = ["", "--", "-d", "-c", "-b", "-s", "-l", "-p"] +- fspec = self.fcontextEntry.get_text().strip() +- type = self.fcontextTypeEntry.get_text().strip() +- mls = self.fcontextMLSEntry.get_text().strip() +- list_model = self.fcontextFileTypeCombo.get_model() ++ ftype=["", "--", "-d", "-c", "-b", "-s", "-l", "-p" ] ++ fspec=self.fcontextEntry.get_text().strip() + setype=self.fcontextTypeEntry.get_text().strip() - mls=self.fcontextMLSEntry.get_text().strip() - list_model=self.fcontextFileTypeCombo.get_model() ++ mls=self.fcontextMLSEntry.get_text().strip() ++ list_model=self.fcontextFileTypeCombo.get_model() active = self.fcontextFileTypeCombo.get_active() self.wait() - (rc, out) = commands.getstatusoutput("semanage fcontext -a -t %s -r %s -f '%s' '%s'" % (type, mls, ftype[active], fspec)) @@ -802,19 +399,22 @@ index 131f1c2..9a34143 100644 + self.ready() return False -- iter=self.store.append() +- iter = self.store.append() - self.store.set_value(iter, SPEC_COL, fspec) - self.store.set_value(iter, FTYPE_COL, ftype) - self.store.set_value(iter, TYPE_COL, "%s:%s" % (type, mls)) - def modify(self): - fspec=self.fcontextEntry.get_text().strip() -- type=self.fcontextTypeEntry.get_text().strip() -+ setype=self.fcontextTypeEntry.get_text().strip() - mls=self.fcontextMLSEntry.get_text().strip() - list_model=self.fcontextFileTypeCombo.get_model() +- fspec = self.fcontextEntry.get_text().strip() +- type = self.fcontextTypeEntry.get_text().strip() +- mls = self.fcontextMLSEntry.get_text().strip() +- list_model = self.fcontextFileTypeCombo.get_model() - iter = self.fcontextFileTypeCombo.get_active_iter() -- ftype=list_model.get_value(iter,0) +- ftype = list_model.get_value(iter, 0) ++ fspec=self.fcontextEntry.get_text().strip() ++ setype=self.fcontextTypeEntry.get_text().strip() ++ mls=self.fcontextMLSEntry.get_text().strip() ++ list_model=self.fcontextFileTypeCombo.get_model() + it = self.fcontextFileTypeCombo.get_active_iter() + ftype=list_model.get_value(it,0) self.wait() @@ -840,10 +440,10 @@ index 131f1c2..9a34143 100644 - self.store.set_value(iter, SPEC_COL, fspec) - self.store.set_value(iter, FTYPE_COL, ftype) - self.store.set_value(iter, TYPE_COL, "%s:%s" % (type, mls)) -diff --git a/policycoreutils-2.4/gui/html_util.py b/policycoreutils-2.4/gui/html_util.py -index 68eed76..32de37a 100644 ---- a/policycoreutils-2.4/gui/html_util.py -+++ b/policycoreutils-2.4/gui/html_util.py +diff --git a/policycoreutils-2.5-rc1/gui/html_util.py b/policycoreutils-2.5-rc1/gui/html_util.py +index 5a596bc..ad6c534 100644 +--- a/policycoreutils-2.5-rc1/gui/html_util.py ++++ b/policycoreutils-2.5-rc1/gui/html_util.py @@ -30,7 +30,8 @@ import htmllib import formatter as Formatter import string @@ -854,7 +454,7 @@ index 68eed76..32de37a 100644 #------------------------------------------------------------------------------ -@@ -119,7 +120,7 @@ def unescape_html(s): +@@ -127,7 +128,7 @@ def unescape_html(s): def html_to_text(html, maxcol=80): try: @@ -863,7 +463,7 @@ index 68eed76..32de37a 100644 formatter = Formatter.AbstractFormatter(TextWriter(buffer, maxcol)) parser = HTMLParserAnchor(formatter) parser.feed(html) -@@ -127,7 +128,7 @@ def html_to_text(html, maxcol=80): +@@ -135,7 +136,7 @@ def html_to_text(html, maxcol=80): text = buffer.getvalue() buffer.close() return text @@ -872,7 +472,7 @@ index 68eed76..32de37a 100644 log_program.error('cannot convert html to text: %s' % e) return None -@@ -149,7 +150,7 @@ def html_document(*body_components): +@@ -158,7 +159,7 @@ def html_document(*body_components): elif type(body_component) in [TupleType, ListType]: for item in body_component: doc += item @@ -881,10 +481,10 @@ index 68eed76..32de37a 100644 result = body_component() if type(result) in [TupleType, ListType]: for item in result: -diff --git a/policycoreutils-2.4/gui/loginsPage.py b/policycoreutils-2.4/gui/loginsPage.py -index ec29fd9..8a1c0b7 100644 ---- a/policycoreutils-2.4/gui/loginsPage.py -+++ b/policycoreutils-2.4/gui/loginsPage.py +diff --git a/policycoreutils-2.5-rc1/gui/loginsPage.py b/policycoreutils-2.5-rc1/gui/loginsPage.py +index 982e252..fbc26e0 100644 +--- a/policycoreutils-2.5-rc1/gui/loginsPage.py ++++ b/policycoreutils-2.5-rc1/gui/loginsPage.py @@ -16,13 +16,10 @@ ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -898,21 +498,21 @@ index ec29fd9..8a1c0b7 100644 -import commands +import subprocess import seobject - from semanagePage import *; + from semanagePage import * @@ -39,8 +36,8 @@ try: unicode=False, - codeset = 'utf-8') + codeset='utf-8') except IOError: - import __builtin__ - __builtin__.__dict__['_'] = unicode + import builtins + builtins.__dict__['_'] = str + class loginsPage(semanagePage): - def __init__(self, xml): -@@ -68,21 +65,21 @@ class loginsPage(semanagePage): - self.filter=filter +@@ -70,21 +67,21 @@ class loginsPage(semanagePage): + self.filter = filter self.login = seobject.loginRecords() dict = self.login.get_all(0) - keys = dict.keys() @@ -927,11 +527,12 @@ index ec29fd9..8a1c0b7 100644 - self.store.set_value(iter, 0, k) - self.store.set_value(iter, 1, dict[k][0]) - self.store.set_value(iter, 2, range) +- self.view.get_selection().select_path((0,)) + it = self.store.append() + self.store.set_value(it, 0, k) + self.store.set_value(it, 1, dict[k][0]) + self.store.set_value(it, 2, range) - self.view.get_selection().select_path ((0,)) ++ self.view.get_selection().select_path ((0,)) def __dialogSetup(self): - if self.firstTime == True: @@ -939,7 +540,7 @@ index ec29fd9..8a1c0b7 100644 return self.firstTime = True liststore = gtk.ListStore(gobject.TYPE_STRING) -@@ -92,31 +89,31 @@ class loginsPage(semanagePage): +@@ -94,31 +91,31 @@ class loginsPage(semanagePage): self.loginsSelinuxUserCombo.add_attribute(cell, 'text', 0) selusers = seobject.seluserRecords().get_all(0) @@ -951,7 +552,7 @@ index ec29fd9..8a1c0b7 100644 self.loginsSelinuxUserCombo.append_text(k) - iter = liststore.get_iter_first() -- while liststore.get_value(iter,0) != "user_u": +- while liststore.get_value(iter, 0) != "user_u": - iter = liststore.iter_next(iter) - self.loginsSelinuxUserCombo.set_active_iter(iter) + it = liststore.get_iter_first() @@ -973,7 +574,7 @@ index ec29fd9..8a1c0b7 100644 + seuser = store.get_value(it, 1) liststore = self.loginsSelinuxUserCombo.get_model() - iter = liststore.get_iter_first() -- while iter != None and liststore.get_value(iter,0) != seuser: +- while iter != None and liststore.get_value(iter, 0) != seuser: - iter = liststore.iter_next(iter) - if iter != None: - self.loginsSelinuxUserCombo.set_active_iter(iter) @@ -983,16 +584,16 @@ index ec29fd9..8a1c0b7 100644 + if it != None: + self.loginsSelinuxUserCombo.set_active_iter(it) - def dialogClear(self): -@@ -126,21 +123,25 @@ class loginsPage(semanagePage): + self.__dialogSetup() +@@ -127,59 +124,69 @@ class loginsPage(semanagePage): self.loginsMLSEntry.set_text("s0") def delete(self): - store, iter = self.view.get_selection().get_selected() + store, it = self.view.get_selection().get_selected() try: -- login=store.get_value(iter, 0) +- login = store.get_value(iter, 0) + login=store.get_value(it, 0) if login == "root" or login == "__default__": raise ValueError(_("Login '%s' is required") % login) @@ -1014,18 +615,21 @@ index ec29fd9..8a1c0b7 100644 + self.error(e.output) return False - store.remove(iter) -- self.view.get_selection().select_path ((0,)) +- self.view.get_selection().select_path((0,)) - except ValueError, e: + except ValueError as e: self.error(e.args[0]) def add(self): -@@ -149,36 +150,42 @@ class loginsPage(semanagePage): + target = self.loginsNameEntry.get_text().strip() + serange = self.loginsMLSEntry.get_text().strip() if serange == "": - serange="s0" - list_model=self.loginsSelinuxUserCombo.get_model() +- serange = "s0" +- list_model = self.loginsSelinuxUserCombo.get_model() - iter = self.loginsSelinuxUserCombo.get_active_iter() -- seuser = list_model.get_value(iter,0) +- seuser = list_model.get_value(iter, 0) ++ serange="s0" ++ list_model=self.loginsSelinuxUserCombo.get_model() + it = self.loginsSelinuxUserCombo.get_active_iter() + seuser = list_model.get_value(it,0) self.wait() @@ -1053,13 +657,13 @@ index ec29fd9..8a1c0b7 100644 - self.store.set_value(iter, 2, seobject.translate(serange)) - def modify(self): - target=self.loginsNameEntry.get_text().strip() - serange=self.loginsMLSEntry.get_text().strip() + target = self.loginsNameEntry.get_text().strip() + serange = self.loginsMLSEntry.get_text().strip() if serange == "": serange = "s0" list_model = self.loginsSelinuxUserCombo.get_model() - iter = self.loginsSelinuxUserCombo.get_active_iter() -- seuser=list_model.get_value(iter,0) +- seuser = list_model.get_value(iter, 0) + it = self.loginsSelinuxUserCombo.get_active_iter() + seuser=list_model.get_value(it,0) self.wait() @@ -1085,10 +689,10 @@ index ec29fd9..8a1c0b7 100644 - self.store.set_value(iter, 0, target) - self.store.set_value(iter, 1, seuser) - self.store.set_value(iter, 2, seobject.translate(serange)) -diff --git a/policycoreutils-2.4/gui/modulesPage.py b/policycoreutils-2.4/gui/modulesPage.py -index 9ff0766..a52863e 100644 ---- a/policycoreutils-2.4/gui/modulesPage.py -+++ b/policycoreutils-2.4/gui/modulesPage.py +diff --git a/policycoreutils-2.5-rc1/gui/modulesPage.py b/policycoreutils-2.5-rc1/gui/modulesPage.py +index 3b83e45..3feb2ba 100644 +--- a/policycoreutils-2.5-rc1/gui/modulesPage.py ++++ b/policycoreutils-2.5-rc1/gui/modulesPage.py @@ -20,7 +20,7 @@ import string import gtk import gtk.glade @@ -1100,27 +704,27 @@ index 9ff0766..a52863e 100644 import seobject @@ -41,8 +41,8 @@ try: unicode=False, - codeset = 'utf-8') + codeset='utf-8') except IOError: - import __builtin__ - __builtin__.__dict__['_'] = unicode + import builtins + builtins.__dict__['_'] = str + class modulesPage(semanagePage): - def __init__(self, xml): -@@ -85,8 +85,8 @@ class modulesPage(semanagePage): +@@ -87,8 +87,8 @@ class modulesPage(semanagePage): except: return 0 - def load(self, filter=""): -- self.filter=filter +- self.filter = filter + def load(self, filt=""): + self.filter=filt self.store.clear() try: fd = Popen("semodule -l", shell=True, stdout=PIPE).stdout -@@ -94,11 +94,11 @@ class modulesPage(semanagePage): +@@ -96,11 +96,11 @@ class modulesPage(semanagePage): fd.close() for i in l: module, ver, newline = i.split('\t') @@ -1135,8 +739,8 @@ index 9ff0766..a52863e 100644 + self.store.set_value(it, 1, ver.strip()) except: pass - self.view.get_selection().select_path ((0,)) -@@ -107,53 +107,51 @@ class modulesPage(semanagePage): + self.view.get_selection().select_path((0,)) +@@ -108,53 +108,51 @@ class modulesPage(semanagePage): def new_module(self, args): try: Popen(["/usr/share/system-config-selinux/polgengui.py"]) @@ -1158,7 +762,7 @@ index 9ff0766..a52863e 100644 - self.error(output) - else: - store.remove(iter) -- self.view.get_selection().select_path ((0,)) +- self.view.get_selection().select_path((0,)) - - except ValueError, e: - self.error(e.args[0]) @@ -1183,10 +787,10 @@ index 9ff0766..a52863e 100644 try: - self.wait() - if self.audit_enabled: -- status, output =commands.getstatusoutput("semodule -DB") +- status, output = commands.getstatusoutput("semodule -DB") - button.set_label(_("Disable Audit")) - else: -- status, output =commands.getstatusoutput("semodule -B") +- status, output = commands.getstatusoutput("semodule -B") - button.set_label(_("Enable Audit")) - self.ready() - @@ -1208,7 +812,7 @@ index 9ff0766..a52863e 100644 + cmd = "semodule -B" try: - self.wait() -- status, output =commands.getstatusoutput("semodule -B") +- status, output = commands.getstatusoutput("semodule -B") - self.ready() - if status != 0: - self.error(output) @@ -1224,7 +828,7 @@ index 9ff0766..a52863e 100644 def propertiesDialog(self): # Do nothing -@@ -167,10 +165,10 @@ class modulesPage(semanagePage): +@@ -168,10 +166,10 @@ class modulesPage(semanagePage): gtk.STOCK_OPEN, gtk.RESPONSE_OK)) dialog.set_default_response(gtk.RESPONSE_OK) @@ -1239,7 +843,7 @@ index 9ff0766..a52863e 100644 response = dialog.run() if response == gtk.RESPONSE_OK: -@@ -178,14 +176,13 @@ class modulesPage(semanagePage): +@@ -179,14 +177,14 @@ class modulesPage(semanagePage): dialog.destroy() def add(self, file): @@ -1247,7 +851,7 @@ index 9ff0766..a52863e 100644 + cmd = "semodule -i %s" % file try: - self.wait() -- status, output =commands.getstatusoutput("semodule -i %s" % file) +- status, output = commands.getstatusoutput("semodule -i %s" % file) - self.ready() - if status != 0: - self.error(output) @@ -1263,10 +867,11 @@ index 9ff0766..a52863e 100644 + except subprocess.CalledProcessError as e: + self.error(e.output) + self.ready() -diff --git a/policycoreutils-2.4/gui/polgen.glade b/policycoreutils-2.4/gui/polgen.glade ++ +diff --git a/policycoreutils-2.5-rc1/gui/polgen.glade b/policycoreutils-2.5-rc1/gui/polgen.glade index 37c1472..9854fb2 100644 ---- a/policycoreutils-2.4/gui/polgen.glade -+++ b/policycoreutils-2.4/gui/polgen.glade +--- a/policycoreutils-2.5-rc1/gui/polgen.glade ++++ b/policycoreutils-2.5-rc1/gui/polgen.glade @@ -758,7 +758,7 @@ True False @@ -1357,15 +962,15 @@ index 37c1472..9854fb2 100644 False -diff --git a/policycoreutils-2.4/gui/polgengui.py b/policycoreutils-2.4/gui/polgengui.py -index 0f0e564..ac8f78f 100644 ---- a/policycoreutils-2.4/gui/polgengui.py -+++ b/policycoreutils-2.4/gui/polgengui.py -@@ -30,29 +30,15 @@ import gnome +diff --git a/policycoreutils-2.5-rc1/gui/polgengui.py b/policycoreutils-2.5-rc1/gui/polgengui.py +index 0a153c6..f6511db 100644 +--- a/policycoreutils-2.5-rc1/gui/polgengui.py ++++ b/policycoreutils-2.5-rc1/gui/polgengui.py +@@ -30,30 +30,15 @@ import gnome import sys try: from sepolicy import generate --except ValueError,e: +-except ValueError, e: +except ValueError as e: sys.stderr.write("%s: %s\n" % (e.__class__.__name__, str(e))) sys.exit(1) @@ -1377,10 +982,11 @@ index 0f0e564..ac8f78f 100644 import re +- -def get_all_modules(): - try: - all_modules = [] -- rc, output=commands.getstatusoutput("semodule -l 2>/dev/null") +- rc, output = commands.getstatusoutput("semodule -l 2>/dev/null") - if rc == 0: - l = output.split("\n") - for i in l: @@ -1394,9 +1000,9 @@ index 0f0e564..ac8f78f 100644 ## ## I18N ## -@@ -67,8 +53,8 @@ try: +@@ -68,8 +53,8 @@ try: unicode=False, - codeset = 'utf-8') + codeset='utf-8') except IOError: - import __builtin__ - __builtin__.__dict__['_'] = unicode @@ -1405,7 +1011,7 @@ index 0f0e564..ac8f78f 100644 gnome.program_init("SELinux Policy Generation Tool", "5") -@@ -191,10 +177,10 @@ class childWindow: +@@ -195,10 +180,10 @@ class childWindow: try: self.all_types = generate.get_all_types() @@ -1418,25 +1024,27 @@ index 0f0e564..ac8f78f 100644 self.all_types = [] self.all_modules = [] self.all_roles = [] -@@ -262,7 +248,7 @@ class childWindow: +@@ -265,8 +250,8 @@ class childWindow: self.out_udp_entry = self.xml.get_widget("out_udp_entry") - self.network_buttons[self.out_udp_all_checkbutton] = [ self.out_udp_entry ] + self.network_buttons[self.out_udp_all_checkbutton] = [self.out_udp_entry] - for b in self.network_buttons.keys(): +- b.connect("clicked", self.network_all_clicked) + for b in list(self.network_buttons.keys()): - b.connect("clicked",self.network_all_clicked) ++ b.connect("clicked",self.network_all_clicked) self.boolean_treeview = self.xml.get_widget("boolean_treeview") -@@ -333,7 +319,7 @@ class childWindow: + self.boolean_store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING) +@@ -336,7 +321,7 @@ class childWindow: for a in sepolicy.interface.get_admin(): iter = self.admin_store.append() self.admin_store.set_value(iter, 0, a) -- except ValueError,e: +- except ValueError, e: + except ValueError as e: self.error(e.message) def confine_application(self): -@@ -519,7 +505,7 @@ class childWindow: +@@ -522,7 +507,7 @@ class childWindow: self.info(my_policy.generate(outputdir)) return False @@ -1445,7 +1053,7 @@ index 0f0e564..ac8f78f 100644 self.error(e.message) def delete(self, args): -@@ -668,7 +654,7 @@ class childWindow: +@@ -671,7 +656,7 @@ class childWindow: entry.set_text("") return False if name in self.all_modules: @@ -1454,7 +1062,7 @@ index 0f0e564..ac8f78f 100644 entry.set_text("") return False -@@ -687,7 +673,7 @@ class childWindow: +@@ -690,7 +675,7 @@ class childWindow: try: generate.verify_ports(self.in_tcp_entry.get_text()) generate.verify_ports(self.in_udp_entry.get_text()) @@ -1463,7 +1071,7 @@ index 0f0e564..ac8f78f 100644 self.error(e.message) return True -@@ -695,7 +681,7 @@ class childWindow: +@@ -698,7 +683,7 @@ class childWindow: try: generate.verify_ports(self.out_tcp_entry.get_text()) generate.verify_ports(self.out_udp_entry.get_text()) @@ -1472,7 +1080,7 @@ index 0f0e564..ac8f78f 100644 self.error(e.message) return True -@@ -734,12 +720,12 @@ class childWindow: +@@ -737,12 +722,12 @@ class childWindow: policy.set_program(exe) policy.gen_writeable() policy.gen_symbols() @@ -1487,10 +1095,10 @@ index 0f0e564..ac8f78f 100644 iter = self.store.append() self.store.set_value(iter, 0, f) self.store.set_value(iter, 1, DIR) -diff --git a/policycoreutils-2.4/gui/portsPage.py b/policycoreutils-2.4/gui/portsPage.py -index bfb4e36..e6c87c5 100644 ---- a/policycoreutils-2.4/gui/portsPage.py -+++ b/policycoreutils-2.4/gui/portsPage.py +diff --git a/policycoreutils-2.5-rc1/gui/portsPage.py b/policycoreutils-2.5-rc1/gui/portsPage.py +index 8e74ac0..e8737b0 100644 +--- a/policycoreutils-2.5-rc1/gui/portsPage.py ++++ b/policycoreutils-2.5-rc1/gui/portsPage.py @@ -16,14 +16,11 @@ ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -1504,21 +1112,21 @@ index bfb4e36..e6c87c5 100644 import seobject -import commands +import subprocess - from semanagePage import *; + from semanagePage import * ## @@ -43,8 +40,8 @@ try: unicode=False, - codeset = 'utf-8') + codeset='utf-8') except IOError: - import __builtin__ - __builtin__.__dict__['_'] = unicode + import builtins + builtins.__dict__['_'] = str + class portsPage(semanagePage): - def __init__(self, xml): -@@ -62,19 +59,19 @@ class portsPage(semanagePage): +@@ -64,19 +61,19 @@ class portsPage(semanagePage): self.ports_properties_button = xml.get_widget("portsPropertiesButton") self.ports_delete_button = xml.get_widget("portsDeleteButton") liststore = self.ports_protocol_combo.get_model() @@ -1531,7 +1139,7 @@ index bfb4e36..e6c87c5 100644 self.load() def filter_changed(self, *arg): -- filter = arg[0].get_text() +- filter = arg[0].get_text() - if filter != self.filter: + filt = arg[0].get_text() + if filt != self.filter: @@ -1543,13 +1151,13 @@ index bfb4e36..e6c87c5 100644 + self.group_load(filt) def init_store(self): - self.store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING , gobject.TYPE_STRING) -@@ -116,43 +113,43 @@ class portsPage(semanagePage): + self.store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING) +@@ -118,63 +115,63 @@ class portsPage(semanagePage): except: return 0 -- def load(self,filter = ""): -- self.filter=filter +- def load(self, filter=""): +- self.filter = filter + def load(self,filt = ""): + self.filter=filt self.port = seobject.portRecords() @@ -1574,14 +1182,15 @@ index bfb4e36..e6c87c5 100644 - self.store.set_value(iter, TYPE_COL, dict[k][0]) - self.store.set_value(iter, PROTOCOL_COL, k[2]) - self.store.set_value(iter, MLS_COL, dict[k][1]) +- self.view.get_selection().select_path((0,)) + self.store.set_value(it, PORT_COL, rec) + self.store.set_value(it, TYPE_COL, pdict[k][0]) + self.store.set_value(it, PROTOCOL_COL, k[2]) + self.store.set_value(it, MLS_COL, pdict[k][1]) - self.view.get_selection().select_path ((0,)) ++ self.view.get_selection().select_path ((0,)) -- def group_load(self, filter = ""): -- self.filter=filter +- def group_load(self, filter=""): +- self.filter = filter + def group_load(self, filt = ""): + self.filter=filt self.port = seobject.portRecords() @@ -1593,7 +1202,7 @@ index bfb4e36..e6c87c5 100644 self.store.clear() for k in keys: - ports_string = ", ".join(dict[k]) -- if not (self.match(ports_string, filter) or self.match(k[0], filter) or self.match(k[1], filter) ): +- if not (self.match(ports_string, filter) or self.match(k[0], filter) or self.match(k[1], filter)): + ports_string = ", ".join(pdict[k]) + if not (self.match(ports_string, filt) or self.match(k[0], filt) or self.match(k[1], filt) ): continue @@ -1602,15 +1211,16 @@ index bfb4e36..e6c87c5 100644 - self.store.set_value(iter, PROTOCOL_COL, k[1]) - self.store.set_value(iter, PORT_COL, ports_string) - self.store.set_value(iter, MLS_COL, "") +- self.view.get_selection().select_path((0,)) + it = self.store.append() + self.store.set_value(it, TYPE_COL, k[0]) + self.store.set_value(it, PROTOCOL_COL, k[1]) + self.store.set_value(it, PORT_COL, ports_string) + self.store.set_value(it, MLS_COL, "") - self.view.get_selection().select_path ((0,)) ++ self.view.get_selection().select_path ((0,)) def propertiesDialog(self): -@@ -160,19 +157,19 @@ class portsPage(semanagePage): + if self.edit: semanagePage.propertiesDialog(self) def dialogInit(self): @@ -1628,7 +1238,7 @@ index bfb4e36..e6c87c5 100644 + protocol = store.get_value(it, PROTOCOL_COL) liststore = self.ports_protocol_combo.get_model() - iter = liststore.get_iter_first() -- while iter != None and liststore.get_value(iter,0) != protocol: +- while iter != None and liststore.get_value(iter, 0) != protocol: - iter = liststore.iter_next(iter) - if iter != None: - self.ports_protocol_combo.set_active_iter(iter) @@ -1640,7 +1250,7 @@ index bfb4e36..e6c87c5 100644 def dialogClear(self): self.ports_number_entry.set_text("") -@@ -182,19 +179,20 @@ class portsPage(semanagePage): +@@ -184,19 +181,20 @@ class portsPage(semanagePage): self.ports_mls_entry.set_text("s0") def delete(self): @@ -1659,25 +1269,26 @@ index bfb4e36..e6c87c5 100644 - if rc != 0: - return self.error(out) - store.remove(iter) +- self.view.get_selection().select_path((0,)) +- except ValueError, e: +- self.error(e.args[0]) + subprocess.check_output(cmd, + stderr=subprocess.STDOUT, + shell=True) + store.remove(it) - self.view.get_selection().select_path ((0,)) -- except ValueError, e: -- self.error(e.args[0]) ++ self.view.get_selection().select_path ((0,)) + except subprocess.CalledProcessError as e: + self.error(e.output) + self.ready() def add(self): target = self.ports_name_entry.get_text().strip() -@@ -207,39 +205,47 @@ class portsPage(semanagePage): - self.error(_("Port number \"%s\" is not valid. 0 < PORT_NUMBER < 65536 ") % port_number ) +@@ -209,39 +207,47 @@ class portsPage(semanagePage): + self.error(_("Port number \"%s\" is not valid. 0 < PORT_NUMBER < 65536 ") % port_number) return False list_model = self.ports_protocol_combo.get_model() - iter = self.ports_protocol_combo.get_active_iter() -- protocol = list_model.get_value(iter,0) +- protocol = list_model.get_value(iter, 0) + it = self.ports_protocol_combo.get_active_iter() + protocol = list_model.get_value(it,0) self.wait() @@ -1711,7 +1322,7 @@ index bfb4e36..e6c87c5 100644 port_number = self.ports_number_entry.get_text().strip() list_model = self.ports_protocol_combo.get_model() - iter = self.ports_protocol_combo.get_active_iter() -- protocol = list_model.get_value(iter,0) +- protocol = list_model.get_value(iter, 0) + it = self.ports_protocol_combo.get_active_iter() + protocol = list_model.get_value(it,0) self.wait() @@ -1743,26 +1354,26 @@ index bfb4e36..e6c87c5 100644 def on_group_clicked(self, button): self.ports_add_button.set_sensitive(self.group) -diff --git a/policycoreutils-2.4/gui/semanagePage.py b/policycoreutils-2.4/gui/semanagePage.py -index 3a0e478..040a4f8 100644 ---- a/policycoreutils-2.4/gui/semanagePage.py -+++ b/policycoreutils-2.4/gui/semanagePage.py +diff --git a/policycoreutils-2.5-rc1/gui/semanagePage.py b/policycoreutils-2.5-rc1/gui/semanagePage.py +index 5d7f2cf..1c5b095 100644 +--- a/policycoreutils-2.5-rc1/gui/semanagePage.py ++++ b/policycoreutils-2.5-rc1/gui/semanagePage.py @@ -37,8 +37,8 @@ try: unicode=False, - codeset = 'utf-8') + codeset='utf-8') except IOError: - import __builtin__ - __builtin__.__dict__['_'] = unicode + import builtins + builtins.__dict__['_'] = str + def idle_func(): - while gtk.events_pending(): -@@ -77,9 +77,9 @@ class semanagePage: +@@ -80,9 +80,9 @@ class semanagePage: return def filter_changed(self, *arg): -- filter = arg[0].get_text() +- filter = arg[0].get_text() - if filter != self.filter: - self.load(filter) + filt = arg[0].get_text() @@ -1771,7 +1382,7 @@ index 3a0e478..040a4f8 100644 def search(self, model, col, key, i): sort_col = self.store.get_sort_column_id()[0] -@@ -122,13 +122,37 @@ class semanagePage: +@@ -125,13 +125,37 @@ class semanagePage: dlg.destroy() def deleteDialog(self): @@ -1811,36 +1422,38 @@ index 3a0e478..040a4f8 100644 def addDialog(self): self.dialogClear() self.dialog.set_title(_("Add %s" % self.description)) -@@ -136,10 +160,10 @@ class semanagePage: +@@ -139,10 +163,10 @@ class semanagePage: - while self.dialog.run() == gtk.RESPONSE_OK: + while self.dialog.run() == gtk.RESPONSE_OK: try: - if self.add() == False: + if not self.add(): continue - break; +- break - except ValueError, e: ++ break; + except ValueError as e: self.error(e.args[0]) self.dialog.hide() -@@ -149,10 +173,10 @@ class semanagePage: +@@ -152,10 +176,10 @@ class semanagePage: self.dialog.set_position(gtk.WIN_POS_MOUSE) - while self.dialog.run() == gtk.RESPONSE_OK: + while self.dialog.run() == gtk.RESPONSE_OK: try: - if self.modify() == False: + if not self.modify(): continue - break; +- break - except ValueError, e: ++ break; + except ValueError as e: self.error(e.args[0]) self.dialog.hide() -diff --git a/policycoreutils-2.4/gui/statusPage.py b/policycoreutils-2.4/gui/statusPage.py -index 02685f2..6510d2a 100644 ---- a/policycoreutils-2.4/gui/statusPage.py -+++ b/policycoreutils-2.4/gui/statusPage.py +diff --git a/policycoreutils-2.5-rc1/gui/statusPage.py b/policycoreutils-2.5-rc1/gui/statusPage.py +index 991d8f3..782d186 100644 +--- a/policycoreutils-2.5-rc1/gui/statusPage.py ++++ b/policycoreutils-2.5-rc1/gui/statusPage.py @@ -16,18 +16,14 @@ ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -1869,9 +1482,9 @@ index 02685f2..6510d2a 100644 + import builtins + builtins.__dict__['_'] = unicode + class statusPage: - def __init__(self, xml): -@@ -127,21 +123,21 @@ class statusPage: +@@ -129,21 +125,21 @@ class statusPage: return rc def typemenu_changed(self, menu): @@ -1886,7 +1499,7 @@ index 02685f2..6510d2a 100644 self.relabel_checkbutton.set_active(True) -- self.write_selinux_config(modearray[enabled], type ) +- self.write_selinux_config(modearray[enabled], type) + self.write_selinux_config(modearray[enabled], setype ) self.typeHistory = menu.get_active() @@ -1897,22 +1510,20 @@ index 02685f2..6510d2a 100644 if self.initEnabled != DISABLED and enabled == DISABLED: if self.verify(_("Changing to SELinux disabled requires a reboot. It is not recommended. If you later decide to turn SELinux back on, the system will be required to relabel. If you just want to see if SELinux is causing a problem on your system, you can go to permissive mode which will only log errors and not enforce SELinux policy. Permissive mode does not require a reboot Do you wish to continue?")) == gtk.RESPONSE_NO: -@@ -154,11 +150,11 @@ class statusPage: +@@ -156,10 +152,10 @@ class statusPage: return None self.relabel_checkbutton.set_active(True) -- self.write_selinux_config(modearray[enabled], type ) +- self.write_selinux_config(modearray[enabled], type) + self.write_selinux_config(modearray[enabled], setype ) self.enabled = enabled - def write_selinux_config(self, enforcing, type): -- path = selinux.selinux_path() + "config" + def write_selinux_config(self, enforcing, setype): -+ path = selinux.selinux_path() + "config" + path = selinux.selinux_path() + "config" backup_path = path + ".bck" fd = open(path) - lines = fd.readlines() -@@ -169,7 +165,7 @@ class statusPage: +@@ -171,7 +167,7 @@ class statusPage: fd.write("SELINUX=%s\n" % enforcing) continue if l.startswith("SELINUXTYPE="): @@ -1921,26 +1532,28 @@ index 02685f2..6510d2a 100644 continue fd.write(l) fd.close() -diff --git a/policycoreutils-2.4/gui/system-config-selinux.py b/policycoreutils-2.4/gui/system-config-selinux.py -index bc3027e..9482fa5 100644 ---- a/policycoreutils-2.4/gui/system-config-selinux.py -+++ b/policycoreutils-2.4/gui/system-config-selinux.py -@@ -25,9 +25,9 @@ import string +diff --git a/policycoreutils-2.5-rc1/gui/system-config-selinux.py b/policycoreutils-2.5-rc1/gui/system-config-selinux.py +index 7d342d0..563bb49 100644 +--- a/policycoreutils-2.5-rc1/gui/system-config-selinux.py ++++ b/policycoreutils-2.5-rc1/gui/system-config-selinux.py +@@ -25,10 +25,10 @@ import string import sys try: import gtk -except RuntimeError, e: - print "system-config-selinux:", e - print "This is a graphical application and requires DISPLAY to be set." +- sys.exit(1) +except RuntimeError as e: + print("system-config-selinux:", e) + print("This is a graphical application and requires DISPLAY to be set.") - sys.exit (1) ++ sys.exit (1) import gtk.glade + import os @@ -57,8 +57,8 @@ try: unicode=False, - codeset = 'utf-8') + codeset='utf-8') except IOError: - import __builtin__ - __builtin__.__dict__['_'] = unicode @@ -1949,19 +1562,23 @@ index bc3027e..9482fa5 100644 gnome.program_init("SELinux Management Tool", "5") -@@ -95,7 +95,7 @@ class childWindow: +@@ -94,9 +94,9 @@ class childWindow: + self.add_page(loginsPage.loginsPage(xml)) + self.add_page(usersPage.usersPage(xml)) self.add_page(portsPage.portsPage(xml)) - self.add_page(modulesPage.modulesPage(xml)) # modules - self.add_page(domainsPage.domainsPage(xml)) # domains +- self.add_page(modulesPage.modulesPage(xml)) # modules +- self.add_page(domainsPage.domainsPage(xml)) # domains - except ValueError, e: ++ self.add_page(modulesPage.modulesPage(xml)) # modules ++ self.add_page(domainsPage.domainsPage(xml)) # domains + except ValueError as e: self.error(e.message) xml.signal_connect("on_quit_activate", self.destroy) -diff --git a/policycoreutils-2.4/gui/usersPage.py b/policycoreutils-2.4/gui/usersPage.py -index 93804ac..1451903 100644 ---- a/policycoreutils-2.4/gui/usersPage.py -+++ b/policycoreutils-2.4/gui/usersPage.py +diff --git a/policycoreutils-2.5-rc1/gui/usersPage.py b/policycoreutils-2.5-rc1/gui/usersPage.py +index abf8d3b..f50fcb2 100644 +--- a/policycoreutils-2.5-rc1/gui/usersPage.py ++++ b/policycoreutils-2.5-rc1/gui/usersPage.py @@ -16,13 +16,10 @@ ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -1975,7 +1592,7 @@ index 93804ac..1451903 100644 -import commands +import subprocess import seobject - from semanagePage import *; + from semanagePage import * @@ -36,8 +33,8 @@ gettext.textdomain(PROGNAME) try: @@ -1986,14 +1603,14 @@ index 93804ac..1451903 100644 + import builtins + builtins.__dict__['_'] = unicode + class usersPage(semanagePage): - def __init__(self, xml): -@@ -65,34 +62,30 @@ class usersPage(semanagePage): +@@ -67,34 +64,30 @@ class usersPage(semanagePage): self.mlsRangeEntry = xml.get_widget("mlsRangeEntry") self.selinuxRolesEntry = xml.get_widget("selinuxRolesEntry") -- def load(self, filter = ""): -- self.filter=filter +- def load(self, filter=""): +- self.filter = filter + def load(self, filt = ""): + self.filter=filt self.user = seobject.seluserRecords() @@ -2014,16 +1631,17 @@ index 93804ac..1451903 100644 - self.store.set_value(iter, 0, k) - self.store.set_value(iter, 1, range) - self.store.set_value(iter, 2, dict[k][3]) +- self.view.get_selection().select_path((0,)) +- +- def delete(self): +- if semanagePage.delete(self) == gtk.RESPONSE_NO: +- return None + it = self.store.append() + self.store.set_value(it, 0, k) + self.store.set_value(it, 1, serange) + self.store.set_value(it, 2, udict[k][3]) - self.view.get_selection().select_path ((0,)) ++ self.view.get_selection().select_path ((0,)) -- def delete(self): -- if semanagePage.delete(self) == gtk.RESPONSE_NO: -- return None -- def dialogInit(self): - store, iter = self.view.get_selection().get_selected() - self.selinuxUserEntry.set_text(store.get_value(iter, 0)) @@ -2037,7 +1655,7 @@ index 93804ac..1451903 100644 def dialogClear(self): self.selinuxUserEntry.set_text("") -@@ -102,48 +95,62 @@ class usersPage(semanagePage): +@@ -104,48 +97,62 @@ class usersPage(semanagePage): def add(self): user = self.selinuxUserEntry.get_text() @@ -2046,7 +1664,7 @@ index 93804ac..1451903 100644 roles = self.selinuxRolesEntry.get_text() self.wait() -- (rc, out) = commands.getstatusoutput("semanage user -a -R '%s' -r %s %s" % (roles, range, user)) +- (rc, out) = commands.getstatusoutput("semanage user -a -R '%s' -r %s %s" % (roles, range, user)) - self.ready() - if rc != 0: - self.error(out) @@ -2075,7 +1693,7 @@ index 93804ac..1451903 100644 roles = self.selinuxRolesEntry.get_text() self.wait() -- (rc, out) = commands.getstatusoutput("semanage user -m -R '%s' -r %s %s" % (roles, range, user)) +- (rc, out) = commands.getstatusoutput("semanage user -m -R '%s' -r %s %s" % (roles, range, user)) - self.ready() - - if rc != 0: @@ -2098,13 +1716,13 @@ index 93804ac..1451903 100644 - store, iter = self.view.get_selection().get_selected() + store, it = self.view.get_selection().get_selected() try: -- user=store.get_value(iter, 0) +- user = store.get_value(iter, 0) + user=store.get_value(it, 0) if user == "root" or user == "user_u": raise ValueError(_("SELinux user '%s' is required") % user) self.wait() -- (rc, out) = commands.getstatusoutput("semanage user -d %s" % user) +- (rc, out) = commands.getstatusoutput("semanage user -d %s" % user) - self.ready() - if rc != 0: - self.error(out) @@ -2121,266 +1739,27 @@ index 93804ac..1451903 100644 + self.ready() return False - store.remove(iter) -- self.view.get_selection().select_path ((0,)) +- self.view.get_selection().select_path((0,)) - except ValueError, e: + except ValueError as e: self.error(e.args[0]) -diff --git a/policycoreutils-2.4/hll/pp/pp.c b/policycoreutils-2.4/hll/pp/pp.c -index b863346..d994891 100644 ---- a/policycoreutils-2.4/hll/pp/pp.c -+++ b/policycoreutils-2.4/hll/pp/pp.c -@@ -1995,12 +1995,23 @@ static int role_to_cil(int indent, struct policydb *pdb, struct avrule_block *UN - // one of these roles in base, the declaration will not appeaer in - // the resulting policy, likely resulting in a compilation error in - // CIL. -+ // -+ // To make things more complicated, the auditadm_r and secadm_r -+ // roles could actually be in either the base module or a non-base -+ // module, or both. So we can't rely on this same behavior. So for -+ // these roles, don't declare them here, even if they are in a base -+ // or non-base module. Instead we will just declare them in the -+ // base module elsewhere. - int is_base_role = (!strcmp(key, "user_r") || - !strcmp(key, "staff_r") || - !strcmp(key, "sysadm_r") || - !strcmp(key, "system_r") || - !strcmp(key, "unconfined_r")); -- if ((is_base_role && pdb->policy_type == SEPOL_POLICY_BASE) || !is_base_role) { -+ int is_builtin_role = (!strcmp(key, "auditadm_r") || -+ !strcmp(key, "secadm_r")); -+ if ((is_base_role && pdb->policy_type == SEPOL_POLICY_BASE) || -+ (!is_base_role && !is_builtin_role)) { -+ - cil_println(indent, "(role %s)", key); - } +diff --git a/policycoreutils-2.5-rc1/newrole/newrole.c b/policycoreutils-2.5-rc1/newrole/newrole.c +index 65a945d..af7198d 100644 +--- a/policycoreutils-2.5-rc1/newrole/newrole.c ++++ b/policycoreutils-2.5-rc1/newrole/newrole.c +@@ -1249,7 +1249,7 @@ int main(int argc, char *argv[]) + fprintf(stderr, _("Could not close descriptors.\n")); + goto err_close_pam; } -@@ -2051,7 +2062,9 @@ static int role_to_cil(int indent, struct policydb *pdb, struct avrule_block *UN - - - for (i = 0; i < num_types; i++) { -- cil_println(indent, "(roletype %s %s)", key, types[i]); -+ if (is_id_in_scope(pdb, decl_stack, types[i], SYM_TYPES)) { -+ cil_println(indent, "(roletype %s %s)", key, types[i]); -+ } - } - - break; -@@ -3594,6 +3607,17 @@ static int generate_default_object(void) - return 0; - } - -+static int generate_builtin_roles(void) -+{ -+ // due to inconsistentencies between policies and CIL not allowing -+ // duplicate roles, some roles are always created, regardless of if they -+ // are declared in modules or not -+ cil_println(0, "(role auditadm_r)"); -+ cil_println(0, "(role secadm_r)"); -+ -+ return 0; -+} -+ - static int generate_gen_require_attribute(void) - { - cil_println(0, "(typeattribute " GEN_REQUIRE_ATTR ")"); -@@ -3679,6 +3703,11 @@ static int module_package_to_cil(struct sepol_module_package *mod_pkg) - goto exit; - } - -+ rc = generate_builtin_roles(); -+ if (rc != 0) { -+ goto exit; -+ } -+ - // default attribute to be used to mimic gen_require in CIL - rc = generate_gen_require_attribute(); - if (rc != 0) { -diff --git a/policycoreutils-2.4/newrole/newrole.c b/policycoreutils-2.4/newrole/newrole.c -index 94794e9..65a945d 100644 ---- a/policycoreutils-2.4/newrole/newrole.c -+++ b/policycoreutils-2.4/newrole/newrole.c -@@ -278,7 +278,7 @@ static int process_pam_config(FILE * cfg) - continue; - - app = service = NULL; -- ret = sscanf(buffer, "%as %as\n", &app, &service); -+ ret = sscanf(buffer, "%ms %ms\n", &app, &service); - if (ret < 2 || !app || !service) - goto err; - -@@ -546,18 +546,27 @@ static int drop_capabilities(int full) - if (!uid) return 0; - - capng_setpid(getpid()); -- capng_clear(CAPNG_SELECT_BOTH); -- if (capng_lock() < 0) -+ capng_clear(CAPNG_SELECT_CAPS); -+ -+ if (prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0) < 0) { -+ fprintf(stderr, _("Error resetting KEEPCAPS, aborting\n")); - return -1; -+ } - - /* Change uid */ - if (setresuid(uid, uid, uid)) { - fprintf(stderr, _("Error changing uid, aborting.\n")); - return -1; - } -+ -+ if (prctl(PR_SET_KEEPCAPS, 0, 0, 0, 0) < 0) { -+ fprintf(stderr, _("Error resetting KEEPCAPS, aborting\n")); -+ return -1; -+ } -+ - if (! full) - capng_update(CAPNG_ADD, CAPNG_EFFECTIVE | CAPNG_PERMITTED, CAP_AUDIT_WRITE); -- return capng_apply(CAPNG_SELECT_BOTH); -+ return capng_apply(CAPNG_SELECT_CAPS); - } - #elif defined(NAMESPACE_PRIV) - /** -@@ -575,20 +584,32 @@ static int drop_capabilities(int full) - */ - static int drop_capabilities(int full) - { -+ uid_t uid = getuid(); -+ if (!uid) return 0; -+ - capng_setpid(getpid()); -- capng_clear(CAPNG_SELECT_BOTH); -- if (capng_lock() < 0) -+ capng_clear(CAPNG_SELECT_CAPS); -+ -+ if (prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0) < 0) { -+ fprintf(stderr, _("Error resetting KEEPCAPS, aborting\n")); - return -1; -+ } - -- uid_t uid = getuid(); - /* Change uid */ - if (setresuid(uid, uid, uid)) { - fprintf(stderr, _("Error changing uid, aborting.\n")); - return -1; - } -+ -+ if (prctl(PR_SET_KEEPCAPS, 0, 0, 0, 0) < 0) { -+ fprintf(stderr, _("Error resetting KEEPCAPS, aborting\n")); -+ return -1; -+ } -+ - if (! full) -- capng_updatev(CAPNG_ADD, CAPNG_EFFECTIVE | CAPNG_PERMITTED, CAP_SYS_ADMIN , CAP_FOWNER , CAP_CHOWN, CAP_DAC_OVERRIDE, CAP_SETPCAP, -1); -- return capng_apply(CAPNG_SELECT_BOTH); -+ capng_updatev(CAPNG_ADD, CAPNG_EFFECTIVE | CAPNG_PERMITTED, CAP_SYS_ADMIN , CAP_FOWNER , CAP_CHOWN, CAP_DAC_OVERRIDE, CAP_AUDIT_WRITE, -1); -+ -+ return capng_apply(CAPNG_SELECT_CAPS); - } - - #else -@@ -679,7 +700,7 @@ static int relabel_tty(const char *ttyn, security_context_t new_context, - security_context_t * tty_context, - security_context_t * new_tty_context) - { -- int fd; -+ int fd, rc; - int enforcing = security_getenforce(); - security_context_t tty_con = NULL; - security_context_t new_tty_con = NULL; -@@ -698,7 +719,13 @@ static int relabel_tty(const char *ttyn, security_context_t new_context, - fprintf(stderr, _("Error! Could not open %s.\n"), ttyn); - return fd; - } -- fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) & ~O_NONBLOCK); -+ /* this craziness is to make sure we cann't block on open and deadlock */ -+ rc = fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) & ~O_NONBLOCK); -+ if (rc) { -+ fprintf(stderr, _("Error! Could not clear O_NONBLOCK on %s\n"), ttyn); -+ close(fd); -+ return rc; -+ } - - if (fgetfilecon(fd, &tty_con) < 0) { - fprintf(stderr, _("%s! Could not get current context " -@@ -1009,9 +1036,9 @@ int main(int argc, char *argv[]) - int fd; - pid_t childPid = 0; - char *shell_argv0 = NULL; -+ int rc; - - #ifdef USE_PAM -- int rc; - int pam_status; /* pam return code */ - pam_handle_t *pam_handle; /* opaque handle used by all PAM functions */ - -@@ -1104,7 +1131,7 @@ int main(int argc, char *argv[]) - * command when invoked by newrole. - */ - char *cmd = NULL; -- rc = sscanf(argv[optind + 1], "%as", &cmd); -+ rc = sscanf(argv[optind + 1], "%ms", &cmd); - if (rc != EOF && cmd) { - char *app_service_name = - (char *)hashtab_search(app_service_names, -@@ -1225,15 +1252,23 @@ int main(int argc, char *argv[]) - fd = open(ttyn, O_RDWR | O_NONBLOCK); +- fd = open(ttyn, O_RDWR | O_NONBLOCK); ++ fd = open(ttyn, O_RDONLY | O_NONBLOCK); if (fd != 0) goto err_close_pam; -- fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) & ~O_NONBLOCK); -+ rc = fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) & ~O_NONBLOCK); -+ if (rc) -+ goto err_close_pam; -+ - fd = open(ttyn, O_RDWR | O_NONBLOCK); - if (fd != 1) - goto err_close_pam; -- fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) & ~O_NONBLOCK); -+ rc = fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) & ~O_NONBLOCK); -+ if (rc) -+ goto err_close_pam; -+ - fd = open(ttyn, O_RDWR | O_NONBLOCK); - if (fd != 2) - goto err_close_pam; -- fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) & ~O_NONBLOCK); -+ rc = fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) & ~O_NONBLOCK); -+ if (rc) -+ goto err_close_pam; - - } - /* -@@ -1267,19 +1302,24 @@ int main(int argc, char *argv[]) - } - #endif - -- if (send_audit_message(1, old_context, new_context, ttyn)) -+ if (send_audit_message(1, old_context, new_context, ttyn)) { -+ fprintf(stderr, _("Failed to send audit message")); - goto err_close_pam_session; -+ } - freecon(old_context); old_context=NULL; - freecon(new_context); new_context=NULL; - - #ifdef NAMESPACE_PRIV -- if (transition_to_caller_uid()) -+ if (transition_to_caller_uid()) { -+ fprintf(stderr, _("Failed to transition to namespace\n")); - goto err_close_pam_session; -+ } - #endif - -- if (drop_capabilities(TRUE)) -+ if (drop_capabilities(TRUE)) { -+ fprintf(stderr, _("Failed to drop capabilities %m\n")); - goto err_close_pam_session; -- -+ } - /* Handle environment changes */ - if (restore_environment(preserve_environment, old_environ, &pw)) { - fprintf(stderr, _("Unable to restore the environment, " -diff --git a/policycoreutils-2.4/po/Makefile b/policycoreutils-2.4/po/Makefile + rc = fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) & ~O_NONBLOCK); +diff --git a/policycoreutils-2.5-rc1/po/Makefile b/policycoreutils-2.5-rc1/po/Makefile index a693823..555f381 100644 ---- a/policycoreutils-2.4/po/Makefile -+++ b/policycoreutils-2.4/po/Makefile +--- a/policycoreutils-2.5-rc1/po/Makefile ++++ b/policycoreutils-2.5-rc1/po/Makefile @@ -28,7 +28,7 @@ POTFILES = \ ../run_init/run_init.c \ ../semodule_link/semodule_link.c \ @@ -2435,10 +1814,10 @@ index a693823..555f381 100644 ../sepolicy/info.c \ ../sepolicy/search.c \ ../sepolicy/sepolicy.py \ -diff --git a/policycoreutils-2.4/po/POTFILES b/policycoreutils-2.4/po/POTFILES +diff --git a/policycoreutils-2.5-rc1/po/POTFILES b/policycoreutils-2.5-rc1/po/POTFILES index bcb9e99..ae25133 100644 ---- a/policycoreutils-2.4/po/POTFILES -+++ b/policycoreutils-2.4/po/POTFILES +--- a/policycoreutils-2.5-rc1/po/POTFILES ++++ b/policycoreutils-2.5-rc1/po/POTFILES @@ -2,7 +2,7 @@ ../run_init/run_init.c ../semodule_link/semodule_link.c @@ -2493,10 +1872,10 @@ index bcb9e99..ae25133 100644 ../sepolicy/info.c ../sepolicy/search.c ../sepolicy/sepolicy.py -diff --git a/policycoreutils-2.4/po/POTFILES.in b/policycoreutils-2.4/po/POTFILES.in +diff --git a/policycoreutils-2.5-rc1/po/POTFILES.in b/policycoreutils-2.5-rc1/po/POTFILES.in index aca0474..0ccb542 100644 ---- a/policycoreutils-2.4/po/POTFILES.in -+++ b/policycoreutils-2.4/po/POTFILES.in +--- a/policycoreutils-2.5-rc1/po/POTFILES.in ++++ b/policycoreutils-2.5-rc1/po/POTFILES.in @@ -2,7 +2,7 @@ run_init/open_init_pty.c run_init/run_init.c semodule_link/semodule_link.c @@ -2551,11 +1930,11 @@ index aca0474..0ccb542 100644 sepolicy/sepolicy/transition.py sepolicy/sepolicy/templates/executable.py sepolicy/sepolicy/templates/__init__.py -diff --git a/policycoreutils-2.4/po/ach.po b/policycoreutils-2.4/po/ach.po +diff --git a/policycoreutils-2.5-rc1/po/ach.po b/policycoreutils-2.5-rc1/po/ach.po new file mode 100644 index 0000000..0d84e13 --- /dev/null -+++ b/policycoreutils-2.4/po/ach.po ++++ b/policycoreutils-2.5-rc1/po/ach.po @@ -0,0 +1,5198 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -7755,10 +7134,10 @@ index 0000000..0d84e13 +#: ../sepolicy/sepolicy/gui.py:2777 +msgid "Loss of data Dialog" +msgstr "" -diff --git a/policycoreutils-2.4/po/af.po b/policycoreutils-2.4/po/af.po +diff --git a/policycoreutils-2.5-rc1/po/af.po b/policycoreutils-2.5-rc1/po/af.po index e4a6e09..e3cd32f 100644 ---- a/policycoreutils-2.4/po/af.po -+++ b/policycoreutils-2.4/po/af.po +--- a/policycoreutils-2.5-rc1/po/af.po ++++ b/policycoreutils-2.5-rc1/po/af.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -13018,10 +12397,10 @@ index e4a6e09..e3cd32f 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/af_ZA.po b/policycoreutils-2.4/po/af_ZA.po +diff --git a/policycoreutils-2.5-rc1/po/af_ZA.po b/policycoreutils-2.5-rc1/po/af_ZA.po index fb0b1d9..6409e2a 100644 ---- a/policycoreutils-2.4/po/af_ZA.po -+++ b/policycoreutils-2.4/po/af_ZA.po +--- a/policycoreutils-2.5-rc1/po/af_ZA.po ++++ b/policycoreutils-2.5-rc1/po/af_ZA.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -18281,10 +17660,10 @@ index fb0b1d9..6409e2a 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/aln.po b/policycoreutils-2.4/po/aln.po +diff --git a/policycoreutils-2.5-rc1/po/aln.po b/policycoreutils-2.5-rc1/po/aln.po index 507644c..b7d66d0 100644 ---- a/policycoreutils-2.4/po/aln.po -+++ b/policycoreutils-2.4/po/aln.po +--- a/policycoreutils-2.5-rc1/po/aln.po ++++ b/policycoreutils-2.5-rc1/po/aln.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -23544,10 +22923,10 @@ index 507644c..b7d66d0 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/am.po b/policycoreutils-2.4/po/am.po +diff --git a/policycoreutils-2.5-rc1/po/am.po b/policycoreutils-2.5-rc1/po/am.po index db49486..7e68aa6 100644 ---- a/policycoreutils-2.4/po/am.po -+++ b/policycoreutils-2.4/po/am.po +--- a/policycoreutils-2.5-rc1/po/am.po ++++ b/policycoreutils-2.5-rc1/po/am.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -28807,10 +28186,10 @@ index db49486..7e68aa6 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/ar.po b/policycoreutils-2.4/po/ar.po +diff --git a/policycoreutils-2.5-rc1/po/ar.po b/policycoreutils-2.5-rc1/po/ar.po index b03fb78..6eaa817 100644 ---- a/policycoreutils-2.4/po/ar.po -+++ b/policycoreutils-2.4/po/ar.po +--- a/policycoreutils-2.5-rc1/po/ar.po ++++ b/policycoreutils-2.5-rc1/po/ar.po @@ -1,7 +1,7 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -34175,10 +33554,10 @@ index b03fb78..6eaa817 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/as.po b/policycoreutils-2.4/po/as.po +diff --git a/policycoreutils-2.5-rc1/po/as.po b/policycoreutils-2.5-rc1/po/as.po index 4689a67..09f3289 100644 ---- a/policycoreutils-2.4/po/as.po -+++ b/policycoreutils-2.4/po/as.po +--- a/policycoreutils-2.5-rc1/po/as.po ++++ b/policycoreutils-2.5-rc1/po/as.po @@ -1,27 +1,26 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -40548,10 +39927,10 @@ index 4689a67..09f3289 100644 -#~ msgid "GTK Not Available" -#~ msgstr "GTK উপলব্ধ নহয়" +msgstr "তথ্যৰ ক্ষতি ডাইলগ" -diff --git a/policycoreutils-2.4/po/ast.po b/policycoreutils-2.4/po/ast.po +diff --git a/policycoreutils-2.5-rc1/po/ast.po b/policycoreutils-2.5-rc1/po/ast.po index 1a5bc23..4595f6e 100644 ---- a/policycoreutils-2.4/po/ast.po -+++ b/policycoreutils-2.4/po/ast.po +--- a/policycoreutils-2.5-rc1/po/ast.po ++++ b/policycoreutils-2.5-rc1/po/ast.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -45810,10 +45189,10 @@ index 1a5bc23..4595f6e 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/az.po b/policycoreutils-2.4/po/az.po +diff --git a/policycoreutils-2.5-rc1/po/az.po b/policycoreutils-2.5-rc1/po/az.po index 1936f49..c5a9b1f 100644 ---- a/policycoreutils-2.4/po/az.po -+++ b/policycoreutils-2.4/po/az.po +--- a/policycoreutils-2.5-rc1/po/az.po ++++ b/policycoreutils-2.5-rc1/po/az.po @@ -1,22 +1,21 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -51075,10 +50454,10 @@ index 1936f49..c5a9b1f 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/bal.po b/policycoreutils-2.4/po/bal.po +diff --git a/policycoreutils-2.5-rc1/po/bal.po b/policycoreutils-2.5-rc1/po/bal.po index 31b8576..84c7667 100644 ---- a/policycoreutils-2.4/po/bal.po -+++ b/policycoreutils-2.4/po/bal.po +--- a/policycoreutils-2.5-rc1/po/bal.po ++++ b/policycoreutils-2.5-rc1/po/bal.po @@ -1,20 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -56337,10 +55716,10 @@ index 31b8576..84c7667 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/be.po b/policycoreutils-2.4/po/be.po +diff --git a/policycoreutils-2.5-rc1/po/be.po b/policycoreutils-2.5-rc1/po/be.po index e9c7007..15635db 100644 ---- a/policycoreutils-2.4/po/be.po -+++ b/policycoreutils-2.4/po/be.po +--- a/policycoreutils-2.5-rc1/po/be.po ++++ b/policycoreutils-2.5-rc1/po/be.po @@ -1,23 +1,21 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -61603,10 +60982,10 @@ index e9c7007..15635db 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/bg.po b/policycoreutils-2.4/po/bg.po +diff --git a/policycoreutils-2.5-rc1/po/bg.po b/policycoreutils-2.5-rc1/po/bg.po index 1e71e74..b79a88b 100644 ---- a/policycoreutils-2.4/po/bg.po -+++ b/policycoreutils-2.4/po/bg.po +--- a/policycoreutils-2.5-rc1/po/bg.po ++++ b/policycoreutils-2.5-rc1/po/bg.po @@ -1,23 +1,23 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -67349,10 +66728,10 @@ index 1e71e74..b79a88b 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/bn.po b/policycoreutils-2.4/po/bn.po +diff --git a/policycoreutils-2.5-rc1/po/bn.po b/policycoreutils-2.5-rc1/po/bn.po index 1db7396..2a78eb7 100644 ---- a/policycoreutils-2.4/po/bn.po -+++ b/policycoreutils-2.4/po/bn.po +--- a/policycoreutils-2.5-rc1/po/bn.po ++++ b/policycoreutils-2.5-rc1/po/bn.po @@ -1,20 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -72610,10 +71989,10 @@ index 1db7396..2a78eb7 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/bn_IN.po b/policycoreutils-2.4/po/bn_IN.po +diff --git a/policycoreutils-2.5-rc1/po/bn_IN.po b/policycoreutils-2.5-rc1/po/bn_IN.po index 3d3cd0b..708dbda 100644 ---- a/policycoreutils-2.4/po/bn_IN.po -+++ b/policycoreutils-2.4/po/bn_IN.po +--- a/policycoreutils-2.5-rc1/po/bn_IN.po ++++ b/policycoreutils-2.5-rc1/po/bn_IN.po @@ -1,24 +1,27 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -79015,10 +78394,10 @@ index 3d3cd0b..708dbda 100644 msgid "Loss of data Dialog" -msgstr "" +msgstr "ডেটা ডায়লগ হারানো" -diff --git a/policycoreutils-2.4/po/bo.po b/policycoreutils-2.4/po/bo.po +diff --git a/policycoreutils-2.5-rc1/po/bo.po b/policycoreutils-2.5-rc1/po/bo.po index 8664488..ea90fc0 100644 ---- a/policycoreutils-2.4/po/bo.po -+++ b/policycoreutils-2.4/po/bo.po +--- a/policycoreutils-2.5-rc1/po/bo.po ++++ b/policycoreutils-2.5-rc1/po/bo.po @@ -1,20 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -84276,10 +83655,10 @@ index 8664488..ea90fc0 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/br.po b/policycoreutils-2.4/po/br.po +diff --git a/policycoreutils-2.5-rc1/po/br.po b/policycoreutils-2.5-rc1/po/br.po index 5c08944..6b329b7 100644 ---- a/policycoreutils-2.4/po/br.po -+++ b/policycoreutils-2.4/po/br.po +--- a/policycoreutils-2.5-rc1/po/br.po ++++ b/policycoreutils-2.5-rc1/po/br.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -89538,10 +88917,10 @@ index 5c08944..6b329b7 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/brx.po b/policycoreutils-2.4/po/brx.po +diff --git a/policycoreutils-2.5-rc1/po/brx.po b/policycoreutils-2.5-rc1/po/brx.po index 3d6ccd2..a2b42b9 100644 ---- a/policycoreutils-2.4/po/brx.po -+++ b/policycoreutils-2.4/po/brx.po +--- a/policycoreutils-2.5-rc1/po/brx.po ++++ b/policycoreutils-2.5-rc1/po/brx.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -94801,10 +94180,10 @@ index 3d6ccd2..a2b42b9 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/bs.po b/policycoreutils-2.4/po/bs.po +diff --git a/policycoreutils-2.5-rc1/po/bs.po b/policycoreutils-2.5-rc1/po/bs.po index ec4c1d3..a2d31ae 100644 ---- a/policycoreutils-2.4/po/bs.po -+++ b/policycoreutils-2.4/po/bs.po +--- a/policycoreutils-2.5-rc1/po/bs.po ++++ b/policycoreutils-2.5-rc1/po/bs.po @@ -1,34 +1,29 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -100139,10 +99518,10 @@ index ec4c1d3..a2d31ae 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/ca.po b/policycoreutils-2.4/po/ca.po +diff --git a/policycoreutils-2.5-rc1/po/ca.po b/policycoreutils-2.5-rc1/po/ca.po index 401e16f..5853b77 100644 ---- a/policycoreutils-2.4/po/ca.po -+++ b/policycoreutils-2.4/po/ca.po +--- a/policycoreutils-2.5-rc1/po/ca.po ++++ b/policycoreutils-2.5-rc1/po/ca.po @@ -1,7 +1,7 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -105602,10 +104981,10 @@ index 401e16f..5853b77 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/cs.po b/policycoreutils-2.4/po/cs.po +diff --git a/policycoreutils-2.5-rc1/po/cs.po b/policycoreutils-2.5-rc1/po/cs.po index 91d764b..fb59bca 100644 ---- a/policycoreutils-2.4/po/cs.po -+++ b/policycoreutils-2.4/po/cs.po +--- a/policycoreutils-2.5-rc1/po/cs.po ++++ b/policycoreutils-2.5-rc1/po/cs.po @@ -1,7 +1,7 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -110872,10 +110251,10 @@ index 91d764b..fb59bca 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/cs_CZ.po b/policycoreutils-2.4/po/cs_CZ.po +diff --git a/policycoreutils-2.5-rc1/po/cs_CZ.po b/policycoreutils-2.5-rc1/po/cs_CZ.po index 7f45f48..b27a708 100644 ---- a/policycoreutils-2.4/po/cs_CZ.po -+++ b/policycoreutils-2.4/po/cs_CZ.po +--- a/policycoreutils-2.5-rc1/po/cs_CZ.po ++++ b/policycoreutils-2.5-rc1/po/cs_CZ.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -116135,10 +115514,10 @@ index 7f45f48..b27a708 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/cy.po b/policycoreutils-2.4/po/cy.po +diff --git a/policycoreutils-2.5-rc1/po/cy.po b/policycoreutils-2.5-rc1/po/cy.po index c7ff335..1a27e75 100644 ---- a/policycoreutils-2.4/po/cy.po -+++ b/policycoreutils-2.4/po/cy.po +--- a/policycoreutils-2.5-rc1/po/cy.po ++++ b/policycoreutils-2.5-rc1/po/cy.po @@ -1,23 +1,21 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -121401,10 +120780,10 @@ index c7ff335..1a27e75 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/da.po b/policycoreutils-2.4/po/da.po +diff --git a/policycoreutils-2.5-rc1/po/da.po b/policycoreutils-2.5-rc1/po/da.po index 402c612..313bee6 100644 ---- a/policycoreutils-2.4/po/da.po -+++ b/policycoreutils-2.4/po/da.po +--- a/policycoreutils-2.5-rc1/po/da.po ++++ b/policycoreutils-2.5-rc1/po/da.po @@ -1,7 +1,7 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -126771,10 +126150,10 @@ index 402c612..313bee6 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/de.po b/policycoreutils-2.4/po/de.po +diff --git a/policycoreutils-2.5-rc1/po/de.po b/policycoreutils-2.5-rc1/po/de.po index f7ac23c..0d2f9cb 100644 ---- a/policycoreutils-2.4/po/de.po -+++ b/policycoreutils-2.4/po/de.po +--- a/policycoreutils-2.5-rc1/po/de.po ++++ b/policycoreutils-2.5-rc1/po/de.po @@ -1,15 +1,17 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -133302,10 +132681,10 @@ index f7ac23c..0d2f9cb 100644 msgid "Loss of data Dialog" -msgstr "" +msgstr "Dialog zum Datenverlust" -diff --git a/policycoreutils-2.4/po/de_CH.po b/policycoreutils-2.4/po/de_CH.po +diff --git a/policycoreutils-2.5-rc1/po/de_CH.po b/policycoreutils-2.5-rc1/po/de_CH.po index 0016016..f45025d 100644 ---- a/policycoreutils-2.4/po/de_CH.po -+++ b/policycoreutils-2.4/po/de_CH.po +--- a/policycoreutils-2.5-rc1/po/de_CH.po ++++ b/policycoreutils-2.5-rc1/po/de_CH.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -138565,10 +137944,10 @@ index 0016016..f45025d 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/dz.po b/policycoreutils-2.4/po/dz.po +diff --git a/policycoreutils-2.5-rc1/po/dz.po b/policycoreutils-2.5-rc1/po/dz.po index 9a6ca3d..312184d 100644 ---- a/policycoreutils-2.4/po/dz.po -+++ b/policycoreutils-2.4/po/dz.po +--- a/policycoreutils-2.5-rc1/po/dz.po ++++ b/policycoreutils-2.5-rc1/po/dz.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -143828,10 +143207,10 @@ index 9a6ca3d..312184d 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/el.po b/policycoreutils-2.4/po/el.po +diff --git a/policycoreutils-2.5-rc1/po/el.po b/policycoreutils-2.5-rc1/po/el.po index d9844d0..3a5bc72 100644 ---- a/policycoreutils-2.4/po/el.po -+++ b/policycoreutils-2.4/po/el.po +--- a/policycoreutils-2.5-rc1/po/el.po ++++ b/policycoreutils-2.5-rc1/po/el.po @@ -1,24 +1,24 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -149120,10 +148499,10 @@ index d9844d0..3a5bc72 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/en_GB.po b/policycoreutils-2.4/po/en_GB.po +diff --git a/policycoreutils-2.5-rc1/po/en_GB.po b/policycoreutils-2.5-rc1/po/en_GB.po index b7312f5..fcdaa99 100644 ---- a/policycoreutils-2.4/po/en_GB.po -+++ b/policycoreutils-2.4/po/en_GB.po +--- a/policycoreutils-2.5-rc1/po/en_GB.po ++++ b/policycoreutils-2.5-rc1/po/en_GB.po @@ -1,7 +1,7 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -154487,10 +153866,10 @@ index b7312f5..fcdaa99 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/en_US.po b/policycoreutils-2.4/po/en_US.po +diff --git a/policycoreutils-2.5-rc1/po/en_US.po b/policycoreutils-2.5-rc1/po/en_US.po index f800b0c..f51e977 100644 ---- a/policycoreutils-2.4/po/en_US.po -+++ b/policycoreutils-2.4/po/en_US.po +--- a/policycoreutils-2.5-rc1/po/en_US.po ++++ b/policycoreutils-2.5-rc1/po/en_US.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -159750,10 +159129,10 @@ index f800b0c..f51e977 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/eo.po b/policycoreutils-2.4/po/eo.po +diff --git a/policycoreutils-2.5-rc1/po/eo.po b/policycoreutils-2.5-rc1/po/eo.po index 5370565..aa93858 100644 ---- a/policycoreutils-2.4/po/eo.po -+++ b/policycoreutils-2.4/po/eo.po +--- a/policycoreutils-2.5-rc1/po/eo.po ++++ b/policycoreutils-2.5-rc1/po/eo.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -165013,10 +164392,10 @@ index 5370565..aa93858 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/es.po b/policycoreutils-2.4/po/es.po +diff --git a/policycoreutils-2.5-rc1/po/es.po b/policycoreutils-2.5-rc1/po/es.po index 1bf427a..238ecdd 100644 ---- a/policycoreutils-2.4/po/es.po -+++ b/policycoreutils-2.4/po/es.po +--- a/policycoreutils-2.5-rc1/po/es.po ++++ b/policycoreutils-2.5-rc1/po/es.po @@ -1,29 +1,33 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -171583,10 +170962,10 @@ index 1bf427a..238ecdd 100644 -#~ msgid "GTK Not Available" -#~ msgstr "GTK no disponible" +msgstr "Pérdida de diálogo de datos." -diff --git a/policycoreutils-2.4/po/es_ES.po b/policycoreutils-2.4/po/es_ES.po +diff --git a/policycoreutils-2.5-rc1/po/es_ES.po b/policycoreutils-2.5-rc1/po/es_ES.po index da1777f..5b12202 100644 ---- a/policycoreutils-2.4/po/es_ES.po -+++ b/policycoreutils-2.4/po/es_ES.po +--- a/policycoreutils-2.5-rc1/po/es_ES.po ++++ b/policycoreutils-2.5-rc1/po/es_ES.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -176846,10 +176225,10 @@ index da1777f..5b12202 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/et.po b/policycoreutils-2.4/po/et.po +diff --git a/policycoreutils-2.5-rc1/po/et.po b/policycoreutils-2.5-rc1/po/et.po index a89b95f..85a5aa6 100644 ---- a/policycoreutils-2.4/po/et.po -+++ b/policycoreutils-2.4/po/et.po +--- a/policycoreutils-2.5-rc1/po/et.po ++++ b/policycoreutils-2.5-rc1/po/et.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -182109,10 +181488,10 @@ index a89b95f..85a5aa6 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/eu.po b/policycoreutils-2.4/po/eu.po +diff --git a/policycoreutils-2.5-rc1/po/eu.po b/policycoreutils-2.5-rc1/po/eu.po index bde9697..423f96d 100644 ---- a/policycoreutils-2.4/po/eu.po -+++ b/policycoreutils-2.4/po/eu.po +--- a/policycoreutils-2.5-rc1/po/eu.po ++++ b/policycoreutils-2.5-rc1/po/eu.po @@ -1,22 +1,21 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -187431,10 +186810,10 @@ index bde9697..423f96d 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/eu_ES.po b/policycoreutils-2.4/po/eu_ES.po +diff --git a/policycoreutils-2.5-rc1/po/eu_ES.po b/policycoreutils-2.5-rc1/po/eu_ES.po index 6bac2a5..5dab84c 100644 ---- a/policycoreutils-2.4/po/eu_ES.po -+++ b/policycoreutils-2.4/po/eu_ES.po +--- a/policycoreutils-2.5-rc1/po/eu_ES.po ++++ b/policycoreutils-2.5-rc1/po/eu_ES.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -192694,10 +192073,10 @@ index 6bac2a5..5dab84c 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/fa.po b/policycoreutils-2.4/po/fa.po +diff --git a/policycoreutils-2.5-rc1/po/fa.po b/policycoreutils-2.5-rc1/po/fa.po index 7d33e83..3de9ef4 100644 ---- a/policycoreutils-2.4/po/fa.po -+++ b/policycoreutils-2.4/po/fa.po +--- a/policycoreutils-2.5-rc1/po/fa.po ++++ b/policycoreutils-2.5-rc1/po/fa.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -197956,10 +197335,10 @@ index 7d33e83..3de9ef4 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/fa_IR.po b/policycoreutils-2.4/po/fa_IR.po +diff --git a/policycoreutils-2.5-rc1/po/fa_IR.po b/policycoreutils-2.5-rc1/po/fa_IR.po index 96018ad..5227463 100644 ---- a/policycoreutils-2.4/po/fa_IR.po -+++ b/policycoreutils-2.4/po/fa_IR.po +--- a/policycoreutils-2.5-rc1/po/fa_IR.po ++++ b/policycoreutils-2.5-rc1/po/fa_IR.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -203219,10 +202598,10 @@ index 96018ad..5227463 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/fi.po b/policycoreutils-2.4/po/fi.po +diff --git a/policycoreutils-2.5-rc1/po/fi.po b/policycoreutils-2.5-rc1/po/fi.po index 93a94e9..2e5d70b 100644 ---- a/policycoreutils-2.4/po/fi.po -+++ b/policycoreutils-2.4/po/fi.po +--- a/policycoreutils-2.5-rc1/po/fi.po ++++ b/policycoreutils-2.5-rc1/po/fi.po @@ -1,7 +1,7 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -208625,10 +208004,10 @@ index 93a94e9..2e5d70b 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/fr.po b/policycoreutils-2.4/po/fr.po +diff --git a/policycoreutils-2.5-rc1/po/fr.po b/policycoreutils-2.5-rc1/po/fr.po index be33d59..322affd 100644 ---- a/policycoreutils-2.4/po/fr.po -+++ b/policycoreutils-2.4/po/fr.po +--- a/policycoreutils-2.5-rc1/po/fr.po ++++ b/policycoreutils-2.5-rc1/po/fr.po @@ -1,27 +1,30 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -215304,10 +214683,10 @@ index be33d59..322affd 100644 msgid "Loss of data Dialog" -msgstr "" +msgstr "Boîte de dialogue des pertes de données" -diff --git a/policycoreutils-2.4/po/ga.po b/policycoreutils-2.4/po/ga.po +diff --git a/policycoreutils-2.5-rc1/po/ga.po b/policycoreutils-2.5-rc1/po/ga.po index 683287b..3a242c1 100644 ---- a/policycoreutils-2.4/po/ga.po -+++ b/policycoreutils-2.4/po/ga.po +--- a/policycoreutils-2.5-rc1/po/ga.po ++++ b/policycoreutils-2.5-rc1/po/ga.po @@ -1,23 +1,21 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -220569,10 +219948,10 @@ index 683287b..3a242c1 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/gl.po b/policycoreutils-2.4/po/gl.po +diff --git a/policycoreutils-2.5-rc1/po/gl.po b/policycoreutils-2.5-rc1/po/gl.po index 15fbe4a..f42d615 100644 ---- a/policycoreutils-2.4/po/gl.po -+++ b/policycoreutils-2.4/po/gl.po +--- a/policycoreutils-2.5-rc1/po/gl.po ++++ b/policycoreutils-2.5-rc1/po/gl.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -225831,10 +225210,10 @@ index 15fbe4a..f42d615 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/gu.po b/policycoreutils-2.4/po/gu.po +diff --git a/policycoreutils-2.5-rc1/po/gu.po b/policycoreutils-2.5-rc1/po/gu.po index bf08113..949df1c 100644 ---- a/policycoreutils-2.4/po/gu.po -+++ b/policycoreutils-2.4/po/gu.po +--- a/policycoreutils-2.5-rc1/po/gu.po ++++ b/policycoreutils-2.5-rc1/po/gu.po @@ -1,9 +1,11 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -232070,10 +231449,10 @@ index bf08113..949df1c 100644 -#~ msgid "GTK Not Available" -#~ msgstr "GTK ઉપલબ્ધ નથી" +msgstr "સંવાદની ગુમ થયેલ માહિતી" -diff --git a/policycoreutils-2.4/po/he.po b/policycoreutils-2.4/po/he.po +diff --git a/policycoreutils-2.5-rc1/po/he.po b/policycoreutils-2.5-rc1/po/he.po index 9e3af00..fe46548 100644 ---- a/policycoreutils-2.4/po/he.po -+++ b/policycoreutils-2.4/po/he.po +--- a/policycoreutils-2.5-rc1/po/he.po ++++ b/policycoreutils-2.5-rc1/po/he.po @@ -1,20 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -237332,10 +236711,10 @@ index 9e3af00..fe46548 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/hi.po b/policycoreutils-2.4/po/hi.po +diff --git a/policycoreutils-2.5-rc1/po/hi.po b/policycoreutils-2.5-rc1/po/hi.po index 34a5224..e626924 100644 ---- a/policycoreutils-2.4/po/hi.po -+++ b/policycoreutils-2.4/po/hi.po +--- a/policycoreutils-2.5-rc1/po/hi.po ++++ b/policycoreutils-2.5-rc1/po/hi.po @@ -1,23 +1,23 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -243509,10 +242888,10 @@ index 34a5224..e626924 100644 msgid "Loss of data Dialog" -msgstr "" +msgstr "आँकड़ा संवाद का नुकसान" -diff --git a/policycoreutils-2.4/po/hr.po b/policycoreutils-2.4/po/hr.po +diff --git a/policycoreutils-2.5-rc1/po/hr.po b/policycoreutils-2.5-rc1/po/hr.po index 9e7db25..14d9fae 100644 ---- a/policycoreutils-2.4/po/hr.po -+++ b/policycoreutils-2.4/po/hr.po +--- a/policycoreutils-2.5-rc1/po/hr.po ++++ b/policycoreutils-2.5-rc1/po/hr.po @@ -1,33 +1,28 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -248878,10 +248257,10 @@ index 9e7db25..14d9fae 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/hr_HR.po b/policycoreutils-2.4/po/hr_HR.po +diff --git a/policycoreutils-2.5-rc1/po/hr_HR.po b/policycoreutils-2.5-rc1/po/hr_HR.po index 7a5c997..b274684 100644 ---- a/policycoreutils-2.4/po/hr_HR.po -+++ b/policycoreutils-2.4/po/hr_HR.po +--- a/policycoreutils-2.5-rc1/po/hr_HR.po ++++ b/policycoreutils-2.5-rc1/po/hr_HR.po @@ -1,23 +1,21 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -254144,10 +253523,10 @@ index 7a5c997..b274684 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/hu.po b/policycoreutils-2.4/po/hu.po +diff --git a/policycoreutils-2.5-rc1/po/hu.po b/policycoreutils-2.5-rc1/po/hu.po index e358401..9a10317 100644 ---- a/policycoreutils-2.4/po/hu.po -+++ b/policycoreutils-2.4/po/hu.po +--- a/policycoreutils-2.5-rc1/po/hu.po ++++ b/policycoreutils-2.5-rc1/po/hu.po @@ -1,24 +1,25 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -260762,10 +260141,10 @@ index e358401..9a10317 100644 - -#~ msgid "GTK Not Available" -#~ msgstr "GTK nem elérhető" -diff --git a/policycoreutils-2.4/po/hy.po b/policycoreutils-2.4/po/hy.po +diff --git a/policycoreutils-2.5-rc1/po/hy.po b/policycoreutils-2.5-rc1/po/hy.po index 0bc535d..6ee4807 100644 ---- a/policycoreutils-2.4/po/hy.po -+++ b/policycoreutils-2.4/po/hy.po +--- a/policycoreutils-2.5-rc1/po/hy.po ++++ b/policycoreutils-2.5-rc1/po/hy.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -266025,10 +265404,10 @@ index 0bc535d..6ee4807 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/ia.po b/policycoreutils-2.4/po/ia.po +diff --git a/policycoreutils-2.5-rc1/po/ia.po b/policycoreutils-2.5-rc1/po/ia.po index ca47314..a69d915 100644 ---- a/policycoreutils-2.4/po/ia.po -+++ b/policycoreutils-2.4/po/ia.po +--- a/policycoreutils-2.5-rc1/po/ia.po ++++ b/policycoreutils-2.5-rc1/po/ia.po @@ -1,20 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -271286,10 +270665,10 @@ index ca47314..a69d915 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/id.po b/policycoreutils-2.4/po/id.po +diff --git a/policycoreutils-2.5-rc1/po/id.po b/policycoreutils-2.5-rc1/po/id.po index 8bd451c..9fc0114 100644 ---- a/policycoreutils-2.4/po/id.po -+++ b/policycoreutils-2.4/po/id.po +--- a/policycoreutils-2.5-rc1/po/id.po ++++ b/policycoreutils-2.5-rc1/po/id.po @@ -1,20 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -276547,10 +275926,10 @@ index 8bd451c..9fc0114 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/ilo.po b/policycoreutils-2.4/po/ilo.po +diff --git a/policycoreutils-2.5-rc1/po/ilo.po b/policycoreutils-2.5-rc1/po/ilo.po index 07c416a..ae3ef6e 100644 ---- a/policycoreutils-2.4/po/ilo.po -+++ b/policycoreutils-2.4/po/ilo.po +--- a/policycoreutils-2.5-rc1/po/ilo.po ++++ b/policycoreutils-2.5-rc1/po/ilo.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -281810,10 +281189,10 @@ index 07c416a..ae3ef6e 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/is.po b/policycoreutils-2.4/po/is.po +diff --git a/policycoreutils-2.5-rc1/po/is.po b/policycoreutils-2.5-rc1/po/is.po index 0ded88a..583b0e7 100644 ---- a/policycoreutils-2.4/po/is.po -+++ b/policycoreutils-2.4/po/is.po +--- a/policycoreutils-2.5-rc1/po/is.po ++++ b/policycoreutils-2.5-rc1/po/is.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -287072,10 +286451,10 @@ index 0ded88a..583b0e7 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/it.po b/policycoreutils-2.4/po/it.po +diff --git a/policycoreutils-2.5-rc1/po/it.po b/policycoreutils-2.5-rc1/po/it.po index 0ec9bff..14dc845 100644 ---- a/policycoreutils-2.4/po/it.po -+++ b/policycoreutils-2.4/po/it.po +--- a/policycoreutils-2.5-rc1/po/it.po ++++ b/policycoreutils-2.5-rc1/po/it.po @@ -1,24 +1,31 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -293594,10 +292973,10 @@ index 0ec9bff..14dc845 100644 -#~ msgid "GTK Not Available" -#~ msgstr "GTK Non Disponibile" +msgstr "Dialogo Perdita di dati" -diff --git a/policycoreutils-2.4/po/it_IT.po b/policycoreutils-2.4/po/it_IT.po +diff --git a/policycoreutils-2.5-rc1/po/it_IT.po b/policycoreutils-2.5-rc1/po/it_IT.po index dee73ea..8e362af 100644 ---- a/policycoreutils-2.4/po/it_IT.po -+++ b/policycoreutils-2.4/po/it_IT.po +--- a/policycoreutils-2.5-rc1/po/it_IT.po ++++ b/policycoreutils-2.5-rc1/po/it_IT.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -298857,10 +298236,10 @@ index dee73ea..8e362af 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/ja.po b/policycoreutils-2.4/po/ja.po +diff --git a/policycoreutils-2.5-rc1/po/ja.po b/policycoreutils-2.5-rc1/po/ja.po index b9487c1..585d116 100644 ---- a/policycoreutils-2.4/po/ja.po -+++ b/policycoreutils-2.4/po/ja.po +--- a/policycoreutils-2.5-rc1/po/ja.po ++++ b/policycoreutils-2.5-rc1/po/ja.po @@ -1,31 +1,32 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -305340,10 +304719,10 @@ index b9487c1..585d116 100644 -#~ msgid "GTK Not Available" -#~ msgstr "GTK が利用できません" +msgstr "データ損失ダイアログ" -diff --git a/policycoreutils-2.4/po/ja_JP.po b/policycoreutils-2.4/po/ja_JP.po +diff --git a/policycoreutils-2.5-rc1/po/ja_JP.po b/policycoreutils-2.5-rc1/po/ja_JP.po index 8f6fc19..9ff06ec 100644 ---- a/policycoreutils-2.4/po/ja_JP.po -+++ b/policycoreutils-2.4/po/ja_JP.po +--- a/policycoreutils-2.5-rc1/po/ja_JP.po ++++ b/policycoreutils-2.5-rc1/po/ja_JP.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -310603,10 +309982,10 @@ index 8f6fc19..9ff06ec 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/ka.po b/policycoreutils-2.4/po/ka.po +diff --git a/policycoreutils-2.5-rc1/po/ka.po b/policycoreutils-2.5-rc1/po/ka.po index b6e3ffd..2145846 100644 ---- a/policycoreutils-2.4/po/ka.po -+++ b/policycoreutils-2.4/po/ka.po +--- a/policycoreutils-2.5-rc1/po/ka.po ++++ b/policycoreutils-2.5-rc1/po/ka.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -315865,10 +315244,10 @@ index b6e3ffd..2145846 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/kk.po b/policycoreutils-2.4/po/kk.po +diff --git a/policycoreutils-2.5-rc1/po/kk.po b/policycoreutils-2.5-rc1/po/kk.po index 1eabf04..a72124b 100644 ---- a/policycoreutils-2.4/po/kk.po -+++ b/policycoreutils-2.4/po/kk.po +--- a/policycoreutils-2.5-rc1/po/kk.po ++++ b/policycoreutils-2.5-rc1/po/kk.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -321127,10 +320506,10 @@ index 1eabf04..a72124b 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/km.po b/policycoreutils-2.4/po/km.po +diff --git a/policycoreutils-2.5-rc1/po/km.po b/policycoreutils-2.5-rc1/po/km.po index e91ea5c..cbc50b6 100644 ---- a/policycoreutils-2.4/po/km.po -+++ b/policycoreutils-2.4/po/km.po +--- a/policycoreutils-2.5-rc1/po/km.po ++++ b/policycoreutils-2.5-rc1/po/km.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -326390,10 +325769,10 @@ index e91ea5c..cbc50b6 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/kn.po b/policycoreutils-2.4/po/kn.po +diff --git a/policycoreutils-2.5-rc1/po/kn.po b/policycoreutils-2.5-rc1/po/kn.po index a528c7e..638f842 100644 ---- a/policycoreutils-2.4/po/kn.po -+++ b/policycoreutils-2.4/po/kn.po +--- a/policycoreutils-2.5-rc1/po/kn.po ++++ b/policycoreutils-2.5-rc1/po/kn.po @@ -1,26 +1,26 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -332879,10 +332258,10 @@ index a528c7e..638f842 100644 -#~ msgid "GTK Not Available" -#~ msgstr "GTK ಲಭ್ಯವಿಲ್ಲ" +msgstr "ದತ್ತಾಂಶ ಸಂವಾದಚೌಕವು ಇಲ್ಲ" -diff --git a/policycoreutils-2.4/po/ko.po b/policycoreutils-2.4/po/ko.po +diff --git a/policycoreutils-2.5-rc1/po/ko.po b/policycoreutils-2.5-rc1/po/ko.po index 49c34e5..ef8a1c7 100644 ---- a/policycoreutils-2.4/po/ko.po -+++ b/policycoreutils-2.4/po/ko.po +--- a/policycoreutils-2.5-rc1/po/ko.po ++++ b/policycoreutils-2.5-rc1/po/ko.po @@ -1,23 +1,23 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -339228,10 +338607,10 @@ index 49c34e5..ef8a1c7 100644 msgid "Loss of data Dialog" -msgstr "" +msgstr "데이터 대화 손실 " -diff --git a/policycoreutils-2.4/po/ks.po b/policycoreutils-2.4/po/ks.po +diff --git a/policycoreutils-2.5-rc1/po/ks.po b/policycoreutils-2.5-rc1/po/ks.po index 59c9404..37e2acd 100644 ---- a/policycoreutils-2.4/po/ks.po -+++ b/policycoreutils-2.4/po/ks.po +--- a/policycoreutils-2.5-rc1/po/ks.po ++++ b/policycoreutils-2.5-rc1/po/ks.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -344490,10 +343869,10 @@ index 59c9404..37e2acd 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/ku.po b/policycoreutils-2.4/po/ku.po +diff --git a/policycoreutils-2.5-rc1/po/ku.po b/policycoreutils-2.5-rc1/po/ku.po index 9d9f1df..aac3b8e 100644 ---- a/policycoreutils-2.4/po/ku.po -+++ b/policycoreutils-2.4/po/ku.po +--- a/policycoreutils-2.5-rc1/po/ku.po ++++ b/policycoreutils-2.5-rc1/po/ku.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -349753,10 +349132,10 @@ index 9d9f1df..aac3b8e 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/ky.po b/policycoreutils-2.4/po/ky.po +diff --git a/policycoreutils-2.5-rc1/po/ky.po b/policycoreutils-2.5-rc1/po/ky.po index c5fdd2f..045d5fe 100644 ---- a/policycoreutils-2.4/po/ky.po -+++ b/policycoreutils-2.4/po/ky.po +--- a/policycoreutils-2.5-rc1/po/ky.po ++++ b/policycoreutils-2.5-rc1/po/ky.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -355016,10 +354395,10 @@ index c5fdd2f..045d5fe 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/la.po b/policycoreutils-2.4/po/la.po +diff --git a/policycoreutils-2.5-rc1/po/la.po b/policycoreutils-2.5-rc1/po/la.po index dc61a42..76166f2 100644 ---- a/policycoreutils-2.4/po/la.po -+++ b/policycoreutils-2.4/po/la.po +--- a/policycoreutils-2.5-rc1/po/la.po ++++ b/policycoreutils-2.5-rc1/po/la.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -360279,10 +359658,10 @@ index dc61a42..76166f2 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/lo.po b/policycoreutils-2.4/po/lo.po +diff --git a/policycoreutils-2.5-rc1/po/lo.po b/policycoreutils-2.5-rc1/po/lo.po index 91003c8..44462c1 100644 ---- a/policycoreutils-2.4/po/lo.po -+++ b/policycoreutils-2.4/po/lo.po +--- a/policycoreutils-2.5-rc1/po/lo.po ++++ b/policycoreutils-2.5-rc1/po/lo.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -365542,10 +364921,10 @@ index 91003c8..44462c1 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/lt.po b/policycoreutils-2.4/po/lt.po +diff --git a/policycoreutils-2.5-rc1/po/lt.po b/policycoreutils-2.5-rc1/po/lt.po index c811075..b313ffa 100644 ---- a/policycoreutils-2.4/po/lt.po -+++ b/policycoreutils-2.4/po/lt.po +--- a/policycoreutils-2.5-rc1/po/lt.po ++++ b/policycoreutils-2.5-rc1/po/lt.po @@ -1,23 +1,21 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -370808,10 +370187,10 @@ index c811075..b313ffa 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/lv.po b/policycoreutils-2.4/po/lv.po +diff --git a/policycoreutils-2.5-rc1/po/lv.po b/policycoreutils-2.5-rc1/po/lv.po index 6bb48a3..47c8573 100644 ---- a/policycoreutils-2.4/po/lv.po -+++ b/policycoreutils-2.4/po/lv.po +--- a/policycoreutils-2.5-rc1/po/lv.po ++++ b/policycoreutils-2.5-rc1/po/lv.po @@ -1,23 +1,21 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -376073,10 +375452,10 @@ index 6bb48a3..47c8573 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/mai.po b/policycoreutils-2.4/po/mai.po +diff --git a/policycoreutils-2.5-rc1/po/mai.po b/policycoreutils-2.5-rc1/po/mai.po index 63e9b9a..92e8285 100644 ---- a/policycoreutils-2.4/po/mai.po -+++ b/policycoreutils-2.4/po/mai.po +--- a/policycoreutils-2.5-rc1/po/mai.po ++++ b/policycoreutils-2.5-rc1/po/mai.po @@ -1,22 +1,21 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -381436,10 +380815,10 @@ index 63e9b9a..92e8285 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/mg.po b/policycoreutils-2.4/po/mg.po +diff --git a/policycoreutils-2.5-rc1/po/mg.po b/policycoreutils-2.5-rc1/po/mg.po index 4192aec..53a1e04 100644 ---- a/policycoreutils-2.4/po/mg.po -+++ b/policycoreutils-2.4/po/mg.po +--- a/policycoreutils-2.5-rc1/po/mg.po ++++ b/policycoreutils-2.5-rc1/po/mg.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -386699,10 +386078,10 @@ index 4192aec..53a1e04 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/mk.po b/policycoreutils-2.4/po/mk.po +diff --git a/policycoreutils-2.5-rc1/po/mk.po b/policycoreutils-2.5-rc1/po/mk.po index 9e58dcd..5ef07d7 100644 ---- a/policycoreutils-2.4/po/mk.po -+++ b/policycoreutils-2.4/po/mk.po +--- a/policycoreutils-2.5-rc1/po/mk.po ++++ b/policycoreutils-2.5-rc1/po/mk.po @@ -1,7 +1,7 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -392047,10 +391426,10 @@ index 9e58dcd..5ef07d7 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/ml.po b/policycoreutils-2.4/po/ml.po +diff --git a/policycoreutils-2.5-rc1/po/ml.po b/policycoreutils-2.5-rc1/po/ml.po index dc07ee8..5a3820a 100644 ---- a/policycoreutils-2.4/po/ml.po -+++ b/policycoreutils-2.4/po/ml.po +--- a/policycoreutils-2.5-rc1/po/ml.po ++++ b/policycoreutils-2.5-rc1/po/ml.po @@ -1,22 +1,22 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -398388,10 +397767,10 @@ index dc07ee8..5a3820a 100644 -#~ msgid "GTK Not Available" -#~ msgstr "ജിറ്റികെ ലഭ്യമല്ല" +msgstr "ഡേറ്റാ ഡയലോഗിന്റെ നഷ്ടം" -diff --git a/policycoreutils-2.4/po/mn.po b/policycoreutils-2.4/po/mn.po +diff --git a/policycoreutils-2.5-rc1/po/mn.po b/policycoreutils-2.5-rc1/po/mn.po index 9d1342b..78a0053 100644 ---- a/policycoreutils-2.4/po/mn.po -+++ b/policycoreutils-2.4/po/mn.po +--- a/policycoreutils-2.5-rc1/po/mn.po ++++ b/policycoreutils-2.5-rc1/po/mn.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -403651,10 +403030,10 @@ index 9d1342b..78a0053 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/mr.po b/policycoreutils-2.4/po/mr.po +diff --git a/policycoreutils-2.5-rc1/po/mr.po b/policycoreutils-2.5-rc1/po/mr.po index cfc3b88..5c0a6fc 100644 ---- a/policycoreutils-2.4/po/mr.po -+++ b/policycoreutils-2.4/po/mr.po +--- a/policycoreutils-2.5-rc1/po/mr.po ++++ b/policycoreutils-2.5-rc1/po/mr.po @@ -1,28 +1,27 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -409868,10 +409247,10 @@ index cfc3b88..5c0a6fc 100644 -#~ msgid "GTK Not Available" -#~ msgstr "GTK उपलब्ध नाही" +msgstr "डाटा संवाद गमवणे" -diff --git a/policycoreutils-2.4/po/ms.po b/policycoreutils-2.4/po/ms.po +diff --git a/policycoreutils-2.5-rc1/po/ms.po b/policycoreutils-2.5-rc1/po/ms.po index 4b2f210..19ec43a 100644 ---- a/policycoreutils-2.4/po/ms.po -+++ b/policycoreutils-2.4/po/ms.po +--- a/policycoreutils-2.5-rc1/po/ms.po ++++ b/policycoreutils-2.5-rc1/po/ms.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -415164,10 +414543,10 @@ index 4b2f210..19ec43a 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/ms_MY.po b/policycoreutils-2.4/po/ms_MY.po +diff --git a/policycoreutils-2.5-rc1/po/ms_MY.po b/policycoreutils-2.5-rc1/po/ms_MY.po index e423569..8477661 100644 ---- a/policycoreutils-2.4/po/ms_MY.po -+++ b/policycoreutils-2.4/po/ms_MY.po +--- a/policycoreutils-2.5-rc1/po/ms_MY.po ++++ b/policycoreutils-2.5-rc1/po/ms_MY.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -420427,10 +419806,10 @@ index e423569..8477661 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/my.po b/policycoreutils-2.4/po/my.po +diff --git a/policycoreutils-2.5-rc1/po/my.po b/policycoreutils-2.5-rc1/po/my.po index 37eb16a..c191432 100644 ---- a/policycoreutils-2.4/po/my.po -+++ b/policycoreutils-2.4/po/my.po +--- a/policycoreutils-2.5-rc1/po/my.po ++++ b/policycoreutils-2.5-rc1/po/my.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -425690,10 +425069,10 @@ index 37eb16a..c191432 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/nb.po b/policycoreutils-2.4/po/nb.po +diff --git a/policycoreutils-2.5-rc1/po/nb.po b/policycoreutils-2.5-rc1/po/nb.po index 410a43e..9feb269 100644 ---- a/policycoreutils-2.4/po/nb.po -+++ b/policycoreutils-2.4/po/nb.po +--- a/policycoreutils-2.5-rc1/po/nb.po ++++ b/policycoreutils-2.5-rc1/po/nb.po @@ -1,20 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -430957,10 +430336,10 @@ index 410a43e..9feb269 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/nds.po b/policycoreutils-2.4/po/nds.po +diff --git a/policycoreutils-2.5-rc1/po/nds.po b/policycoreutils-2.5-rc1/po/nds.po index 1a1547c..cd7923d 100644 ---- a/policycoreutils-2.4/po/nds.po -+++ b/policycoreutils-2.4/po/nds.po +--- a/policycoreutils-2.5-rc1/po/nds.po ++++ b/policycoreutils-2.5-rc1/po/nds.po @@ -1,20 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -436219,10 +435598,10 @@ index 1a1547c..cd7923d 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/ne.po b/policycoreutils-2.4/po/ne.po +diff --git a/policycoreutils-2.5-rc1/po/ne.po b/policycoreutils-2.5-rc1/po/ne.po index c74d665..eeb264a 100644 ---- a/policycoreutils-2.4/po/ne.po -+++ b/policycoreutils-2.4/po/ne.po +--- a/policycoreutils-2.5-rc1/po/ne.po ++++ b/policycoreutils-2.5-rc1/po/ne.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -441482,10 +440861,10 @@ index c74d665..eeb264a 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/nl.po b/policycoreutils-2.4/po/nl.po +diff --git a/policycoreutils-2.5-rc1/po/nl.po b/policycoreutils-2.5-rc1/po/nl.po index 3d3b111..af63eb8 100644 ---- a/policycoreutils-2.4/po/nl.po -+++ b/policycoreutils-2.4/po/nl.po +--- a/policycoreutils-2.5-rc1/po/nl.po ++++ b/policycoreutils-2.5-rc1/po/nl.po @@ -1,24 +1,24 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -448474,10 +447853,10 @@ index 3d3b111..af63eb8 100644 msgid "Loss of data Dialog" -msgstr "" +msgstr "Dataverliesdialoog" -diff --git a/policycoreutils-2.4/po/nn.po b/policycoreutils-2.4/po/nn.po +diff --git a/policycoreutils-2.5-rc1/po/nn.po b/policycoreutils-2.5-rc1/po/nn.po index e89e353..9b1fe2a 100644 ---- a/policycoreutils-2.4/po/nn.po -+++ b/policycoreutils-2.4/po/nn.po +--- a/policycoreutils-2.5-rc1/po/nn.po ++++ b/policycoreutils-2.5-rc1/po/nn.po @@ -1,20 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -453735,10 +453114,10 @@ index e89e353..9b1fe2a 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/no.po b/policycoreutils-2.4/po/no.po +diff --git a/policycoreutils-2.5-rc1/po/no.po b/policycoreutils-2.5-rc1/po/no.po index f147697..96bf2e4 100644 ---- a/policycoreutils-2.4/po/no.po -+++ b/policycoreutils-2.4/po/no.po +--- a/policycoreutils-2.5-rc1/po/no.po ++++ b/policycoreutils-2.5-rc1/po/no.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -458998,10 +458377,10 @@ index f147697..96bf2e4 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/nso.po b/policycoreutils-2.4/po/nso.po +diff --git a/policycoreutils-2.5-rc1/po/nso.po b/policycoreutils-2.5-rc1/po/nso.po index 5684f24..c55ab76 100644 ---- a/policycoreutils-2.4/po/nso.po -+++ b/policycoreutils-2.4/po/nso.po +--- a/policycoreutils-2.5-rc1/po/nso.po ++++ b/policycoreutils-2.5-rc1/po/nso.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -464261,10 +463640,10 @@ index 5684f24..c55ab76 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/or.po b/policycoreutils-2.4/po/or.po +diff --git a/policycoreutils-2.5-rc1/po/or.po b/policycoreutils-2.5-rc1/po/or.po index 3f3e921..9097a84 100644 ---- a/policycoreutils-2.4/po/or.po -+++ b/policycoreutils-2.4/po/or.po +--- a/policycoreutils-2.5-rc1/po/or.po ++++ b/policycoreutils-2.5-rc1/po/or.po @@ -1,25 +1,24 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -470520,10 +469899,10 @@ index 3f3e921..9097a84 100644 -#~ msgid "GTK Not Available" -#~ msgstr "GTK ଉପଲବ୍ଧ ନାହିଁ" +msgstr "ତଥ୍ୟ ନଷ୍ଟ ସଂଳାପ" -diff --git a/policycoreutils-2.4/po/pa.po b/policycoreutils-2.4/po/pa.po +diff --git a/policycoreutils-2.5-rc1/po/pa.po b/policycoreutils-2.5-rc1/po/pa.po index 845642e..6659c23 100644 ---- a/policycoreutils-2.4/po/pa.po -+++ b/policycoreutils-2.4/po/pa.po +--- a/policycoreutils-2.5-rc1/po/pa.po ++++ b/policycoreutils-2.5-rc1/po/pa.po @@ -1,8 +1,10 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -477435,10 +476814,10 @@ index 845642e..6659c23 100644 -#~ msgid "GTK Not Available" -#~ msgstr "GTK ਉਪਲੱਬਧ ਨਹੀਂ" +msgstr "ਡਾਟਾ ਸੰਵਾਦ ਦਾ ਘਾਟਾ" -diff --git a/policycoreutils-2.4/po/pl.po b/policycoreutils-2.4/po/pl.po +diff --git a/policycoreutils-2.5-rc1/po/pl.po b/policycoreutils-2.5-rc1/po/pl.po index 6764d70..065fac3 100644 ---- a/policycoreutils-2.4/po/pl.po -+++ b/policycoreutils-2.4/po/pl.po +--- a/policycoreutils-2.5-rc1/po/pl.po ++++ b/policycoreutils-2.5-rc1/po/pl.po @@ -1,7 +1,7 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -483468,10 +482847,10 @@ index 6764d70..065fac3 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/policycoreutils.pot b/policycoreutils-2.4/po/policycoreutils.pot +diff --git a/policycoreutils-2.5-rc1/po/policycoreutils.pot b/policycoreutils-2.5-rc1/po/policycoreutils.pot index be2f1eb..e737599 100644 ---- a/policycoreutils-2.4/po/policycoreutils.pot -+++ b/policycoreutils-2.4/po/policycoreutils.pot +--- a/policycoreutils-2.5-rc1/po/policycoreutils.pot ++++ b/policycoreutils-2.5-rc1/po/policycoreutils.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" @@ -488622,10 +488001,10 @@ index be2f1eb..e737599 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/pt.po b/policycoreutils-2.4/po/pt.po +diff --git a/policycoreutils-2.5-rc1/po/pt.po b/policycoreutils-2.5-rc1/po/pt.po index b969142..fe3165a 100644 ---- a/policycoreutils-2.4/po/pt.po -+++ b/policycoreutils-2.4/po/pt.po +--- a/policycoreutils-2.5-rc1/po/pt.po ++++ b/policycoreutils-2.5-rc1/po/pt.po @@ -1,7 +1,7 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -494072,10 +493451,10 @@ index b969142..fe3165a 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/pt_BR.po b/policycoreutils-2.4/po/pt_BR.po +diff --git a/policycoreutils-2.5-rc1/po/pt_BR.po b/policycoreutils-2.5-rc1/po/pt_BR.po index bea6ff5..8ea9fde 100644 ---- a/policycoreutils-2.4/po/pt_BR.po -+++ b/policycoreutils-2.4/po/pt_BR.po +--- a/policycoreutils-2.5-rc1/po/pt_BR.po ++++ b/policycoreutils-2.5-rc1/po/pt_BR.po @@ -1,13 +1,14 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -500463,10 +499842,10 @@ index bea6ff5..8ea9fde 100644 msgid "Loss of data Dialog" -msgstr "" +msgstr "Perda de Diálogo de dados" -diff --git a/policycoreutils-2.4/po/ro.po b/policycoreutils-2.4/po/ro.po +diff --git a/policycoreutils-2.5-rc1/po/ro.po b/policycoreutils-2.5-rc1/po/ro.po index ffee45d..ab57569 100644 ---- a/policycoreutils-2.4/po/ro.po -+++ b/policycoreutils-2.4/po/ro.po +--- a/policycoreutils-2.5-rc1/po/ro.po ++++ b/policycoreutils-2.5-rc1/po/ro.po @@ -1,23 +1,21 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -505728,10 +505107,10 @@ index ffee45d..ab57569 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/ru.po b/policycoreutils-2.4/po/ru.po +diff --git a/policycoreutils-2.5-rc1/po/ru.po b/policycoreutils-2.5-rc1/po/ru.po index 96987b6..ae78654 100644 ---- a/policycoreutils-2.4/po/ru.po -+++ b/policycoreutils-2.4/po/ru.po +--- a/policycoreutils-2.5-rc1/po/ru.po ++++ b/policycoreutils-2.5-rc1/po/ru.po @@ -1,39 +1,35 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -512134,10 +511513,10 @@ index 96987b6..ae78654 100644 -#~ msgid "GTK Not Available" -#~ msgstr "GTK отсутствует" +msgstr "Диалог потери данных" -diff --git a/policycoreutils-2.4/po/ru_RU.po b/policycoreutils-2.4/po/ru_RU.po +diff --git a/policycoreutils-2.5-rc1/po/ru_RU.po b/policycoreutils-2.5-rc1/po/ru_RU.po index bb2790e..baa74c7 100644 ---- a/policycoreutils-2.4/po/ru_RU.po -+++ b/policycoreutils-2.4/po/ru_RU.po +--- a/policycoreutils-2.5-rc1/po/ru_RU.po ++++ b/policycoreutils-2.5-rc1/po/ru_RU.po @@ -1,23 +1,21 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -517400,10 +516779,10 @@ index bb2790e..baa74c7 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/si.po b/policycoreutils-2.4/po/si.po +diff --git a/policycoreutils-2.5-rc1/po/si.po b/policycoreutils-2.5-rc1/po/si.po index 34a766f..8cb8d33 100644 ---- a/policycoreutils-2.4/po/si.po -+++ b/policycoreutils-2.4/po/si.po +--- a/policycoreutils-2.5-rc1/po/si.po ++++ b/policycoreutils-2.5-rc1/po/si.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -522663,10 +522042,10 @@ index 34a766f..8cb8d33 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/sk.po b/policycoreutils-2.4/po/sk.po +diff --git a/policycoreutils-2.5-rc1/po/sk.po b/policycoreutils-2.5-rc1/po/sk.po index 9888086..300adb6 100644 ---- a/policycoreutils-2.4/po/sk.po -+++ b/policycoreutils-2.4/po/sk.po +--- a/policycoreutils-2.5-rc1/po/sk.po ++++ b/policycoreutils-2.5-rc1/po/sk.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -527991,10 +527370,10 @@ index 9888086..300adb6 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/sl.po b/policycoreutils-2.4/po/sl.po +diff --git a/policycoreutils-2.5-rc1/po/sl.po b/policycoreutils-2.5-rc1/po/sl.po index 31807dd..a412f83 100644 ---- a/policycoreutils-2.4/po/sl.po -+++ b/policycoreutils-2.4/po/sl.po +--- a/policycoreutils-2.5-rc1/po/sl.po ++++ b/policycoreutils-2.5-rc1/po/sl.po @@ -1,23 +1,21 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -533256,10 +532635,10 @@ index 31807dd..a412f83 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/sq.po b/policycoreutils-2.4/po/sq.po +diff --git a/policycoreutils-2.5-rc1/po/sq.po b/policycoreutils-2.5-rc1/po/sq.po index 21c15f0..8068f8a 100644 ---- a/policycoreutils-2.4/po/sq.po -+++ b/policycoreutils-2.4/po/sq.po +--- a/policycoreutils-2.5-rc1/po/sq.po ++++ b/policycoreutils-2.5-rc1/po/sq.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -538518,10 +537897,10 @@ index 21c15f0..8068f8a 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/sr.po b/policycoreutils-2.4/po/sr.po +diff --git a/policycoreutils-2.5-rc1/po/sr.po b/policycoreutils-2.5-rc1/po/sr.po index b7d900e..495ec6e 100644 ---- a/policycoreutils-2.4/po/sr.po -+++ b/policycoreutils-2.4/po/sr.po +--- a/policycoreutils-2.5-rc1/po/sr.po ++++ b/policycoreutils-2.5-rc1/po/sr.po @@ -1,7 +1,7 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -543905,10 +543284,10 @@ index b7d900e..495ec6e 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/sr@latin.po b/policycoreutils-2.4/po/sr@latin.po +diff --git a/policycoreutils-2.5-rc1/po/sr@latin.po b/policycoreutils-2.5-rc1/po/sr@latin.po index 93b28d4..279c927 100644 ---- a/policycoreutils-2.4/po/sr@latin.po -+++ b/policycoreutils-2.4/po/sr@latin.po +--- a/policycoreutils-2.5-rc1/po/sr@latin.po ++++ b/policycoreutils-2.5-rc1/po/sr@latin.po @@ -1,7 +1,7 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -549293,10 +548672,10 @@ index 93b28d4..279c927 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/sv.po b/policycoreutils-2.4/po/sv.po +diff --git a/policycoreutils-2.5-rc1/po/sv.po b/policycoreutils-2.5-rc1/po/sv.po index fddabf4..af7cbd0 100644 ---- a/policycoreutils-2.4/po/sv.po -+++ b/policycoreutils-2.4/po/sv.po +--- a/policycoreutils-2.5-rc1/po/sv.po ++++ b/policycoreutils-2.5-rc1/po/sv.po @@ -1,7 +1,7 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -555414,10 +554793,10 @@ index fddabf4..af7cbd0 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/ta.po b/policycoreutils-2.4/po/ta.po +diff --git a/policycoreutils-2.5-rc1/po/ta.po b/policycoreutils-2.5-rc1/po/ta.po index 9f91a5c..d8a1120 100644 ---- a/policycoreutils-2.4/po/ta.po -+++ b/policycoreutils-2.4/po/ta.po +--- a/policycoreutils-2.5-rc1/po/ta.po ++++ b/policycoreutils-2.5-rc1/po/ta.po @@ -1,25 +1,26 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -561877,10 +561256,10 @@ index 9f91a5c..d8a1120 100644 -#~ msgid "GTK Not Available" -#~ msgstr "GTK கிடைக்கவில்லை" +msgstr "தரவு இழப்பு உரையாடல்" -diff --git a/policycoreutils-2.4/po/ta_IN.po b/policycoreutils-2.4/po/ta_IN.po +diff --git a/policycoreutils-2.5-rc1/po/ta_IN.po b/policycoreutils-2.5-rc1/po/ta_IN.po index 0a1c5a4..7a62b7c 100644 ---- a/policycoreutils-2.4/po/ta_IN.po -+++ b/policycoreutils-2.4/po/ta_IN.po +--- a/policycoreutils-2.5-rc1/po/ta_IN.po ++++ b/policycoreutils-2.5-rc1/po/ta_IN.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -567140,10 +566519,10 @@ index 0a1c5a4..7a62b7c 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/te.po b/policycoreutils-2.4/po/te.po +diff --git a/policycoreutils-2.5-rc1/po/te.po b/policycoreutils-2.5-rc1/po/te.po index 91321c3..b33cbbe 100644 ---- a/policycoreutils-2.4/po/te.po -+++ b/policycoreutils-2.4/po/te.po +--- a/policycoreutils-2.5-rc1/po/te.po ++++ b/policycoreutils-2.5-rc1/po/te.po @@ -1,24 +1,24 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -573243,10 +572622,10 @@ index 91321c3..b33cbbe 100644 msgid "Loss of data Dialog" -msgstr "" +msgstr "కోల్పోయిన దత్తాంశం డైలాగ్" -diff --git a/policycoreutils-2.4/po/tg.po b/policycoreutils-2.4/po/tg.po +diff --git a/policycoreutils-2.5-rc1/po/tg.po b/policycoreutils-2.5-rc1/po/tg.po index c67e7eb..7581529 100644 ---- a/policycoreutils-2.4/po/tg.po -+++ b/policycoreutils-2.4/po/tg.po +--- a/policycoreutils-2.5-rc1/po/tg.po ++++ b/policycoreutils-2.5-rc1/po/tg.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -578506,10 +577885,10 @@ index c67e7eb..7581529 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/th.po b/policycoreutils-2.4/po/th.po +diff --git a/policycoreutils-2.5-rc1/po/th.po b/policycoreutils-2.5-rc1/po/th.po index faa7475..046e370 100644 ---- a/policycoreutils-2.4/po/th.po -+++ b/policycoreutils-2.4/po/th.po +--- a/policycoreutils-2.5-rc1/po/th.po ++++ b/policycoreutils-2.5-rc1/po/th.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -583769,10 +583148,10 @@ index faa7475..046e370 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/tl.po b/policycoreutils-2.4/po/tl.po +diff --git a/policycoreutils-2.5-rc1/po/tl.po b/policycoreutils-2.5-rc1/po/tl.po index 3332653..ab0a8a6 100644 ---- a/policycoreutils-2.4/po/tl.po -+++ b/policycoreutils-2.4/po/tl.po +--- a/policycoreutils-2.5-rc1/po/tl.po ++++ b/policycoreutils-2.5-rc1/po/tl.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -589032,10 +588411,10 @@ index 3332653..ab0a8a6 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/tr.po b/policycoreutils-2.4/po/tr.po +diff --git a/policycoreutils-2.5-rc1/po/tr.po b/policycoreutils-2.5-rc1/po/tr.po index 269e42c..491fb66 100644 ---- a/policycoreutils-2.4/po/tr.po -+++ b/policycoreutils-2.4/po/tr.po +--- a/policycoreutils-2.5-rc1/po/tr.po ++++ b/policycoreutils-2.5-rc1/po/tr.po @@ -1,22 +1,21 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -594301,10 +593680,10 @@ index 269e42c..491fb66 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/uk.po b/policycoreutils-2.4/po/uk.po +diff --git a/policycoreutils-2.5-rc1/po/uk.po b/policycoreutils-2.5-rc1/po/uk.po index 2938d05..70623e6 100644 ---- a/policycoreutils-2.4/po/uk.po -+++ b/policycoreutils-2.4/po/uk.po +--- a/policycoreutils-2.5-rc1/po/uk.po ++++ b/policycoreutils-2.5-rc1/po/uk.po @@ -1,33 +1,29 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -600869,10 +600248,10 @@ index 2938d05..70623e6 100644 -#~ msgid "GTK Not Available" -#~ msgstr "Бібліотеки GTK недоступні" +msgstr "Діалогове вікно втрати даних" -diff --git a/policycoreutils-2.4/po/uk_UA.po b/policycoreutils-2.4/po/uk_UA.po +diff --git a/policycoreutils-2.5-rc1/po/uk_UA.po b/policycoreutils-2.5-rc1/po/uk_UA.po index 2204420..60e9c81 100644 ---- a/policycoreutils-2.4/po/uk_UA.po -+++ b/policycoreutils-2.4/po/uk_UA.po +--- a/policycoreutils-2.5-rc1/po/uk_UA.po ++++ b/policycoreutils-2.5-rc1/po/uk_UA.po @@ -1,23 +1,21 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -606135,10 +605514,10 @@ index 2204420..60e9c81 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/ur.po b/policycoreutils-2.4/po/ur.po +diff --git a/policycoreutils-2.5-rc1/po/ur.po b/policycoreutils-2.5-rc1/po/ur.po index 0ede3e6..5c5a5b0 100644 ---- a/policycoreutils-2.4/po/ur.po -+++ b/policycoreutils-2.4/po/ur.po +--- a/policycoreutils-2.5-rc1/po/ur.po ++++ b/policycoreutils-2.5-rc1/po/ur.po @@ -1,20 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -611397,11 +610776,11 @@ index 0ede3e6..5c5a5b0 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/uz.po b/policycoreutils-2.4/po/uz.po +diff --git a/policycoreutils-2.5-rc1/po/uz.po b/policycoreutils-2.5-rc1/po/uz.po new file mode 100644 index 0000000..4b0e16e --- /dev/null -+++ b/policycoreutils-2.4/po/uz.po ++++ b/policycoreutils-2.5-rc1/po/uz.po @@ -0,0 +1,5198 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -616601,10 +615980,10 @@ index 0000000..4b0e16e +#: ../sepolicy/sepolicy/gui.py:2777 +msgid "Loss of data Dialog" +msgstr "" -diff --git a/policycoreutils-2.4/po/vi.po b/policycoreutils-2.4/po/vi.po +diff --git a/policycoreutils-2.5-rc1/po/vi.po b/policycoreutils-2.5-rc1/po/vi.po index fa87a1d..c742212 100644 ---- a/policycoreutils-2.4/po/vi.po -+++ b/policycoreutils-2.4/po/vi.po +--- a/policycoreutils-2.5-rc1/po/vi.po ++++ b/policycoreutils-2.5-rc1/po/vi.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -621863,10 +621242,10 @@ index fa87a1d..c742212 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/wo.po b/policycoreutils-2.4/po/wo.po +diff --git a/policycoreutils-2.5-rc1/po/wo.po b/policycoreutils-2.5-rc1/po/wo.po index 8713a24..027cdb7 100644 ---- a/policycoreutils-2.4/po/wo.po -+++ b/policycoreutils-2.4/po/wo.po +--- a/policycoreutils-2.5-rc1/po/wo.po ++++ b/policycoreutils-2.5-rc1/po/wo.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -627126,10 +626505,10 @@ index 8713a24..027cdb7 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/xh.po b/policycoreutils-2.4/po/xh.po +diff --git a/policycoreutils-2.5-rc1/po/xh.po b/policycoreutils-2.5-rc1/po/xh.po index e199788..1be6b53 100644 ---- a/policycoreutils-2.4/po/xh.po -+++ b/policycoreutils-2.4/po/xh.po +--- a/policycoreutils-2.5-rc1/po/xh.po ++++ b/policycoreutils-2.5-rc1/po/xh.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -632389,10 +631768,10 @@ index e199788..1be6b53 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/zh_CN.po b/policycoreutils-2.4/po/zh_CN.po +diff --git a/policycoreutils-2.5-rc1/po/zh_CN.po b/policycoreutils-2.5-rc1/po/zh_CN.po index 03946d3..6b3b476 100644 ---- a/policycoreutils-2.4/po/zh_CN.po -+++ b/policycoreutils-2.4/po/zh_CN.po +--- a/policycoreutils-2.5-rc1/po/zh_CN.po ++++ b/policycoreutils-2.5-rc1/po/zh_CN.po @@ -1,25 +1,25 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -638310,10 +637689,10 @@ index 03946d3..6b3b476 100644 msgid "Loss of data Dialog" -msgstr "" +msgstr "丢失数据对话" -diff --git a/policycoreutils-2.4/po/zh_HK.po b/policycoreutils-2.4/po/zh_HK.po +diff --git a/policycoreutils-2.5-rc1/po/zh_HK.po b/policycoreutils-2.5-rc1/po/zh_HK.po index dc7dae8..63b7e5c 100644 ---- a/policycoreutils-2.4/po/zh_HK.po -+++ b/policycoreutils-2.4/po/zh_HK.po +--- a/policycoreutils-2.5-rc1/po/zh_HK.po ++++ b/policycoreutils-2.5-rc1/po/zh_HK.po @@ -1,20 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -643571,10 +642950,10 @@ index dc7dae8..63b7e5c 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/po/zh_TW.po b/policycoreutils-2.4/po/zh_TW.po +diff --git a/policycoreutils-2.5-rc1/po/zh_TW.po b/policycoreutils-2.5-rc1/po/zh_TW.po index 9f84d79..9cc8fce 100644 ---- a/policycoreutils-2.4/po/zh_TW.po -+++ b/policycoreutils-2.4/po/zh_TW.po +--- a/policycoreutils-2.5-rc1/po/zh_TW.po ++++ b/policycoreutils-2.5-rc1/po/zh_TW.po @@ -1,24 +1,24 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -649586,10 +648965,10 @@ index 9f84d79..9cc8fce 100644 msgid "Loss of data Dialog" -msgstr "" +msgstr "資料遺失對話方塊" -diff --git a/policycoreutils-2.4/po/zu.po b/policycoreutils-2.4/po/zu.po +diff --git a/policycoreutils-2.5-rc1/po/zu.po b/policycoreutils-2.5-rc1/po/zu.po index b306041..16eb50b 100644 ---- a/policycoreutils-2.4/po/zu.po -+++ b/policycoreutils-2.4/po/zu.po +--- a/policycoreutils-2.5-rc1/po/zu.po ++++ b/policycoreutils-2.5-rc1/po/zu.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER @@ -654849,150 +654228,64 @@ index b306041..16eb50b 100644 +#: ../sepolicy/sepolicy/gui.py:2777 msgid "Loss of data Dialog" msgstr "" -diff --git a/policycoreutils-2.4/sandbox/sandbox b/policycoreutils-2.4/sandbox/sandbox -index 3678c5d..163afa0 100644 ---- a/policycoreutils-2.4/sandbox/sandbox -+++ b/policycoreutils-2.4/sandbox/sandbox -@@ -1,4 +1,4 @@ --#! /usr/bin/python -Es -+#! /usr/bin/python3 -Es - # Authors: Dan Walsh - # Authors: Thomas Liu - # Authors: Josh Cogliati -@@ -25,7 +25,6 @@ import selinux - import signal - from tempfile import mkdtemp - import pwd --import commands - import sepolicy +diff --git a/policycoreutils-2.5-rc1/sandbox/sandbox b/policycoreutils-2.5-rc1/sandbox/sandbox +index 9e0024f..eae8f20 100644 +--- a/policycoreutils-2.5-rc1/sandbox/sandbox ++++ b/policycoreutils-2.5-rc1/sandbox/sandbox +@@ -108,30 +108,25 @@ def copyfile(file, srcdir, dest): - PROGNAME = "policycoreutils" -@@ -36,13 +35,16 @@ gettext.bindtextdomain(PROGNAME, "/usr/share/locale") - gettext.textdomain(PROGNAME) - try: -- gettext.install(PROGNAME, -- localedir = "/usr/share/locale", -- unicode=False, -- codeset = 'utf-8') -+ gettext.install(PROGNAME, -+ localedir = "/usr/share/locale", -+ codeset = 'utf-8') - except IOError: -- import __builtin__ -- __builtin__.__dict__['_'] = unicode -+ try: -+ import builtins -+ builtins.__dict__['_'] = str -+ except ImportError: -+ import __builtin__ -+ __builtin__.__dict__['_'] = unicode - - DEFAULT_WINDOWSIZE = "1000x700" - DEFAULT_TYPE = "sandbox_t" -@@ -86,7 +88,7 @@ def copyfile(file, srcdir, dest): - else: - shutil.copy2(file, dest) - -- except shutil.Error, elist: -+ except shutil.Error as elist: - for e in elist.message: - sys.stderr.write(e[2]) - -@@ -95,19 +97,23 @@ def copyfile(file, srcdir, dest): def savefile(new, orig, X_ind): - copy = False - if(X_ind): -- import gtk -- dlg = gtk.MessageDialog(None, 0, gtk.MESSAGE_INFO, -- gtk.BUTTONS_YES_NO, +- copy = False +- if(X_ind): +- import gtk +- dlg = gtk.MessageDialog(None, 0, gtk.MESSAGE_INFO, +- gtk.BUTTONS_YES_NO, +- _("Do you want to save changes to '%s' (Y/N): ") % orig) +- dlg.set_title(_("Sandbox Message")) +- dlg.set_position(gtk.WIN_POS_MOUSE) +- dlg.show_all() +- rc = dlg.run() +- dlg.destroy() +- if rc == gtk.RESPONSE_YES: +- copy = True +- else: +- try: +- input = raw_input +- except NameError: +- pass +- ans = input(_("Do you want to save changes to '%s' (y/N): ") % orig) +- if(re.match(_("[yY]"), ans)): +- copy = True +- if(copy): +- shutil.copy2(new, orig) +- ++ copy = False ++ if(X_ind): + from gi.repository import Gtk + dlg = Gtk.MessageDialog(None, 0, Gtk.MessageType.INFO, + Gtk.ButtonsType.YES_NO, - _("Do you want to save changes to '%s' (Y/N): ") % orig) - dlg.set_title(_("Sandbox Message")) -- dlg.set_position(gtk.WIN_POS_MOUSE) ++ _("Do you want to save changes to '%s' (Y/N): ") % orig) ++ dlg.set_title(_("Sandbox Message")) + dlg.set_position(Gtk.WindowPosition.MOUSE) - dlg.show_all() - rc = dlg.run() - dlg.destroy() -- if rc == gtk.RESPONSE_YES: ++ dlg.show_all() ++ rc = dlg.run() ++ dlg.destroy() + if rc == Gtk.ResponseType.YES: - copy = True - else: -- ans = raw_input(_("Do you want to save changes to '%s' (y/N): ") % orig) -+ try: -+ input = raw_input -+ except NameError: -+ pass -+ ans = input(_("Do you want to save changes to '%s' (y/N): ") % orig) - if(re.match(_("[yY]"),ans)): - copy = True - if(copy): -@@ -228,9 +234,9 @@ class Sandbox: - for i in fd.readlines(): - try: - self.__include(option, opt, i[:-1], parser) -- except IOError, e: -+ except IOError as e: - sys.stderr.write(str(e)) -- except TypeError, e: -+ except TypeError as e: - sys.stderr.write(str(e)) - fd.close() ++ copy = True ++ else: ++ ans = raw_input(_("Do you want to save changes to '%s' (y/N): ") % orig) ++ if(re.match(_("[yY]"),ans)): ++ copy = True ++ if(copy): ++ shutil.copy2(new,orig) -@@ -263,7 +269,7 @@ dbus-launch --exit-with-session %s - kill -TERM $WM_PID 2> /dev/null - """ % (command, wm, command)) - fd.close() -- os.chmod(execfile, 0700) -+ os.chmod(execfile, 0o700) - - def usage(self, message = ""): - error_exit("%s\n%s" % (self.__parser.usage, message)) -@@ -400,9 +406,6 @@ sandbox [-h] [-l level ] [-[X|M] [-H homedir] [-T tempdir]] [-I includefile ] [- - self.__execcon = "%s:%s:%s:%s" % (con[0], con[1], self.setype, level) - self.__filecon = "%s:object_r:sandbox_file_t:%s" % (con[0], level) - def __setup_dir(self): -- if self.__options.level or self.__options.session: -- return -- - if self.__options.homedir: - selinux.chcon(self.__options.homedir, self.__filecon, recursive=True) - self.__homedir = self.__options.homedir -@@ -431,8 +434,8 @@ sandbox [-h] [-l level ] [-[X|M] [-H homedir] [-T tempdir]] [-I includefile ] [- - if self.__options.dpi: - dpi = self.__options.dpi - else: -- import gtk -- dpi = str(gtk.settings_get_default().props.gtk_xft_dpi/1024) -+ from gi.repository import Gtk -+ dpi = str(Gtk.Settings.get_default().props.gtk_xft_dpi/1024) - - xmodmapfile = self.__homedir + "/.xmodmap" - xd = open(xmodmapfile,"w") -@@ -492,13 +495,13 @@ if __name__ == '__main__': - try: - sandbox = Sandbox() - rc = sandbox.main() -- except OSError, error: -+ except OSError as error: - error_exit(error) -- except ValueError, error: -+ except ValueError as error: - error_exit(error.args[0]) -- except KeyError, error: -+ except KeyError as error: - error_exit(_("Invalid value %s") % error.args[0]) -- except IOError, error: -+ except IOError as error: - error_exit(error) - except KeyboardInterrupt: - rc = 0 -diff --git a/policycoreutils-2.4/sandbox/sandboxX.sh b/policycoreutils-2.4/sandbox/sandboxX.sh + def reserve(level): + sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) +diff --git a/policycoreutils-2.5-rc1/sandbox/sandboxX.sh b/policycoreutils-2.5-rc1/sandbox/sandboxX.sh index eaa500d..4774528 100644 ---- a/policycoreutils-2.4/sandbox/sandboxX.sh -+++ b/policycoreutils-2.4/sandbox/sandboxX.sh +--- a/policycoreutils-2.5-rc1/sandbox/sandboxX.sh ++++ b/policycoreutils-2.5-rc1/sandbox/sandboxX.sh @@ -20,7 +20,7 @@ cat > ~/.config/openbox/rc.xml << EOF EOF @@ -655002,282 +654295,25 @@ index eaa500d..4774528 100644 export DISPLAY=:$D cat > ~/seremote << __EOF #!/bin/sh -diff --git a/policycoreutils-2.4/sandbox/start b/policycoreutils-2.4/sandbox/start -index 52950d7..8766420 100644 ---- a/policycoreutils-2.4/sandbox/start -+++ b/policycoreutils-2.4/sandbox/start -@@ -1,9 +1,9 @@ --#! /usr/bin/python -Es --import gtk, commands, sys -+#! /usr/bin/python3 -Es +diff --git a/policycoreutils-2.5-rc1/sandbox/start b/policycoreutils-2.5-rc1/sandbox/start +index fc406e1..e0a0c2c 100644 +--- a/policycoreutils-2.5-rc1/sandbox/start ++++ b/policycoreutils-2.5-rc1/sandbox/start +@@ -1,8 +1,6 @@ + #! /usr/bin/python -Es +-import gtk +-import subprocess +-import sys +-rc = [-1, ''] +import subprocess, sys - rc = [-1,''] ++rc = [-1,''] try: -- rc=commands.getstatusoutput(sys.argv[1]) -+ rc=subprocess.getstatusoutput(sys.argv[1]) + rc = subprocess.getstatusoutput(sys.argv[1]) except: - pass - if rc[0] == 0: -- print rc[1] -+ print(rc[1]) -diff --git a/policycoreutils-2.4/sandbox/test_sandbox.py b/policycoreutils-2.4/sandbox/test_sandbox.py -index b3b7f64..d765cb4 100644 ---- a/policycoreutils-2.4/sandbox/test_sandbox.py -+++ b/policycoreutils-2.4/sandbox/test_sandbox.py -@@ -4,18 +4,18 @@ from subprocess import Popen, PIPE - - class SandboxTests(unittest.TestCase): - def assertDenied(self, err): -- self.assert_('Permission denied' in err, -+ self.assertTrue(b'Permission denied' in err, - '"Permission denied" not found in %r' % err) - def assertNotFound(self, err): -- self.assert_('not found' in err, -+ self.assertTrue(b'not found' in err, - '"not found" not found in %r' % err) - - def assertFailure(self, status): -- self.assert_(status != 0, -+ self.assertTrue(status != 0, - '"Succeeded when it should have failed') - - def assertSuccess(self, status, err): -- self.assert_(status == 0, -+ self.assertTrue(status == 0, - '"Sandbox should have succeeded for this test %r' % err) - - def test_simple_success(self): -@@ -23,7 +23,7 @@ class SandboxTests(unittest.TestCase): - p1 = Popen(['cat', '/etc/passwd'], stdout = PIPE) - p2 = Popen(['sandbox', 'grep', 'root'], stdin = p1.stdout, stdout=PIPE) - out, err = p2.communicate() -- self.assert_('root' in out) -+ self.assertTrue(b'root' in out) - - def test_cant_kill(self): - "Verify that we cannot send kill signal in the sandbox" -@@ -95,4 +95,4 @@ if __name__ == "__main__": - if selinux.security_getenforce() == 1: - unittest.main() - else: -- print "SELinux must be in enforcing mode for this test" -+ print("SELinux must be in enforcing mode for this test") -diff --git a/policycoreutils-2.4/scripts/chcat b/policycoreutils-2.4/scripts/chcat -index 9efcb22..d61af9d 100755 ---- a/policycoreutils-2.4/scripts/chcat -+++ b/policycoreutils-2.4/scripts/chcat -@@ -1,4 +1,4 @@ --#! /usr/bin/python -Es -+#! /usr/bin/python3 -Es - # Copyright (C) 2005 Red Hat - # see file 'COPYING' for use and warranty information - # -@@ -22,15 +22,19 @@ - # 02111-1307 USA - # - # --import commands, sys, os, pwd, string, getopt, selinux -+import subprocess, sys, os, pwd, string, getopt, selinux - import seobject - import gettext - - try: - gettext.install('policycoreutils') - except IOError: -- import __builtin__ -- __builtin__.__dict__['_'] = unicode -+ try: -+ import builtins -+ builtins.__dict__['_'] = str -+ except ImportError: -+ import __builtin__ -+ __builtin__.__dict__['_'] = unicode - - def errorExit(error): - sys.stderr.write("%s: " % sys.argv[0]) -@@ -80,9 +84,9 @@ def chcat_user_add(newcat, users): - cmd = "semanage login -a -r %s -s %s %s" % (new_serange, user[0], u) - else: - cmd = "semanage login -m -r %s -s %s %s" % (new_serange, user[0], u) -- rc = commands.getstatusoutput(cmd) -+ rc = subprocess.getstatusoutput(cmd) - if rc[0] != 0: -- print rc[1] -+ print(rc[1]) - errors += 1 - - return errors -@@ -107,7 +111,7 @@ def chcat_add(orig, newcat, objects,login_ind): - - if len(clist) > 1: - if cat in clist[1:]: -- print _("%s is already in %s") % (f, orig) -+ print(_("%s is already in %s") % (f, orig)) - continue - clist.append(cat) - cats = clist[1:] -@@ -118,9 +122,9 @@ def chcat_add(orig, newcat, objects,login_ind): - else: - cat_string = cat - cmd = 'chcon -l %s:%s %s' % (sensitivity, cat_string, f) -- rc = commands.getstatusoutput(cmd) -+ rc = subprocess.getstatusoutput(cmd) - if rc[0] != 0: -- print rc[1] -+ print(rc[1]) - errors += 1 - return errors - -@@ -158,9 +162,9 @@ def chcat_user_remove(newcat, users): - cmd = "semanage login -a -r %s -s %s %s" % (new_serange, user[0], u) - else: - cmd = "semanage login -m -r %s -s %s %s" % (new_serange, user[0], u) -- rc = commands.getstatusoutput(cmd) -+ rc = subprocess.getstatusoutput(cmd) - if rc[0] != 0: -- print rc[1] -+ print(rc[1]) - errors += 1 - return errors - -@@ -185,7 +189,7 @@ def chcat_remove(orig, newcat, objects, login_ind): - - if len(clist) > 1: - if cat not in clist[1:]: -- print _("%s is not in %s") % (f, orig) -+ print(_("%s is not in %s") % (f, orig)) - continue - clist.remove(cat) - if len(clist) > 1: -@@ -195,16 +199,16 @@ def chcat_remove(orig, newcat, objects, login_ind): - else: - cat = "" - else: -- print _("%s is not in %s") % (f, orig) -+ print(_("%s is not in %s") % (f, orig)) - continue - - if len(cat) == 0: - cmd = 'chcon -l %s %s' % (sensitivity, f) - else: - cmd = 'chcon -l %s:%s %s' % (sensitivity,cat, f) -- rc = commands.getstatusoutput(cmd) -+ rc = subprocess.getstatusoutput(cmd) - if rc[0] != 0: -- print rc[1] -+ print(rc[1]) - errors += 1 - return errors - -@@ -229,9 +233,9 @@ def chcat_user_replace(newcat, users): - cmd = "semanage login -a -r %s -s %s %s" % (new_serange, user[0], u) - else: - cmd = "semanage login -m -r %s -s %s %s" % (new_serange, user[0], u) -- rc = commands.getstatusoutput(cmd) -+ rc = subprocess.getstatusoutput(cmd) - if rc[0] != 0: -- print rc[1] -+ print(rc[1]) - errors += 1 - return errors - -@@ -251,9 +255,9 @@ def chcat_replace(newcat, objects, login_ind): - for f in objects: - cmd = "%s %s" % (cmd, f) - -- rc = commands.getstatusoutput(cmd) -+ rc = subprocess.getstatusoutput(cmd) - if rc[0] != 0: -- print rc[1] -+ print(rc[1]) - errors += 1 - - return errors -@@ -322,18 +326,18 @@ def translate(cats): - return newcat - - def usage(): -- print _("Usage %s CATEGORY File ...") % sys.argv[0] -- print _("Usage %s -l CATEGORY user ...") % sys.argv[0] -- print _("Usage %s [[+|-]CATEGORY],...]q File ...") % sys.argv[0] -- print _("Usage %s -l [[+|-]CATEGORY],...]q user ...") % sys.argv[0] -- print _("Usage %s -d File ...") % sys.argv[0] -- print _("Usage %s -l -d user ...") % sys.argv[0] -- print _("Usage %s -L") % sys.argv[0] -- print _("Usage %s -L -l user") % sys.argv[0] -- print _("Use -- to end option list. For example") -- print _("chcat -- -CompanyConfidential /docs/businessplan.odt") -- print _("chcat -l +CompanyConfidential juser") -- sys.exit(1) -+ print(_("Usage %s CATEGORY File ...") % sys.argv[0]) -+ print(_("Usage %s -l CATEGORY user ...") % sys.argv[0]) -+ print(_("Usage %s [[+|-]CATEGORY],...]q File ...") % sys.argv[0]) -+ print(_("Usage %s -l [[+|-]CATEGORY],...]q user ...") % sys.argv[0]) -+ print(_("Usage %s -d File ...") % sys.argv[0]) -+ print(_("Usage %s -l -d user ...") % sys.argv[0]) -+ print(_("Usage %s -L") % sys.argv[0]) -+ print(_("Usage %s -L -l user") % sys.argv[0]) -+ print(_("Use -- to end option list. For example")) -+ print(_("chcat -- -CompanyConfidential /docs/businessplan.odt")) -+ print(_("chcat -l +CompanyConfidential juser")) -+ sys.exit(1) - - def listcats(): - fd = open(selinux.selinux_translations_path()) -@@ -342,7 +346,7 @@ def listcats(): - continue - if l.find("=") != -1: - rec = l.split("=") -- print "%-30s %s" % tuple(rec) -+ print("%-30s %s" % tuple(rec)) - fd.close() - return 0 - -@@ -356,12 +360,12 @@ def listusercats(users): - cats = seobject.translate(selinux.getseuserbyname(u)[2]) - cats = cats.split("-") - if len(cats) > 1 and cats[1] != "s0": -- print "%s: %s" % (u, cats[1]) -+ print("%s: %s" % (u, cats[1])) - else: -- print "%s: %s" % (u, cats[0]) -+ print("%s: %s" % (u, cats[0])) - - def error(msg): -- print "%s: %s" % (sys.argv[0], msg) -+ print("%s: %s" % (sys.argv[0], msg)) - sys.exit(1) - - if __name__ == '__main__': -@@ -395,10 +399,10 @@ if __name__ == '__main__': - if list_ind == 0 and len(cmds) < 1: - usage() - -- except getopt.error, error: -+ except getopt.error as error: - errorExit(_("Options Error %s ") % error.msg) - -- except ValueError, e: -+ except ValueError as e: - usage() - - if delete_ind: -@@ -433,9 +437,9 @@ if __name__ == '__main__': - if len(c) > 0 and c[0] == "-": - errors += chcat_remove(c[1:],translate(l), objects, login_ind) - continue -- except ValueError, e: -+ except ValueError as e: - error(e) -- except OSError, e: -+ except OSError as e: - error(e) - - sys.exit(errors) -diff --git a/policycoreutils-2.4/scripts/fixfiles b/policycoreutils-2.4/scripts/fixfiles +diff --git a/policycoreutils-2.5-rc1/scripts/fixfiles b/policycoreutils-2.5-rc1/scripts/fixfiles index 5c29eb9..db53c0b 100755 ---- a/policycoreutils-2.4/scripts/fixfiles -+++ b/policycoreutils-2.4/scripts/fixfiles +--- a/policycoreutils-2.5-rc1/scripts/fixfiles ++++ b/policycoreutils-2.5-rc1/scripts/fixfiles @@ -116,6 +116,7 @@ exclude_dirs() { fullFlag=0 BOOTTIME="" @@ -655316,10 +654352,10 @@ index 5c29eb9..db53c0b 100755 UNDEFINED=`get_undefined_type` || exit $? UNLABELED=`get_unlabeled_type` || exit $? -diff --git a/policycoreutils-2.4/semanage/Makefile b/policycoreutils-2.4/semanage/Makefile +diff --git a/policycoreutils-2.5-rc1/semanage/Makefile b/policycoreutils-2.5-rc1/semanage/Makefile index 60c36a3..84b01a1 100644 ---- a/policycoreutils-2.4/semanage/Makefile -+++ b/policycoreutils-2.4/semanage/Makefile +--- a/policycoreutils-2.5-rc1/semanage/Makefile ++++ b/policycoreutils-2.5-rc1/semanage/Makefile @@ -20,8 +20,7 @@ install: all -mkdir -p $(SBINDIR) install -m 755 semanage $(SBINDIR) @@ -655330,11 +654366,11 @@ index 60c36a3..84b01a1 100644 -mkdir -p $(BASHCOMPLETIONDIR) install -m 644 $(BASHCOMPLETIONS) $(BASHCOMPLETIONDIR)/semanage -diff --git a/policycoreutils-2.4/semanage/default_encoding/Makefile b/policycoreutils-2.4/semanage/default_encoding/Makefile +diff --git a/policycoreutils-2.5-rc1/semanage/default_encoding/Makefile b/policycoreutils-2.5-rc1/semanage/default_encoding/Makefile new file mode 100644 index 0000000..e15a877 --- /dev/null -+++ b/policycoreutils-2.4/semanage/default_encoding/Makefile ++++ b/policycoreutils-2.5-rc1/semanage/default_encoding/Makefile @@ -0,0 +1,8 @@ +all: + LDFLAGS="" python setup.py build @@ -655344,11 +654380,11 @@ index 0000000..e15a877 + +clean: + rm -rf build *~ -diff --git a/policycoreutils-2.4/semanage/default_encoding/default_encoding.c b/policycoreutils-2.4/semanage/default_encoding/default_encoding.c +diff --git a/policycoreutils-2.5-rc1/semanage/default_encoding/default_encoding.c b/policycoreutils-2.5-rc1/semanage/default_encoding/default_encoding.c new file mode 100644 index 0000000..023b8f4 --- /dev/null -+++ b/policycoreutils-2.4/semanage/default_encoding/default_encoding.c ++++ b/policycoreutils-2.5-rc1/semanage/default_encoding/default_encoding.c @@ -0,0 +1,57 @@ +/* + * Authors: @@ -655407,11 +654443,11 @@ index 0000000..023b8f4 + PyUnicode_SetDefaultEncoding("utf-8"); + Py_InitModule3("default_encoding_utf8", methods, "Forces the default encoding to utf-8"); +} -diff --git a/policycoreutils-2.4/semanage/default_encoding/policycoreutils/__init__.py b/policycoreutils-2.4/semanage/default_encoding/policycoreutils/__init__.py +diff --git a/policycoreutils-2.5-rc1/semanage/default_encoding/policycoreutils/__init__.py b/policycoreutils-2.5-rc1/semanage/default_encoding/policycoreutils/__init__.py new file mode 100644 index 0000000..ccb6b8b --- /dev/null -+++ b/policycoreutils-2.4/semanage/default_encoding/policycoreutils/__init__.py ++++ b/policycoreutils-2.5-rc1/semanage/default_encoding/policycoreutils/__init__.py @@ -0,0 +1,17 @@ +# +# Copyright (C) 2006,2007,2008, 2009 Red Hat, Inc. @@ -655430,11 +654466,11 @@ index 0000000..ccb6b8b +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# -diff --git a/policycoreutils-2.4/semanage/default_encoding/setup.py b/policycoreutils-2.4/semanage/default_encoding/setup.py +diff --git a/policycoreutils-2.5-rc1/semanage/default_encoding/setup.py b/policycoreutils-2.5-rc1/semanage/default_encoding/setup.py new file mode 100644 index 0000000..e2befdb --- /dev/null -+++ b/policycoreutils-2.4/semanage/default_encoding/setup.py ++++ b/policycoreutils-2.5-rc1/semanage/default_encoding/setup.py @@ -0,0 +1,38 @@ +# Authors: +# John Dennis @@ -655474,23 +654510,11 @@ index 0000000..e2befdb + ext_modules = [default_encoding_utf8], + packages=["policycoreutils"], +) -diff --git a/policycoreutils-2.4/semanage/semanage b/policycoreutils-2.4/semanage/semanage -index dd63010..852fecf 100644 ---- a/policycoreutils-2.4/semanage/semanage -+++ b/policycoreutils-2.4/semanage/semanage -@@ -1,4 +1,4 @@ --#! /usr/bin/python -Es -+#! /usr/bin/python3 -Es - # Copyright (C) 2012-2013 Red Hat - # AUTHOR: Miroslav Grepl - # AUTHOR: David Quigley -@@ -18,24 +18,38 @@ - # - # You should have received a copy of the GNU General Public License - # along with this program; if not, write to the Free Software --# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - # 02111-1307 USA +diff --git a/policycoreutils-2.5-rc1/semanage/semanage b/policycoreutils-2.5-rc1/semanage/semanage +index 7489955..88a3ff1 100644 +--- a/policycoreutils-2.5-rc1/semanage/semanage ++++ b/policycoreutils-2.5-rc1/semanage/semanage +@@ -23,6 +23,11 @@ # # @@ -655502,72 +654526,8 @@ index dd63010..852fecf 100644 import argparse import seobject import sys - import gettext - PROGNAME="policycoreutils" -+gettext.bindtextdomain(PROGNAME, "/usr/share/locale") -+gettext.textdomain(PROGNAME) - try: -- gettext.install(PROGNAME, -- localedir="/usr/share/locale", -- unicode=True, -- codeset = 'utf-8') -+ kwargs = {} -+ if sys.version_info < (3,): -+ kwargs['unicode'] = True -+ gettext.install(PROGNAME, -+ localedir="/usr/share/locale", -+ codeset = 'utf-8', -+ **kwargs) - except IOError: -- import __builtin__ -- __builtin__.__dict__['_'] = unicode -+ try: -+ import builtins -+ builtins.__dict__['_'] = str -+ except ImportError: -+ import __builtin__ -+ __builtin__.__dict__['_'] = unicode - - # define custom usages for selected main actions - usage_login = "semanage login [-h] [-n] [-N] [-s STORE] [" -@@ -61,16 +75,16 @@ usage_boolean_dict = {' --modify':('(','--on','|','--off',')','boolean'), ' --li - - import sepolicy - class CheckRole(argparse.Action): -- def __call__(self, parser, namespace, value, option_string=None): -- newval = getattr(namespace, self.dest) -- if not newval: -- newval = [] -- roles = sepolicy.get_all_roles() -- for v in value.split(): -- if v not in roles: -- raise ValueError("%s must be an SELinux role:\nValid roles: %s" % (v, ", ".join(roles))) -- newval.append(v) -- setattr(namespace, self.dest, newval) -+ def __call__(self, parser, namespace, value, option_string=None): -+ newval = getattr(namespace, self.dest) -+ if not newval: -+ newval = [] -+ roles = sepolicy.get_all_roles() -+ for v in value.split(): -+ if v not in roles: -+ raise ValueError("%s must be an SELinux role:\nValid roles: %s" % (v, ", ".join(roles))) -+ newval.append(v) -+ setattr(namespace, self.dest, newval) - - store = '' - class SetStore(argparse.Action): -@@ -103,7 +117,7 @@ class SetImportFile(argparse.Action): - if values and values is not "-": - try: - sys.stdin = open(values, 'r') -- except IOError,e: -+ except IOError as e: - sys.stderr.write("%s: %s\n" % (e.__class__.__name__, str(e))) - sys.exit(1) - setattr(namespace, self.dest, values) -@@ -155,7 +169,7 @@ object_dict = {'login':login_ini, 'user':user_ini, 'port':port_ini, 'module':mod - def generate_custom_usage(usage_text,usage_dict): +@@ -186,7 +191,7 @@ object_dict = {'login': login_ini, 'user': user_ini, 'port': port_ini, 'module': + def generate_custom_usage(usage_text, usage_dict): # generate custom usage from given text and dictonary sorted_keys = [] - for i in usage_dict.keys(): @@ -655575,7 +654535,7 @@ index dd63010..852fecf 100644 sorted_keys.append(i) sorted_keys.sort() for k in sorted_keys: -@@ -170,18 +184,18 @@ def handle_opts(args,dict,target_key): +@@ -202,7 +207,7 @@ def handle_opts(args, dict, target_key): # {action:[conflict_opts,require_opts]} # first we need to catch conflicts @@ -655583,243 +654543,29 @@ index dd63010..852fecf 100644 + for k in list(args.__dict__.keys()): try: if k in dict[target_key][0] and args.__dict__[k]: -- print("%s option can not be used with --%s" % (target_key,k)) -+ print(("%s option can not be used with --%s" % (target_key,k))) - sys.exit(2) + print("%s option can not be used with --%s" % (target_key, k)) +@@ -210,7 +215,7 @@ def handle_opts(args, dict, target_key): except KeyError: continue - for k in args.__dict__.keys(): + for k in list(args.__dict__.keys()): try: - if k in dict[target_key][1] and not args.__dict__[k]: -- print("%s option is needed for %s" % (k,target_key)) -+ print(("%s option is needed for %s" % (k,target_key))) - sys.exit(2) - except KeyError: - continue -@@ -207,7 +221,7 @@ def handleLogin(args): - OBJECT.deleteall() - if args.action is "extract": - for i in OBJECT.customized(): -- print "login %s" % (str(i)) -+ print("login %s" % (str(i))) + if k in dict[target_key][1] and not args.__dict__[k]: + print("%s option is needed for %s" % (k, target_key)) +@@ -894,6 +899,8 @@ def make_io_args(args): - def parser_add_store(parser, name): - parser.add_argument('-S', '--store', action=SetStore, help=_("Select an alternate SELinux Policy Store to manage")) -@@ -292,7 +306,7 @@ def handleFcontext(args): - fcontext_equal_args = {'equal':[('list','locallist','type','ftype','seuser','deleteall','extract'),()]} - - if args.action is None: -- print("usage: "+"%s" % generate_custom_usage(usage_fcontext, usage_fcontext_dict)) -+ print(("usage: "+"%s" % generate_custom_usage(usage_fcontext, usage_fcontext_dict))) - sys.exit(2) - elif args.action and args.equal: - handle_opts(args, fcontext_equal_args, "equal") -@@ -323,7 +337,7 @@ def handleFcontext(args): - OBJECT.deleteall() - if args.action is "extract": - for i in OBJECT.customized(): -- print "fcontext %s" % str(i) -+ print("fcontext %s" % str(i)) - - def setupFcontextParser(subparsers): - ftype_help = ''' -@@ -381,7 +395,7 @@ def handleUser(args): - OBJECT.deleteall() - if args.action is "extract": - for i in OBJECT.customized(): -- print "user %s" % str(i) -+ print("user %s" % str(i)) - - def setupUserParser(subparsers): - generated_usage = generate_custom_usage(usage_user, usage_user_dict) -@@ -430,7 +444,7 @@ def handlePort(args): - OBJECT.deleteall() - if args.action is "extract": - for i in OBJECT.customized(): -- print "port %s" % str(i) -+ print("port %s" % str(i)) - - def setupPortParser(subparsers): - generated_usage = generate_custom_usage(usage_port, usage_port_dict) -@@ -473,7 +487,7 @@ def handleInterface(args): - OBJECT.deleteall() - if args.action is "extract": - for i in OBJECT.customized(): -- print "interface %s" % str(i) -+ print("interface %s" % str(i)) - - def setupInterfaceParser(subparsers): - generated_usage = generate_custom_usage(usage_interface, usage_interface_dict) -@@ -512,7 +526,7 @@ def handleModule(args): - OBJECT.list(args.noheading, args.locallist) - if args.action is "extract": - for i in OBJECT.customized(): -- print "module %s" % str(i) -+ print("module %s" % str(i)) - - def setupModuleParser(subparsers): - moduleParser = subparsers.add_parser('module', help=_('Manage SELinux policy modules')) -@@ -552,7 +566,7 @@ def handleNode(args): - OBJECT.deleteall() - if args.action is "extract": - for i in OBJECT.customized(): -- print "node %s" % str(i) -+ print("node %s" % str(i)) - - def setupNodeParser(subparsers): - generated_usage = generate_custom_usage(usage_node, usage_node_dict) -@@ -580,14 +594,14 @@ def setupNodeParser(subparsers): - def handleBoolean(args): - boolean_args = {'list':[('state','boolean'),('')],'modify':[('localist'),('')], 'extract':[('locallist','state','boolean'),('')],'deleteall':[('locallist'),('')],'state':[('locallist','list','extract','deleteall'),('modify')]} - if args.action is None: -- print("Usage: "+"%s" % generate_custom_usage(usage_boolean, usage_boolean_dict)) -+ print(("Usage: "+"%s" % generate_custom_usage(usage_boolean, usage_boolean_dict))) - sys.exit(2) - # TODO: should be added to handle_opts logic - elif args.action is "modify" and not args.boolean: -- print "boolean name required " -+ print("boolean name required ") - sys.exit(1) - elif args.action is "modify" and args.boolean and not args.state: -- print "state option is needed" -+ print("state option is needed") - sys.exit(1) - else: - handle_opts(args,boolean_args,args.action) -@@ -604,7 +618,7 @@ def handleBoolean(args): - OBJECT.deleteall() - if args.action is "extract": - for i in OBJECT.customized(): -- print "boolean %s" % str(i) -+ print("boolean %s" % str(i)) - - def setupBooleanParser(subparsers): - generated_usage = generate_custom_usage(usage_boolean, usage_boolean_dict) -@@ -632,12 +646,17 @@ def handlePermissive(args): - OBJECT = object_dict['permissive']() - OBJECT.set_reload(args.noreload) - -- if args.action is "add": -- OBJECT.add(args.type) - if args.action is "list": - OBJECT.list(args.noheading) -- if args.action is "delete": -- OBJECT.delete(args.type) -+ elif args.type != None: -+ if args.action is "add": -+ OBJECT.add(args.type) -+ if args.action is "delete": -+ OBJECT.delete(args.type) -+ else: -+ args.parser.print_usage(sys.stderr) -+ sys.stderr.write(_('semanage permissive: error: the following argument is required: type\n')) -+ sys.exit(1) - - def setupPermissiveParser(subparsers): - permissiveParser = subparsers.add_parser('permissive', help=_('Manage process type enforcement mode')) -@@ -654,6 +673,7 @@ def setupPermissiveParser(subparsers): - parser_add_store(permissiveParser, "permissive") - permissiveParser.add_argument('type', nargs='?', default=None, help=_('type')) - permissiveParser.set_defaults(func=handlePermissive) -+ permissiveParser.set_defaults(parser=permissiveParser) - - def handleDontaudit(args): - OBJECT = object_dict['dontaudit']() -@@ -670,11 +690,11 @@ def setupDontauditParser(subparsers): - def handleExport(args): - manageditems=[ "boolean", "login", "interface", "user", "port", "node", "fcontext", "module"] - for i in manageditems: -- print "%s -D" % i -+ print("%s -D" % i) - for i in manageditems: - OBJECT = object_dict[i]() - for c in OBJECT.customized(): -- print "%s %s" % (i, str(c)) -+ print("%s %s" % (i, str(c))) - - sys.exit(0) - -@@ -743,10 +763,10 @@ def handleImport(args): - commandParser = createCommandParser() - args = commandParser.parse_args(mkargv(l)) - args.func(args) -- except ValueError,e: -+ except ValueError as e: - sys.stderr.write("%s: %s\n" % (e.__class__.__name__, str(e))) - sys.exit(1) -- except IOError,e: -+ except IOError as e: - sys.stderr.write("%s: %s\n" % (e.__class__.__name__, str(e))) - sys.exit(1) - except KeyboardInterrupt: -@@ -764,11 +784,11 @@ def setupImportParser(subparsers): - - def createCommandParser(): - commandParser = seParser(prog='semanage', -- formatter_class=argparse.ArgumentDefaultsHelpFormatter, -- description='''semanage is used to configure certain elements -- of SELinux policy with-out requiring modification -- to or recompilation from policy source.''') -- -+ formatter_class=argparse.ArgumentDefaultsHelpFormatter, -+ description='''semanage is used to configure certain elements -+ of SELinux policy with-out requiring modification -+ to or recompilation from policy source.''') -+ - #To add a new subcommand define the parser for it in a function above and call it here. - subparsers = commandParser.add_subparsers(dest='subcommand') - setupImportParser(subparsers) -@@ -788,7 +808,7 @@ def createCommandParser(): - - def make_io_args(args): - # import/export backward compability -- args_origin = ["-S", "-o", "-i", "targeted", "minumum", "mls"] -+ args_origin = ["-S", "-o", "-i", "targeted", "minimum", "mls"] - args_file = [] - args_ie = [] - args_subcommand = [] -@@ -808,6 +828,8 @@ def make_io_args(args): - return args_subcommand+args_ie+args_file def make_args(sys_args): + if len(sys_args) == 1: + return [ "-h" ] args = [] if "-o" in sys_args[1:] or "-i" in sys_args[1:]: - args=make_io_args(sys_args[1:]) -@@ -822,21 +844,21 @@ def do_parser(): - args = commandParser.parse_args(make_args(sys.argv)) - args.func(args) - sys.exit(0) -- except IOError,e: -+ except IOError as e: - sys.stderr.write("%s: %s\n" % (e.__class__.__name__, str(e))) - sys.exit(1) - except KeyboardInterrupt: - sys.exit(0) -- except ValueError, e: -+ except ValueError as e: - sys.stderr.write("%s: %s\n" % (e.__class__.__name__, e.args[0])) - sys.exit(1) -- except KeyError, e: -+ except KeyError as e: - sys.stderr.write("%s: %s\n" % (e.__class__.__name__, e.args[0])) - sys.exit(1) -- except OSError, e: -+ except OSError as e: - sys.stderr.write("%s: %s\n" % (e.__class__.__name__, e.args[1])) - sys.exit(1) -- except RuntimeError, e: -+ except RuntimeError as e: - sys.stderr.write("%s: %s\n" % (e.__class__.__name__, e.args[0])) - sys.exit(1) - -diff --git a/policycoreutils-2.4/semanage/semanage.8 b/policycoreutils-2.4/semanage/semanage.8 + args = make_io_args(sys_args[1:]) +diff --git a/policycoreutils-2.5-rc1/semanage/semanage.8 b/policycoreutils-2.5-rc1/semanage/semanage.8 index 0fad36c..75b782f 100644 ---- a/policycoreutils-2.4/semanage/semanage.8 -+++ b/policycoreutils-2.4/semanage/semanage.8 +--- a/policycoreutils-2.5-rc1/semanage/semanage.8 ++++ b/policycoreutils-2.5-rc1/semanage/semanage.8 @@ -8,7 +8,7 @@ semanage \- SELinux Policy Management tool .B positional arguments: @@ -655839,26 +654585,13 @@ index 0fad36c..75b782f 100644 mapping from Linux usernames (logins) to SELinux user identities, while the semanage user command deals with the mapping from SELinux user identities to authorized role sets. In most cases, only the -diff --git a/policycoreutils-2.4/semanage/seobject.py b/policycoreutils-2.4/semanage/seobject.py -index 568ebfd..306d9b7 100644 ---- a/policycoreutils-2.4/semanage/seobject.py -+++ b/policycoreutils-2.4/semanage/seobject.py -@@ -378,7 +378,7 @@ class moduleRecords(semanageRecords): - def deleteall(self): - l = map(lambda x: x[0], filter(lambda t: t[1] == 0, self.get_all())) - for m in l: -- self.enable(m) -+ self.set_enabled(m, True) - - class dontauditClass(semanageRecords): - def __init__(self, store): -diff --git a/policycoreutils-2.4/semanage/seobject/__init__.py b/policycoreutils-2.4/semanage/seobject/__init__.py +diff --git a/policycoreutils-2.5-rc1/semanage/seobject/__init__.py b/policycoreutils-2.5-rc1/semanage/seobject/__init__.py new file mode 100644 -index 0000000..33f5fa9 +index 0000000..4308d04 --- /dev/null -+++ b/policycoreutils-2.4/semanage/seobject/__init__.py ++++ b/policycoreutils-2.5-rc1/semanage/seobject/__init__.py @@ -0,0 +1,2271 @@ -+#! /usr/bin/python3 -Es ++#! /usr/bin/python -Es +# Copyright (C) 2005-2013 Red Hat +# see file 'COPYING' for use and warranty information +# @@ -658129,11 +656862,11 @@ index 0000000..33f5fa9 + for k in keys: + if ddict[k]: + print("%-30s (%-5s,%5s) %s" % (k, on_off[selinux.security_get_boolean_active(k)], on_off[ddict[k][2]], self.get_desc(k))) -diff --git a/policycoreutils-2.4/semanage/setup.py b/policycoreutils-2.4/semanage/setup.py +diff --git a/policycoreutils-2.5-rc1/semanage/setup.py b/policycoreutils-2.5-rc1/semanage/setup.py new file mode 100644 index 0000000..7735c59 --- /dev/null -+++ b/policycoreutils-2.4/semanage/setup.py ++++ b/policycoreutils-2.5-rc1/semanage/setup.py @@ -0,0 +1,35 @@ +# Authors: +# Dan Walsh @@ -658170,50 +656903,10 @@ index 0000000..7735c59 + download_url = '', + packages=["seobject"], +) -diff --git a/policycoreutils-2.4/semanage/test-semanage.py b/policycoreutils-2.4/semanage/test-semanage.py -index d39013e..e7bd92c 100644 ---- a/policycoreutils-2.4/semanage/test-semanage.py -+++ b/policycoreutils-2.4/semanage/test-semanage.py -@@ -9,18 +9,18 @@ object_list = [ 'login', 'user', 'port', 'module', 'interface', 'node', 'fcontex - class SemanageTests(unittest.TestCase): - def assertDenied(self, err): - self.assertTrue('Permission denied' in err, -- '"Permission denied" not found in %r' % err) -+ '"Permission denied" not found in %r' % err) - def assertNotFound(self, err): - self.assertTrue('not found' in err, -- '"not found" not found in %r' % err) -+ '"not found" not found in %r' % err) - - def assertFailure(self, status): - self.assertTrue(status != 0, -- '"semanage succeeded when it should have failed') -+ '"semanage succeeded when it should have failed') - - def assertSuccess(self, status, err): - self.assertTrue(status == 0, -- '"semanage should have succeeded for this test %r' % err) -+ '"semanage should have succeeded for this test %r' % err) - - def test_extract(self): - for object in object_list: -@@ -273,10 +273,10 @@ if __name__ == "__main__": - args = parser.parse_args() - args.func(args) - sys.exit(0) -- except ValueError,e: -+ except ValueError as e: - sys.stderr.write("%s: %s\n" % (e.__class__.__name__, str(e))) - sys.exit(1) -- except IOError,e: -+ except IOError as e: - sys.stderr.write("%s: %s\n" % (e.__class__.__name__, str(e))) - sys.exit(1) - except KeyboardInterrupt: -diff --git a/policycoreutils-2.4/sepolicy/common.h b/policycoreutils-2.4/sepolicy/common.h +diff --git a/policycoreutils-2.5-rc1/sepolicy/common.h b/policycoreutils-2.5-rc1/sepolicy/common.h index dc3ce6a..3b93845 100644 ---- a/policycoreutils-2.4/sepolicy/common.h -+++ b/policycoreutils-2.4/sepolicy/common.h +--- a/policycoreutils-2.5-rc1/sepolicy/common.h ++++ b/policycoreutils-2.5-rc1/sepolicy/common.h @@ -9,12 +9,18 @@ # define UNUSED(x) x #endif @@ -658248,10 +656941,10 @@ index dc3ce6a..3b93845 100644 } - - -diff --git a/policycoreutils-2.4/sepolicy/info.c b/policycoreutils-2.4/sepolicy/info.c +diff --git a/policycoreutils-2.5-rc1/sepolicy/info.c b/policycoreutils-2.5-rc1/sepolicy/info.c index 17f5732..52fd680 100644 ---- a/policycoreutils-2.4/sepolicy/info.c -+++ b/policycoreutils-2.4/sepolicy/info.c +--- a/policycoreutils-2.5-rc1/sepolicy/info.c ++++ b/policycoreutils-2.5-rc1/sepolicy/info.c @@ -1,12 +1,14 @@ /** * @file @@ -658473,10 +657166,10 @@ index 17f5732..52fd680 100644 return info(type, name); } -diff --git a/policycoreutils-2.4/sepolicy/org.selinux.conf b/policycoreutils-2.4/sepolicy/org.selinux.conf +diff --git a/policycoreutils-2.5-rc1/sepolicy/org.selinux.conf b/policycoreutils-2.5-rc1/sepolicy/org.selinux.conf index a350978..1ae079d 100644 ---- a/policycoreutils-2.4/sepolicy/org.selinux.conf -+++ b/policycoreutils-2.4/sepolicy/org.selinux.conf +--- a/policycoreutils-2.5-rc1/sepolicy/org.selinux.conf ++++ b/policycoreutils-2.5-rc1/sepolicy/org.selinux.conf @@ -12,12 +12,8 @@ @@ -663654,10 +660066,10 @@ index 1275c7f..83822dd 100644 fill True -diff --git a/policycoreutils-2.4/sepolicy/sepolicy/templates/executable.py b/policycoreutils-2.4/sepolicy/sepolicy/templates/executable.py +diff --git a/policycoreutils-2.5-rc1/sepolicy/sepolicy/templates/executable.py b/policycoreutils-2.5-rc1/sepolicy/sepolicy/templates/executable.py index 4b9534d..f267993 100644 ---- a/policycoreutils-2.4/sepolicy/sepolicy/templates/executable.py -+++ b/policycoreutils-2.4/sepolicy/sepolicy/templates/executable.py +--- a/policycoreutils-2.5-rc1/sepolicy/sepolicy/templates/executable.py ++++ b/policycoreutils-2.5-rc1/sepolicy/sepolicy/templates/executable.py @@ -86,6 +86,7 @@ roleattribute system_r TEMPLATETYPE_roles; type TEMPLATETYPE_t; type TEMPLATETYPE_exec_t; @@ -663715,10 +660127,10 @@ index 4b9534d..f267993 100644 """ if_initscript_admin_types=""" -diff --git a/policycoreutils-2.4/sepolicy/sepolicy/templates/spec.py b/policycoreutils-2.4/sepolicy/sepolicy/templates/spec.py +diff --git a/policycoreutils-2.5-rc1/sepolicy/sepolicy/templates/spec.py b/policycoreutils-2.5-rc1/sepolicy/sepolicy/templates/spec.py index 16a2208..d8ee42f 100644 ---- a/policycoreutils-2.4/sepolicy/sepolicy/templates/spec.py -+++ b/policycoreutils-2.4/sepolicy/sepolicy/templates/spec.py +--- a/policycoreutils-2.5-rc1/sepolicy/sepolicy/templates/spec.py ++++ b/policycoreutils-2.5-rc1/sepolicy/sepolicy/templates/spec.py @@ -39,7 +39,7 @@ install -m 644 %{SOURCE1} %{buildroot}%{_datadir}/selinux/devel/include/contrib/ install -d %{buildroot}%{_mandir}/man8/ install -m 644 %{SOURCE2} %{buildroot}%{_mandir}/man8/DOMAINNAME_selinux.8 @@ -663737,10 +660149,10 @@ index 16a2208..d8ee42f 100644 %changelog * TODAYSDATE YOUR NAME 1.0-1 -diff --git a/policycoreutils-2.4/sepolicy/sepolicy/templates/test_module.py b/policycoreutils-2.4/sepolicy/sepolicy/templates/test_module.py +diff --git a/policycoreutils-2.5-rc1/sepolicy/sepolicy/templates/test_module.py b/policycoreutils-2.5-rc1/sepolicy/sepolicy/templates/test_module.py index 893a204..3a3faa6 100644 ---- a/policycoreutils-2.4/sepolicy/sepolicy/templates/test_module.py -+++ b/policycoreutils-2.4/sepolicy/sepolicy/templates/test_module.py +--- a/policycoreutils-2.5-rc1/sepolicy/sepolicy/templates/test_module.py ++++ b/policycoreutils-2.5-rc1/sepolicy/sepolicy/templates/test_module.py @@ -111,7 +111,7 @@ role sepolicy_r; role sepolicy_source_r; role sepolicy_target_r; @@ -663750,51 +660162,42 @@ index 893a204..3a3faa6 100644 # # Local policy # -diff --git a/policycoreutils-2.4/sepolicy/sepolicy/transition.py b/policycoreutils-2.4/sepolicy/sepolicy/transition.py -index 11834c7..bb5517e 100755 ---- a/policycoreutils-2.4/sepolicy/sepolicy/transition.py -+++ b/policycoreutils-2.4/sepolicy/sepolicy/transition.py -@@ -1,4 +1,4 @@ --#! /usr/bin/python -Es -+#! /usr/bin/python3 -Es - # Copyright (C) 2011 Red Hat - # see file 'COPYING' for use and warranty information - # -@@ -78,4 +78,4 @@ class setrans: +diff --git a/policycoreutils-2.5-rc1/sepolicy/sepolicy/transition.py b/policycoreutils-2.5-rc1/sepolicy/sepolicy/transition.py +index 15b0eb1..a8edb69 100755 +--- a/policycoreutils-2.5-rc1/sepolicy/sepolicy/transition.py ++++ b/policycoreutils-2.5-rc1/sepolicy/sepolicy/transition.py +@@ -81,4 +81,4 @@ class setrans: def output(self): self.seen = [] - print self.out(self.source) + print(self.out(self.source)) -diff --git a/policycoreutils-2.4/sepolicy/setup.py b/policycoreutils-2.4/sepolicy/setup.py -index d8e2d64..cac667c 100644 ---- a/policycoreutils-2.4/sepolicy/setup.py -+++ b/policycoreutils-2.4/sepolicy/setup.py +diff --git a/policycoreutils-2.5-rc1/sepolicy/setup.py b/policycoreutils-2.5-rc1/sepolicy/setup.py +index e74e68d..096ce1f 100644 +--- a/policycoreutils-2.5-rc1/sepolicy/setup.py ++++ b/policycoreutils-2.5-rc1/sepolicy/setup.py @@ -4,7 +4,7 @@ # Author: Dan Walsh import os from distutils.core import setup, Extension --policy = Extension("sepolicy._policy", -+policy = Extension("sepolicy.policy", +-policy = Extension("sepolicy._policy", ++policy = Extension("sepolicy.policy", libraries=["apol", "qpol"], - sources=[ "policy.c", "info.c", "search.c"] - ) -diff --git a/policycoreutils-2.4/sepolicy/test_sepolicy.py b/policycoreutils-2.4/sepolicy/test_sepolicy.py -index aef799f..5ded03d 100644 ---- a/policycoreutils-2.4/sepolicy/test_sepolicy.py -+++ b/policycoreutils-2.4/sepolicy/test_sepolicy.py -@@ -1,28 +1,28 @@ --import unittest, os, shutil -+import unittest, os, shutil - from tempfile import mkdtemp - from subprocess import Popen, PIPE - + sources=["policy.c", "info.c", "search.c"] + ) +diff --git a/policycoreutils-2.5-rc1/sepolicy/test_sepolicy.py b/policycoreutils-2.5-rc1/sepolicy/test_sepolicy.py +index e7bad44..9c8f21c 100644 +--- a/policycoreutils-2.5-rc1/sepolicy/test_sepolicy.py ++++ b/policycoreutils-2.5-rc1/sepolicy/test_sepolicy.py +@@ -8,26 +8,26 @@ from subprocess import Popen, PIPE class SepolicyTests(unittest.TestCase): + def assertDenied(self, err): - self.assert_('Permission denied' in err, - '"Permission denied" not found in %r' % err) + self.assertTrue('Permission denied' in err, + '"Permission denied" not found in %r' % err) + def assertNotFound(self, err): - self.assert_('not found' in err, - '"not found" not found in %r' % err) @@ -663809,29 +660212,29 @@ index aef799f..5ded03d 100644 def assertSuccess(self, status, err): - self.assert_(status == 0, -- '"sepolicy should have succeeded for this test %r' % err) +- '"sepolicy should have succeeded for this test %r' % err) + self.assertTrue(status == 0, -+ '"sepolicy should have succeeded for this test %r' % err) ++ '"sepolicy should have succeeded for this test %r' % err) def test_man_domain(self): "Verify sepolicy manpage -d works" - p = Popen(['sepolicy', 'manpage', '-d', 'httpd_t'], stdout = PIPE) + p = Popen(['sepolicy', 'manpage', '-d', 'httpd_t'], stdout=PIPE) out, err = p.communicate() - print out, err + print(out, err) self.assertSuccess(p.returncode, err) def test_man_all(self): -@@ -114,4 +114,4 @@ if __name__ == "__main__": +@@ -119,4 +119,4 @@ if __name__ == "__main__": if selinux.security_getenforce() == 1: unittest.main() else: - print "SELinux must be in enforcing mode for this test" + print("SELinux must be in enforcing mode for this test") -diff --git a/policycoreutils-2.4/setfiles/restore.c b/policycoreutils-2.4/setfiles/restore.c +diff --git a/policycoreutils-2.5-rc1/setfiles/restore.c b/policycoreutils-2.5-rc1/setfiles/restore.c index 2a7cfa3..95fba09 100644 ---- a/policycoreutils-2.4/setfiles/restore.c -+++ b/policycoreutils-2.4/setfiles/restore.c +--- a/policycoreutils-2.5-rc1/setfiles/restore.c ++++ b/policycoreutils-2.5-rc1/setfiles/restore.c @@ -160,6 +160,9 @@ static int restore(FTSENT *ftsent, int recurse) /* Get the current context of the file. */ ret = lgetfilecon_raw(ftsent->fts_accpath, &curcon); @@ -663870,37 +660273,11 @@ index 2a7cfa3..95fba09 100644 if (S_ISLNK(sb.st_mode)) { char path[PATH_MAX + 1]; -diff --git a/policycoreutils-2.4/setfiles/setfiles.c b/policycoreutils-2.4/setfiles/setfiles.c -index 86d3f28..e39b500 100644 ---- a/policycoreutils-2.4/setfiles/setfiles.c -+++ b/policycoreutils-2.4/setfiles/setfiles.c -@@ -153,6 +153,9 @@ int main(int argc, char **argv) - int recurse; /* Recursive descent. */ - const char *base; - int mass_relabel = 0, errors = 0; -+ const char *ropts = "e:f:hilno:pqrsvFRW0"; -+ const char *sopts = "c:de:f:hilno:pqr:svFR:W0"; -+ const char *opts; - - memset(&r_opts, 0, sizeof(r_opts)); - -@@ -196,6 +199,7 @@ int main(int argc, char **argv) - r_opts.add_assoc = 1; - r_opts.fts_flags = FTS_PHYSICAL | FTS_XDEV; - ctx_validate = 1; -+ opts = sopts; - } else { - /* - * restorecon: -@@ -215,6 +219,7 @@ int main(int argc, char **argv) - r_opts.add_assoc = 0; - r_opts.fts_flags = FTS_PHYSICAL; - ctx_validate = 0; -+ opts = ropts; - - /* restorecon only: silent exit if no SELinux. - Allows unconditional execution by scripts. */ -@@ -225,8 +230,13 @@ int main(int argc, char **argv) +diff --git a/policycoreutils-2.5-rc1/setfiles/setfiles.c b/policycoreutils-2.5-rc1/setfiles/setfiles.c +index 9ac3ebd..e39b500 100644 +--- a/policycoreutils-2.5-rc1/setfiles/setfiles.c ++++ b/policycoreutils-2.5-rc1/setfiles/setfiles.c +@@ -230,6 +230,11 @@ int main(int argc, char **argv) /* This must happen before getopt. */ r_opts.nfile = exclude_non_seclabel_mounts(); @@ -663910,31 +660287,8 @@ index 86d3f28..e39b500 100644 + opts = sopts; + /* Process any options. */ -- while ((opt = getopt(argc, argv, "c:de:f:hilno:pqrsvFRW0")) > 0) { -+ while ((opt = getopt(argc, argv, opts)) > 0) { + while ((opt = getopt(argc, argv, opts)) > 0) { switch (opt) { - case 'c': - { -@@ -315,18 +325,13 @@ int main(int argc, char **argv) - recurse = 1; - break; - } -- if (optind + 1 >= argc) { -- fprintf(stderr, "usage: %s -r rootpath\n", -- argv[0]); -- exit(-1); -- } - if (NULL != r_opts.rootpath) { - fprintf(stderr, - "%s: only one -r can be specified\n", - argv[0]); - exit(-1); - } -- set_rootpath(argv[optind++]); -+ set_rootpath(optarg); - break; - case 's': - use_input_file = 1; @@ -337,7 +342,7 @@ int main(int argc, char **argv) if (r_opts.progress) { fprintf(stderr, diff --git a/policycoreutils.spec b/policycoreutils.spec index ab6880f..3f8d053 100644 --- a/policycoreutils.spec +++ b/policycoreutils.spec @@ -1,24 +1,24 @@ %global libauditver 2.1.3-4 -%global libsepolver 2.4-1 -%global libsemanagever 2.4-1 -%global libselinuxver 2.4-1 -%global sepolgenver 1.2.2 +%global libsepolver 2.5-0 +%global libsemanagever 2.5-0 +%global libselinuxver 2.5-0 +%global sepolgenver 1.2.3 Summary: SELinux policy core utilities Name: policycoreutils -Version: 2.4 -Release: 20%{?dist} +Version: 2.5 +Release: 0.99.rc1.1%{?dist} License: GPLv2 Group: System Environment/Base # https://github.com/SELinuxProject/selinux/wiki/Releases -Source: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20150202/policycoreutils-2.4.tar.gz -Source1:https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20150202/sepolgen-1.2.2.tar.gz +Source: https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20160107/policycoreutils-2.5-rc1.tar.gz +Source1:https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20160107/sepolgen-1.2.3-rc1.tar.gz URL: http://www.selinuxproject.org Source2: policycoreutils_man_ru2.tar.bz2 Source3: system-config-selinux.png Source4: sepolicy-icons.tgz # use make-rhat-patches.sh to create following patches from https://github.com/fedora-selinux/selinux/ -# HEAD https://github.com/fedora-selinux/selinux/commit/3f154b2e8e2978ba65afbd224f4bbd64e2374a36 +# HEAD https://github.com/fedora-selinux/selinux/83082eb446cfcb052d9971a483830014e5257d92 Patch: policycoreutils-rhat.patch Patch1: sepolgen-rhat.patch Patch100: policycoreutils-fix-semanage-python3.patch @@ -29,7 +29,7 @@ Provides: /sbin/restorecon BuildRequires: pam-devel libcgroup-devel libsepol-static >= %{libsepolver} libsemanage-static >= %{libsemanagever} libselinux-devel >= %{libselinuxver} libcap-devel audit-libs-devel >= %{libauditver} gettext BuildRequires: desktop-file-utils dbus-devel dbus-glib-devel -BuildRequires: python-devel python3-devel setools-devel >= 3.3.7-14 +BuildRequires: python-devel python3-devel setools-devel >= 3.3.8-8.99 Requires: /bin/mount /bin/egrep /bin/awk /usr/bin/diff rpm /bin/sed Requires: libsepol >= %{libsepolver} coreutils libselinux-utils >= %{libselinuxver} @@ -53,19 +53,21 @@ to switch roles. # create selinux/ directory and extract %{SOURCE0} there %setup -q -c -n selinux %patch -p1 -b .policycoreutils-rhat -pushd policycoreutils-%{version} +pushd policycoreutils-2.5-rc1 %patch100 -p2 -b .semanage-python3 popd -cp %{SOURCE3} policycoreutils-%{version}/gui/ -tar -xvf %{SOURCE4} -C policycoreutils-%{version}/ +cp %{SOURCE3} policycoreutils-2.5-rc1/gui/ +tar -xvf %{SOURCE4} -C policycoreutils-2.5-rc1/ # extract {%SOURCE1} in selinux/ directory %setup -T -D -a 1 -n selinux %patch1 -p1 -b .sepolgen-rhat +grep -l -r -E '^#! */usr/bin/python' | xargs -n 1 sed -i 's/\(^#! *\/usr\/bin\/python\)/\13/g' + %build -make -C policycoreutils-%{version} LSPP_PRIV=y SBINDIR="%{_sbindir}" LIBDIR="%{_libdir}" CFLAGS="%{optflags} -fPIE" LDFLAGS="-pie -Wl,-z,relro -Wl,-z,now" SEMODULE_PATH="/usr/sbin" all -make -C sepolgen-%{sepolgenver} SBINDIR="%{_sbindir}" LSPP_PRIV=y LIBDIR="%{_libdir}" CFLAGS="%{optflags} -fPIE" LDFLAGS="-pie -Wl,-z,relro" all +make -C policycoreutils-2.5-rc1 LSPP_PRIV=y SBINDIR="%{_sbindir}" LIBDIR="%{_libdir}" CFLAGS="%{optflags} -fPIE" LDFLAGS="-pie -Wl,-z,relro -Wl,-z,now" SEMODULE_PATH="/usr/sbin" all +make -C sepolgen-1.2.3-rc1 SBINDIR="%{_sbindir}" LSPP_PRIV=y LIBDIR="%{_libdir}" CFLAGS="%{optflags} -fPIE" LDFLAGS="-pie -Wl,-z,relro" all %install mkdir -p %{buildroot}%{_bindir} @@ -75,14 +77,14 @@ mkdir -p %{buildroot}%{_mandir}/man5 mkdir -p %{buildroot}%{_mandir}/man8 %{__mkdir} -p %{buildroot}/%{_usr}/share/doc/%{name}/ -make -C policycoreutils-%{version} LSPP_PRIV=y DESTDIR="%{buildroot}" SBINDIR="%{buildroot}%{_sbindir}" LIBDIR="%{buildroot}%{_libdir}" SEMODULE_PATH="/usr/sbin" install -make -C policycoreutils-%{version} PYTHON=python3 LSPP_PRIV=y DESTDIR="%{buildroot}" SBINDIR="%{buildroot}%{_sbindir}" LIBDIR="%{buildroot}%{_libdir}" SEMODULE_PATH="/usr/sbin" install +make -C policycoreutils-2.5-rc1 LSPP_PRIV=y DESTDIR="%{buildroot}" SBINDIR="%{buildroot}%{_sbindir}" LIBDIR="%{buildroot}%{_libdir}" SEMODULE_PATH="/usr/sbin" install +make -C policycoreutils-2.5-rc1 PYTHON=python3 LSPP_PRIV=y DESTDIR="%{buildroot}" SBINDIR="%{buildroot}%{_sbindir}" LIBDIR="%{buildroot}%{_libdir}" SEMODULE_PATH="/usr/sbin" install # Systemd rm -rf %{buildroot}/%{_sysconfdir}/rc.d/init.d/restorecond -make -C sepolgen-%{sepolgenver} DESTDIR="%{buildroot}" SBINDIR="%{buildroot}%{_sbindir}" LIBDIR="%{buildroot}%{_libdir}" install -make -C sepolgen-%{sepolgenver} PYTHON=python3 DESTDIR="%{buildroot}" SBINDIR="%{buildroot}%{_sbindir}" LIBDIR="%{buildroot}%{_libdir}" install +make -C sepolgen-1.2.3-rc1 DESTDIR="%{buildroot}" SBINDIR="%{buildroot}%{_sbindir}" LIBDIR="%{buildroot}%{_libdir}" install +make -C sepolgen-1.2.3-rc1 PYTHON=python3 DESTDIR="%{buildroot}" SBINDIR="%{buildroot}%{_sbindir}" LIBDIR="%{buildroot}%{_libdir}" install tar -jxf %{SOURCE2} -C %{buildroot}/ rm -f %{buildroot}/usr/share/man/ru/man8/genhomedircon.8.gz @@ -371,7 +373,7 @@ fi %{_mandir}/ru/man1/secon.1* %{_mandir}/man8/genhomedircon.8* %{!?_licensedir:%global license %%doc} -%license policycoreutils-%{version}/COPYING +%license policycoreutils-2.5-rc1/COPYING %doc %{_usr}/share/doc/%{name} %package restorecond @@ -392,7 +394,7 @@ The policycoreutils-restorecond package contains the restorecond service. %{_mandir}/man8/restorecond.8* %{_mandir}/ru/man8/restorecond.8* %{!?_licensedir:%global license %%doc} -%license policycoreutils-%{version}/COPYING +%license policycoreutils-2.5-rc1/COPYING %post restorecond %systemd_post restorecond.service @@ -404,6 +406,9 @@ The policycoreutils-restorecond package contains the restorecond service. %systemd_postun_with_restart restorecond.service %changelog +* Fri Jan 08 2016 Petr Lautrbach 2.5-0.99.rc1.1 +- Update to upstream rc1 release 2016-01-07 + * Mon Dec 14 2015 Petr Lautrbach - 2.4-20 - Fix 'semanage permissive -l' subcommand (#1286325) - Several 'sepolicy gui' fixes (#1281309,#1281309,#1282382) diff --git a/sepolgen-rhat.patch b/sepolgen-rhat.patch index 356a1ff..da92805 100644 --- a/sepolgen-rhat.patch +++ b/sepolgen-rhat.patch @@ -1,51 +1,17 @@ -diff --git a/sepolgen-1.2.2/ChangeLog b/sepolgen-1.2.2/ChangeLog -index a304ab7..bec96bb 100644 ---- a/sepolgen-1.2.2/ChangeLog -+++ b/sepolgen-1.2.2/ChangeLog -@@ -1,3 +1,6 @@ -+ * Add support for python3, from Robert Kuska. -+ * Add device tree ocontext nodes to Xen policy, from Daniel De Graaf. -+ - 1.2.2 2015-02-02 - * Fix bugs found by hardened gcc flags, from Nicolas Iooss. - * Remove unnecessary grammar in interface call param list to fix poor -diff --git a/sepolgen-1.2.2/src/sepolgen/access.py b/sepolgen-1.2.2/src/sepolgen/access.py -index cf13210..60ff4e9 100644 ---- a/sepolgen-1.2.2/src/sepolgen/access.py -+++ b/sepolgen-1.2.2/src/sepolgen/access.py -@@ -31,7 +31,9 @@ and sets of that access (AccessVectorSet). These objects are used in Madison - in a variety of ways, but they are the fundamental representation of access. - """ - --import refpolicy -+from . import refpolicy -+from . import util -+ - from selinux import audit2why - - def is_idparam(id): -@@ -51,7 +53,7 @@ def is_idparam(id): - else: - return False - --class AccessVector: -+class AccessVector(util.Comparison): - """ - An access vector is the basic unit of access in SELinux. - -@@ -88,6 +90,11 @@ class AccessVector: +diff --git a/sepolgen-1.2.3-rc1/src/sepolgen/access.py b/sepolgen-1.2.3-rc1/src/sepolgen/access.py +index 1f89ecd..7623b3d 100644 +--- a/sepolgen-1.2.3-rc1/src/sepolgen/access.py ++++ b/sepolgen-1.2.3-rc1/src/sepolgen/access.py +@@ -90,6 +90,8 @@ class AccessVector(util.Comparison): self.audit_msgs = [] self.type = audit2why.TERULE self.data = [] + self.obj_path = None + self.base_type = None -+ # when implementing __eq__ also __hash__ is needed on py2 -+ # if object is muttable __hash__ should be None -+ self.__hash__ = None - - # The direction of the information flow represented by this - # access vector - used for matching -@@ -133,6 +140,11 @@ class AccessVector: + # when implementing __eq__ also __hash__ is needed on py2 + # if object is muttable __hash__ should be None + self.__hash__ = None +@@ -138,6 +140,29 @@ class AccessVector(util.Comparison): return "allow %s %s:%s %s;" % (self.src_type, self.tgt_type, self.obj_class, self.perms.to_space_str()) @@ -54,30 +20,28 @@ index cf13210..60ff4e9 100644 + base_type_array = [self.base_type, self.tgt_type, self.src_type] + return base_type_array + - def __cmp__(self, other): - if self.src_type != other.src_type: - return cmp(self.src_type, other.src_type) -@@ -151,6 +163,19 @@ class AccessVector: - return cmp(pa, pb) - return 0 - -+ def _compare(self, other, method): -+ try: -+ x = list(self.perms) -+ a = (self.src_type, self.tgt_type, self.obj_class, x) -+ y = list(other.perms) -+ x.sort() -+ y.sort() -+ b = (other.src_type, other.tgt_type, other.obj_class, y) -+ return method(a, b) -+ except (AttributeError, TypeError): -+ # trying to compare to foreign type -+ return NotImplemented ++ def __cmp__(self, other): ++ if self.src_type != other.src_type: ++ return cmp(self.src_type, other.src_type) ++ if self.tgt_type != other.tgt_type: ++ return cmp(self.tgt_type, other.tgt_type) ++ if self.obj_class != self.obj_class: ++ return cmp(self.obj_class, other.obj_class) ++ if len(self.perms) != len(other.perms): ++ return cmp(len(self.perms), len(other.perms)) ++ x = list(self.perms) ++ x.sort() ++ y = list(other.perms) ++ y.sort() ++ for pa, pb in zip(x, y): ++ if pa != pb: ++ return cmp(pa, pb) ++ return 0 + - def avrule_to_access_vectors(avrule): - """Convert an avrule into a list of access vectors. - -@@ -256,20 +281,23 @@ class AccessVectorSet: + def _compare(self, other, method): + try: + x = list(self.perms) +@@ -257,7 +282,8 @@ class AccessVectorSet: for av in l: self.add_av(AccessVector(av)) @@ -87,13 +51,7 @@ index cf13210..60ff4e9 100644 """Add an access vector to the set. """ tgt = self.src.setdefault(src_type, { }) - cls = tgt.setdefault(tgt_type, { }) - -- if cls.has_key((obj_class, avc_type)): -+ if (obj_class, avc_type) in cls: - access = cls[obj_class, avc_type] - else: - access = AccessVector() +@@ -270,7 +296,9 @@ class AccessVectorSet: access.src_type = src_type access.tgt_type = tgt_type access.obj_class = obj_class @@ -103,71 +61,11 @@ index cf13210..60ff4e9 100644 access.type = avc_type cls[obj_class, avc_type] = access -@@ -293,7 +321,7 @@ def avs_extract_types(avs): - def avs_extract_obj_perms(avs): - perms = { } - for av in avs: -- if perms.has_key(av.obj_class): -+ if av.obj_class in perms: - s = perms[av.obj_class] - else: - s = refpolicy.IdSet() -@@ -321,7 +349,7 @@ class RoleTypeSet: - return len(self.role_types.keys()) - - def add(self, role, type): -- if self.role_types.has_key(role): -+ if role in self.role_types: - role_type = self.role_types[role] - else: - role_type = refpolicy.RoleType() -diff --git a/sepolgen-1.2.2/src/sepolgen/audit.py b/sepolgen-1.2.2/src/sepolgen/audit.py -index 56919be..dad0724 100644 ---- a/sepolgen-1.2.2/src/sepolgen/audit.py -+++ b/sepolgen-1.2.2/src/sepolgen/audit.py -@@ -17,11 +17,12 @@ - # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - # - --import refpolicy --import access - import re - import sys - -+from . import refpolicy -+from . import access -+from . import util - # Convenience functions - - def get_audit_boot_msgs(): -@@ -42,6 +43,8 @@ def get_audit_boot_msgs(): - boottime = time.strftime("%X", s) - output = subprocess.Popen(["/sbin/ausearch", "-m", "AVC,USER_AVC,MAC_POLICY_LOAD,DAEMON_START,SELINUX_ERR", "-ts", bootdate, boottime], - stdout=subprocess.PIPE).communicate()[0] -+ if util.PY3: -+ output = util.decode_input(output) - return output - - def get_audit_msgs(): -@@ -55,6 +58,8 @@ def get_audit_msgs(): - import subprocess - output = subprocess.Popen(["/sbin/ausearch", "-m", "AVC,USER_AVC,MAC_POLICY_LOAD,DAEMON_START,SELINUX_ERR"], - stdout=subprocess.PIPE).communicate()[0] -+ if util.PY3: -+ output = util.decode_input(output) - return output - - def get_dmesg_msgs(): -@@ -66,6 +71,8 @@ def get_dmesg_msgs(): - import subprocess - output = subprocess.Popen(["/bin/dmesg"], - stdout=subprocess.PIPE).communicate()[0] -+ if util.PY3: -+ output = util.decode_input(output) - return output - - # Classes representing audit messages -@@ -169,6 +176,7 @@ class AVCMessage(AuditMessage): +diff --git a/sepolgen-1.2.3-rc1/src/sepolgen/audit.py b/sepolgen-1.2.3-rc1/src/sepolgen/audit.py +index 724d3ea..dad0724 100644 +--- a/sepolgen-1.2.3-rc1/src/sepolgen/audit.py ++++ b/sepolgen-1.2.3-rc1/src/sepolgen/audit.py +@@ -176,6 +176,7 @@ class AVCMessage(AuditMessage): self.exe = "" self.path = "" self.name = "" @@ -175,7 +73,7 @@ index 56919be..dad0724 100644 self.accesses = [] self.denial = True self.type = audit2why.TERULE -@@ -230,6 +238,10 @@ class AVCMessage(AuditMessage): +@@ -237,6 +238,10 @@ class AVCMessage(AuditMessage): self.exe = fields[1][1:-1] elif fields[0] == "name": self.name = fields[1][1:-1] @@ -186,7 +84,7 @@ index 56919be..dad0724 100644 if not found_src or not found_tgt or not found_class or not found_access: raise ValueError("AVC message in invalid format [%s]\n" % self.message) -@@ -354,7 +366,9 @@ class AuditParser: +@@ -361,7 +366,9 @@ class AuditParser: self.path_msgs = [] self.by_header = { } self.check_input_file = False @@ -197,16 +95,7 @@ index 56919be..dad0724 100644 # Low-level parsing function - tries to determine if this audit # message is an SELinux related message and then parses it into # the appropriate AuditMessage subclass. This function deliberately -@@ -430,7 +444,7 @@ class AuditParser: - - # Group by audit header - if msg.header != "": -- if self.by_header.has_key(msg.header): -+ if msg.header in self.by_header: - self.by_header[msg.header].append(msg) - else: - self.by_header[msg.header] = [msg] -@@ -492,6 +506,61 @@ class AuditParser: +@@ -499,6 +506,61 @@ class AuditParser: return role_types @@ -268,7 +157,7 @@ index 56919be..dad0724 100644 def to_access(self, avc_filter=None, only_denials=True): """Convert the audit logs access into a an access vector set. -@@ -510,16 +579,23 @@ class AuditParser: +@@ -517,16 +579,23 @@ class AuditParser: audit logs parsed by this object. """ av_set = access.AccessVectorSet() @@ -294,717 +183,11 @@ index 56919be..dad0724 100644 return av_set class AVCTypeFilter: -diff --git a/sepolgen-1.2.2/src/sepolgen/classperms.py b/sepolgen-1.2.2/src/sepolgen/classperms.py -index c925dee..f4fd899 100644 ---- a/sepolgen-1.2.2/src/sepolgen/classperms.py -+++ b/sepolgen-1.2.2/src/sepolgen/classperms.py -@@ -49,10 +49,10 @@ def t_NAME(t): - return t - - def t_error(t): -- print "Illegal character '%s'" % t.value[0] -+ print("Illegal character '%s'" % t.value[0]) - t.skip(1) - --import lex -+from . import lex - lex.lex() - - def p_statements(p): -@@ -90,9 +90,9 @@ def p_names(p): - p[0] = [p[1]] + p[2] - - def p_error(p): -- print "Syntax error on line %d %s [type=%s]" % (p.lineno, p.value, p.type) -+ print("Syntax error on line %d %s [type=%s]" % (p.lineno, p.value, p.type)) - --import yacc -+from . import yacc - yacc.yacc() - - -@@ -112,5 +112,5 @@ test2 = """define(`all_filesystem_perms',`{ mount remount unmount getattr relabe - define(`all_security_perms',`{ compute_av compute_create compute_member check_context load_policy compute_relabel compute_user setenforce setbool setsecparam setcheckreqprot }') - """ - result = yacc.parse(txt) --print result -+print(result) - -diff --git a/sepolgen-1.2.2/src/sepolgen/defaults.py b/sepolgen-1.2.2/src/sepolgen/defaults.py -index 218bc7c..9591063 100644 ---- a/sepolgen-1.2.2/src/sepolgen/defaults.py -+++ b/sepolgen-1.2.2/src/sepolgen/defaults.py -@@ -36,14 +36,14 @@ class PathChoooser(object): - if ignore.match(line): continue - mo = consider.match(line) - if not mo: -- raise ValueError, "%s:%d: line is not in key = value format" % (pathname, lineno+1) -+ raise ValueError("%s:%d: line is not in key = value format" % (pathname, lineno+1)) - self.config[mo.group(1)] = mo.group(2) - - # We're only exporting one useful function, so why not be a function - def __call__(self, testfilename, pathset="SELINUX_DEVEL_PATH"): - paths = self.config.get(pathset, None) - if paths is None: -- raise ValueError, "%s was not in %s" % (pathset, self.config_pathname) -+ raise ValueError("%s was not in %s" % (pathset, self.config_pathname)) - paths = paths.split(":") - for p in paths: - target = os.path.join(p, testfilename) -diff --git a/sepolgen-1.2.2/src/sepolgen/interfaces.py b/sepolgen-1.2.2/src/sepolgen/interfaces.py -index 88a6dc3..0b688bf 100644 ---- a/sepolgen-1.2.2/src/sepolgen/interfaces.py -+++ b/sepolgen-1.2.2/src/sepolgen/interfaces.py -@@ -21,15 +21,15 @@ - Classes for representing and manipulating interfaces. - """ - --import access --import refpolicy -+import copy - import itertools --import objectmodel --import matching - --from sepolgeni18n import _ -+from . import access -+from . import refpolicy -+from . import objectmodel -+from . import matching -+from .sepolgeni18n import _ - --import copy - - class Param: - """ -@@ -276,7 +276,7 @@ class InterfaceVector: - if attributes: - for typeattribute in interface.typeattributes(): - for attr in typeattribute.attributes: -- if not attributes.attributes.has_key(attr): -+ if attr not in attributes.attributes: - # print "missing attribute " + attr - continue - attr_vec = attributes.attributes[attr] -diff --git a/sepolgen-1.2.2/src/sepolgen/lex.py b/sepolgen-1.2.2/src/sepolgen/lex.py -index c149366..c13acef 100644 ---- a/sepolgen-1.2.2/src/sepolgen/lex.py -+++ b/sepolgen-1.2.2/src/sepolgen/lex.py -@@ -26,18 +26,21 @@ __version__ = "2.2" - - import re, sys, types - -+from . import util -+import collections -+ -+ - # Regular expression used to match valid token names - _is_identifier = re.compile(r'^[a-zA-Z0-9_]+$') - --# Available instance types. This is used when lexers are defined by a class. --# It's a little funky because I want to preserve backwards compatibility --# with Python 2.0 where types.ObjectType is undefined. -+# Available instance types. This is used when parsers are defined by a class. -+# In Python3 the InstanceType and ObjectType are no more, they've passed, ceased -+# to be, they are ex-classes along with old-style classes - - try: - _INSTANCETYPE = (types.InstanceType, types.ObjectType) - except AttributeError: -- _INSTANCETYPE = types.InstanceType -- class object: pass # Note: needed if no new-style classes present -+ _INSTANCETYPE = object - - # Exception thrown when invalid token encountered and no default error - # handler is defined. -@@ -172,7 +175,7 @@ class Lexer: - # readtab() - Read lexer information from a tab file - # ------------------------------------------------------------ - def readtab(self,tabfile,fdict): -- exec "import %s as lextab" % tabfile -+ exec("import %s as lextab" % tabfile) - self.lextokens = lextab._lextokens - self.lexreflags = lextab._lexreflags - self.lexliterals = lextab._lexliterals -@@ -197,8 +200,8 @@ class Lexer: - # input() - Push a new string into the lexer - # ------------------------------------------------------------ - def input(self,s): -- if not (isinstance(s,types.StringType) or isinstance(s,types.UnicodeType)): -- raise ValueError, "Expected a string" -+ if not (isinstance(s,util.bytes_type) or isinstance(s, util.string_type)): -+ raise ValueError("Expected a string") - self.lexdata = s - self.lexpos = 0 - self.lexlen = len(s) -@@ -207,8 +210,8 @@ class Lexer: - # begin() - Changes the lexing state - # ------------------------------------------------------------ - def begin(self,state): -- if not self.lexstatere.has_key(state): -- raise ValueError, "Undefined state" -+ if state not in self.lexstatere: -+ raise ValueError("Undefined state") - self.lexre = self.lexstatere[state] - self.lexretext = self.lexstateretext[state] - self.lexignore = self.lexstateignore.get(state,"") -@@ -286,7 +289,7 @@ class Lexer: - break - - # if func not callable, it means it's an ignored token -- if not callable(func): -+ if not isinstance(func, collections.Callable): - break - - # If token is processed by a function, call it -@@ -299,9 +302,9 @@ class Lexer: - - # Verify type of the token. If not in the token map, raise an error - if not self.lexoptimize: -- if not self.lextokens.has_key(newtok.type): -- raise LexError, ("%s:%d: Rule '%s' returned an unknown token type '%s'" % ( -- func.func_code.co_filename, func.func_code.co_firstlineno, -+ if newtok.type not in self.lextokens: -+ raise LexError("%s:%d: Rule '%s' returned an unknown token type '%s'" % ( -+ func.__code__.co_filename, func.__code__.co_firstlineno, - func.__name__, newtok.type),lexdata[lexpos:]) - - return newtok -@@ -329,17 +332,17 @@ class Lexer: - newtok = self.lexerrorf(tok) - if lexpos == self.lexpos: - # Error method didn't change text position at all. This is an error. -- raise LexError, ("Scanning error. Illegal character '%s'" % (lexdata[lexpos]), lexdata[lexpos:]) -+ raise LexError("Scanning error. Illegal character '%s'" % (lexdata[lexpos]), lexdata[lexpos:]) - lexpos = self.lexpos - if not newtok: continue - return newtok - - self.lexpos = lexpos -- raise LexError, ("Illegal character '%s' at index %d" % (lexdata[lexpos],lexpos), lexdata[lexpos:]) -+ raise LexError("Illegal character '%s' at index %d" % (lexdata[lexpos],lexpos), lexdata[lexpos:]) - - self.lexpos = lexpos + 1 - if self.lexdata is None: -- raise RuntimeError, "No input string given with input()" -+ raise RuntimeError("No input string given with input()") - return None - - # ----------------------------------------------------------------------------- -@@ -377,7 +380,7 @@ def _validate_file(filename): - if not prev: - counthash[name] = linen - else: -- print "%s:%d: Rule %s redefined. Previously defined on line %d" % (filename,linen,name,prev) -+ print("%s:%d: Rule %s redefined. Previously defined on line %d" % (filename,linen,name,prev)) - noerror = 0 - linen += 1 - return noerror -@@ -439,12 +442,12 @@ def _form_master_re(relist,reflags,ldict): - # callback function to carry out the action - if f.find("ignore_") > 0: - lexindexfunc[i] = (None,None) -- print "IGNORE", f -+ print("IGNORE", f) - else: - lexindexfunc[i] = (None, f[2:]) - - return [(lexre,lexindexfunc)],[regex] -- except Exception,e: -+ except Exception as e: - m = int(len(relist)/2) - if m == 0: m = 1 - llist, lre = _form_master_re(relist[:m],reflags,ldict) -@@ -464,7 +467,7 @@ def _statetoken(s,names): - nonstate = 1 - parts = s.split("_") - for i in range(1,len(parts)): -- if not names.has_key(parts[i]) and parts[i] != 'ANY': break -+ if parts[i] not in names and parts[i] != 'ANY': break - if i > 1: - states = tuple(parts[1:i]) - else: -@@ -507,7 +510,7 @@ def lex(module=None,object=None,debug=0,optimize=0,lextab="lextab",reflags=0,now - for (i,v) in _items: - ldict[i] = v - else: -- raise ValueError,"Expected a module or instance" -+ raise ValueError("Expected a module or instance") - lexobj.lexmodule = module - - else: -@@ -542,61 +545,64 @@ def lex(module=None,object=None,debug=0,optimize=0,lextab="lextab",reflags=0,now - literals = ldict.get("literals","") - - if not tokens: -- raise SyntaxError,"lex: module does not define 'tokens'" -- if not (isinstance(tokens,types.ListType) or isinstance(tokens,types.TupleType)): -- raise SyntaxError,"lex: tokens must be a list or tuple." -+ raise SyntaxError("lex: module does not define 'tokens'") -+ if not (isinstance(tokens,list) or isinstance(tokens,tuple)): -+ raise SyntaxError("lex: tokens must be a list or tuple.") - - # Build a dictionary of valid token names - lexobj.lextokens = { } - if not optimize: - for n in tokens: - if not _is_identifier.match(n): -- print "lex: Bad token name '%s'" % n -+ print("lex: Bad token name '%s'" % n) - error = 1 -- if warn and lexobj.lextokens.has_key(n): -- print "lex: Warning. Token '%s' multiply defined." % n -+ if warn and n in lexobj.lextokens: -+ print("lex: Warning. Token '%s' multiply defined." % n) - lexobj.lextokens[n] = None - else: - for n in tokens: lexobj.lextokens[n] = None - - if debug: -- print "lex: tokens = '%s'" % lexobj.lextokens.keys() -+ print("lex: tokens = '%s'" % list(lexobj.lextokens.keys())) - - try: - for c in literals: -- if not (isinstance(c,types.StringType) or isinstance(c,types.UnicodeType)) or len(c) > 1: -- print "lex: Invalid literal %s. Must be a single character" % repr(c) -+ if not (isinstance(c,util.bytes_type) or isinstance(c, util.string_type)) or len(c) > 1: -+ print("lex: Invalid literal %s. Must be a single character" % repr(c)) - error = 1 - continue - - except TypeError: -- print "lex: Invalid literals specification. literals must be a sequence of characters." -+ print("lex: Invalid literals specification. literals must be a sequence of characters.") - error = 1 - - lexobj.lexliterals = literals - - # Build statemap - if states: -- if not (isinstance(states,types.TupleType) or isinstance(states,types.ListType)): -- print "lex: states must be defined as a tuple or list." -+ if not (isinstance(states,tuple) or isinstance(states,list)): -+ print("lex: states must be defined as a tuple or list.") - error = 1 - else: - for s in states: -- if not isinstance(s,types.TupleType) or len(s) != 2: -- print "lex: invalid state specifier %s. Must be a tuple (statename,'exclusive|inclusive')" % repr(s) -+ if not isinstance(s,tuple) or len(s) != 2: -+ print("lex: invalid state specifier %s. Must be a tuple (statename,'exclusive|inclusive')" % repr(s)) - error = 1 - continue - name, statetype = s -- if not isinstance(name,types.StringType): -- print "lex: state name %s must be a string" % repr(name) -+ if isinstance(name, util.string_type): -+ original_name = name -+ name = util.encode_input(name) -+ if not isinstance(name,util.bytes_type) or len(original_name) != len(name): -+ print("lex: state name %s must be a byte string" % repr(original_name)) - error = 1 - continue - if not (statetype == 'inclusive' or statetype == 'exclusive'): -- print "lex: state type for state %s must be 'inclusive' or 'exclusive'" % name -+ print("lex: state type for state %s must be 'inclusive' or 'exclusive'" % name) - error = 1 - continue -- if stateinfo.has_key(name): -- print "lex: state '%s' already defined." % name -+ if name in stateinfo: -+ print("lex: state '%s' already defined." % name) - error = 1 - continue - stateinfo[name] = statetype -@@ -618,28 +624,28 @@ def lex(module=None,object=None,debug=0,optimize=0,lextab="lextab",reflags=0,now - errorf = { } # Error functions by state - - if len(tsymbols) == 0: -- raise SyntaxError,"lex: no rules of the form t_rulename are defined." -+ raise SyntaxError("lex: no rules of the form t_rulename are defined.") - - for f in tsymbols: - t = ldict[f] - states, tokname = _statetoken(f,stateinfo) - toknames[f] = tokname - -- if callable(t): -+ if isinstance(t, collections.Callable): - for s in states: funcsym[s].append((f,t)) -- elif (isinstance(t, types.StringType) or isinstance(t,types.UnicodeType)): -+ elif (isinstance(t, util.bytes_type) or isinstance(t,util.string_type)): - for s in states: strsym[s].append((f,t)) - else: -- print "lex: %s not defined as a function or string" % f -+ print("lex: %s not defined as a function or string" % f) - error = 1 - - # Sort the functions by line number - for f in funcsym.values(): -- f.sort(lambda x,y: cmp(x[1].func_code.co_firstlineno,y[1].func_code.co_firstlineno)) -+ f.sort(key=lambda x: x[1].__code__.co_firstlineno) - - # Sort the strings by regular expression length - for s in strsym.values(): -- s.sort(lambda x,y: (len(x[1]) < len(y[1])) - (len(x[1]) > len(y[1]))) -+ s.sort(key=lambda x: len(x[1])) - - regexs = { } - -@@ -649,31 +655,31 @@ def lex(module=None,object=None,debug=0,optimize=0,lextab="lextab",reflags=0,now - - # Add rules defined by functions first - for fname, f in funcsym[state]: -- line = f.func_code.co_firstlineno -- file = f.func_code.co_filename -+ line = f.__code__.co_firstlineno -+ file = f.__code__.co_filename - files[file] = None - tokname = toknames[fname] - - ismethod = isinstance(f, types.MethodType) - - if not optimize: -- nargs = f.func_code.co_argcount -+ nargs = f.__code__.co_argcount - if ismethod: - reqargs = 2 - else: - reqargs = 1 - if nargs > reqargs: -- print "%s:%d: Rule '%s' has too many arguments." % (file,line,f.__name__) -+ print("%s:%d: Rule '%s' has too many arguments." % (file,line,f.__name__)) - error = 1 - continue - - if nargs < reqargs: -- print "%s:%d: Rule '%s' requires an argument." % (file,line,f.__name__) -+ print("%s:%d: Rule '%s' requires an argument." % (file,line,f.__name__)) - error = 1 - continue - - if tokname == 'ignore': -- print "%s:%d: Rule '%s' must be defined as a string." % (file,line,f.__name__) -+ print("%s:%d: Rule '%s' must be defined as a string." % (file,line,f.__name__)) - error = 1 - continue - -@@ -686,25 +692,25 @@ def lex(module=None,object=None,debug=0,optimize=0,lextab="lextab",reflags=0,now - try: - c = re.compile("(?P<%s>%s)" % (f.__name__,f.__doc__), re.VERBOSE | reflags) - if c.match(""): -- print "%s:%d: Regular expression for rule '%s' matches empty string." % (file,line,f.__name__) -+ print("%s:%d: Regular expression for rule '%s' matches empty string." % (file,line,f.__name__)) - error = 1 - continue -- except re.error,e: -- print "%s:%d: Invalid regular expression for rule '%s'. %s" % (file,line,f.__name__,e) -+ except re.error as e: -+ print("%s:%d: Invalid regular expression for rule '%s'. %s" % (file,line,f.__name__,e)) - if '#' in f.__doc__: -- print "%s:%d. Make sure '#' in rule '%s' is escaped with '\\#'." % (file,line, f.__name__) -+ print("%s:%d. Make sure '#' in rule '%s' is escaped with '\\#'." % (file,line, f.__name__)) - error = 1 - continue - - if debug: -- print "lex: Adding rule %s -> '%s' (state '%s')" % (f.__name__,f.__doc__, state) -+ print("lex: Adding rule %s -> '%s' (state '%s')" % (f.__name__,f.__doc__, state)) - - # Okay. The regular expression seemed okay. Let's append it to the master regular - # expression we're building - - regex_list.append("(?P<%s>%s)" % (f.__name__,f.__doc__)) - else: -- print "%s:%d: No regular expression defined for rule '%s'" % (file,line,f.__name__) -+ print("%s:%d: No regular expression defined for rule '%s'" % (file,line,f.__name__)) - - # Now add all of the simple rules - for name,r in strsym[state]: -@@ -716,34 +722,34 @@ def lex(module=None,object=None,debug=0,optimize=0,lextab="lextab",reflags=0,now - - if not optimize: - if tokname == 'error': -- raise SyntaxError,"lex: Rule '%s' must be defined as a function" % name -+ raise SyntaxError("lex: Rule '%s' must be defined as a function" % name) - error = 1 - continue - -- if not lexobj.lextokens.has_key(tokname) and tokname.find("ignore_") < 0: -- print "lex: Rule '%s' defined for an unspecified token %s." % (name,tokname) -+ if tokname not in lexobj.lextokens and tokname.find("ignore_") < 0: -+ print("lex: Rule '%s' defined for an unspecified token %s." % (name,tokname)) - error = 1 - continue - try: - c = re.compile("(?P<%s>%s)" % (name,r),re.VERBOSE | reflags) - if (c.match("")): -- print "lex: Regular expression for rule '%s' matches empty string." % name -+ print("lex: Regular expression for rule '%s' matches empty string." % name) - error = 1 - continue -- except re.error,e: -- print "lex: Invalid regular expression for rule '%s'. %s" % (name,e) -+ except re.error as e: -+ print("lex: Invalid regular expression for rule '%s'. %s" % (name,e)) - if '#' in r: -- print "lex: Make sure '#' in rule '%s' is escaped with '\\#'." % name -+ print("lex: Make sure '#' in rule '%s' is escaped with '\\#'." % name) - - error = 1 - continue - if debug: -- print "lex: Adding rule %s -> '%s' (state '%s')" % (name,r,state) -+ print("lex: Adding rule %s -> '%s' (state '%s')" % (name,r,state)) - - regex_list.append("(?P<%s>%s)" % (name,r)) - - if not regex_list: -- print "lex: No rules defined for state '%s'" % state -+ print("lex: No rules defined for state '%s'" % state) - error = 1 - - regexs[state] = regex_list -@@ -755,7 +761,7 @@ def lex(module=None,object=None,debug=0,optimize=0,lextab="lextab",reflags=0,now - error = 1 - - if error: -- raise SyntaxError,"lex: Unable to build lexer." -+ raise SyntaxError("lex: Unable to build lexer.") - - # From this point forward, we're reasonably confident that we can build the lexer. - # No more errors will be generated, but there might be some warning messages. -@@ -768,7 +774,7 @@ def lex(module=None,object=None,debug=0,optimize=0,lextab="lextab",reflags=0,now - lexobj.lexstateretext[state] = re_text - if debug: - for i in range(len(re_text)): -- print "lex: state '%s'. regex[%d] = '%s'" % (state, i, re_text[i]) -+ print("lex: state '%s'. regex[%d] = '%s'" % (state, i, re_text[i])) - - # For inclusive states, we need to add the INITIAL state - for state,type in stateinfo.items(): -@@ -788,19 +794,19 @@ def lex(module=None,object=None,debug=0,optimize=0,lextab="lextab",reflags=0,now - lexobj.lexstateerrorf = errorf - lexobj.lexerrorf = errorf.get("INITIAL",None) - if warn and not lexobj.lexerrorf: -- print "lex: Warning. no t_error rule is defined." -+ print("lex: Warning. no t_error rule is defined.") - - # Check state information for ignore and error rules - for s,stype in stateinfo.items(): - if stype == 'exclusive': -- if warn and not errorf.has_key(s): -- print "lex: Warning. no error rule is defined for exclusive state '%s'" % s -- if warn and not ignore.has_key(s) and lexobj.lexignore: -- print "lex: Warning. no ignore rule is defined for exclusive state '%s'" % s -+ if warn and s not in errorf: -+ print("lex: Warning. no error rule is defined for exclusive state '%s'" % s) -+ if warn and s not in ignore and lexobj.lexignore: -+ print("lex: Warning. no ignore rule is defined for exclusive state '%s'" % s) - elif stype == 'inclusive': -- if not errorf.has_key(s): -+ if s not in errorf: - errorf[s] = errorf.get("INITIAL",None) -- if not ignore.has_key(s): -+ if s not in ignore: - ignore[s] = ignore.get("INITIAL","") - - -@@ -829,7 +835,7 @@ def runmain(lexer=None,data=None): - data = f.read() - f.close() - except IndexError: -- print "Reading from standard input (type EOF to end):" -+ print("Reading from standard input (type EOF to end):") - data = sys.stdin.read() - - if lexer: -@@ -845,7 +851,7 @@ def runmain(lexer=None,data=None): - while 1: - tok = _token() - if not tok: break -- print "(%s,%r,%d,%d)" % (tok.type, tok.value, tok.lineno,tok.lexpos) -+ print("(%s,%r,%d,%d)" % (tok.type, tok.value, tok.lineno,tok.lexpos)) - - - # ----------------------------------------------------------------------------- -diff --git a/sepolgen-1.2.2/src/sepolgen/matching.py b/sepolgen-1.2.2/src/sepolgen/matching.py -index d56dd92..6f86359 100644 ---- a/sepolgen-1.2.2/src/sepolgen/matching.py -+++ b/sepolgen-1.2.2/src/sepolgen/matching.py -@@ -21,33 +21,30 @@ - Classes and algorithms for matching requested access to access vectors. - """ - --import access --import objectmodel - import itertools - --class Match: -+from . import access -+from . import objectmodel -+from . import util -+ -+ -+class Match(util.Comparison): - def __init__(self, interface=None, dist=0): - self.interface = interface - self.dist = dist - self.info_dir_change = False -- -- def __cmp__(self, other): -- if self.dist == other.dist: -- if self.info_dir_change: -- if other.info_dir_change: -- return 0 -- else: -- return 1 -- else: -- if other.info_dir_change: -- return -1 -- else: -- return 0 -- else: -- if self.dist < other.dist: -- return -1 -- else: -- return 1 -+ # when implementing __eq__ also __hash__ is needed on py2 -+ # if object is muttable __hash__ should be None -+ self.__hash__ = None -+ -+ def _compare(self, other, method): -+ try: -+ a = (self.dist, self.info_dir_change) -+ b = (other.dist, other.info_dir_change) -+ return method(a, b) -+ except (AttributeError, TypeError): -+ # trying to compare to foreign type -+ return NotImplemented - - class MatchList: - DEFAULT_THRESHOLD = 150 -diff --git a/sepolgen-1.2.2/src/sepolgen/module.py b/sepolgen-1.2.2/src/sepolgen/module.py -index 7fc9443..c09676a 100644 ---- a/sepolgen-1.2.2/src/sepolgen/module.py -+++ b/sepolgen-1.2.2/src/sepolgen/module.py -@@ -22,18 +22,21 @@ Utilities for dealing with the compilation of modules and creation - of module tress. - """ - --import defaults -- --import selinux -- - import re - import tempfile --import commands -+try: -+ from subprocess import getstatusoutput -+except ImportError: -+ from commands import getstatusoutput - import os - import os.path --import subprocess - import shutil - -+import selinux -+ -+from . import defaults -+ -+ - def is_valid_name(modname): - """Check that a module name is valid. - """ -@@ -130,7 +133,7 @@ class ModuleCompiler: - - def run(self, command): - self.o(command) -- rc, output = commands.getstatusoutput(command) -+ rc, output = getstatusoutput(command) - self.o(output) - - return rc -diff --git a/sepolgen-1.2.2/src/sepolgen/objectmodel.py b/sepolgen-1.2.2/src/sepolgen/objectmodel.py -index 88c8a1f..d05d721 100644 ---- a/sepolgen-1.2.2/src/sepolgen/objectmodel.py -+++ b/sepolgen-1.2.2/src/sepolgen/objectmodel.py -@@ -118,7 +118,7 @@ class PermMappings: - continue - if fields[0] == "class": - c = fields[1] -- if self.classes.has_key(c): -+ if c in self.classes: - raise ValueError("duplicate class in perm map") - self.classes[c] = { } - cur = self.classes[c] -diff --git a/sepolgen-1.2.2/src/sepolgen/output.py b/sepolgen-1.2.2/src/sepolgen/output.py -index 739452d..7a83aee 100644 ---- a/sepolgen-1.2.2/src/sepolgen/output.py -+++ b/sepolgen-1.2.2/src/sepolgen/output.py -@@ -27,8 +27,12 @@ generating policy. This keeps the semantic / syntactic issues - cleanly separated from the formatting issues. - """ - --import refpolicy --import util -+from . import refpolicy -+from . import util -+ -+if util.PY3: -+ from .util import cmp -+ - - class ModuleWriter: - def __init__(self): -@@ -127,7 +131,7 @@ def sort_filter(module): - rules = [] - rules.extend(node.avrules()) - rules.extend(node.interface_calls()) -- rules.sort(rule_cmp) -+ rules.sort(key=util.cmp_to_key(rule_cmp)) - - cur = None - sep_rules = [] -@@ -151,7 +155,7 @@ def sort_filter(module): - - ras = [] - ras.extend(node.role_types()) -- ras.sort(role_type_cmp) -+ ras.sort(key=util.cmp_to_key(role_type_cmp)) - if len(ras): - comment = refpolicy.Comment() - comment.lines.append("============= ROLES ==============") -diff --git a/sepolgen-1.2.2/src/sepolgen/policygen.py b/sepolgen-1.2.2/src/sepolgen/policygen.py -index 5f38577..ebcfcf2 100644 ---- a/sepolgen-1.2.2/src/sepolgen/policygen.py -+++ b/sepolgen-1.2.2/src/sepolgen/policygen.py -@@ -24,17 +24,18 @@ classes and algorithms for the generation of SELinux policy. - import itertools - import textwrap - --import refpolicy --import objectmodel --import access --import interfaces --import matching - import selinux.audit2why as audit2why - try: - from setools import * - except: - pass - -+from . import refpolicy -+from . import objectmodel -+from . import access -+from . import interfaces -+from . import matching -+from . import util - # Constants for the level of explanation from the generation - # routines - NO_EXPLANATION = 0 -@@ -81,8 +82,9 @@ class PolicyGenerator: +diff --git a/sepolgen-1.2.3-rc1/src/sepolgen/policygen.py b/sepolgen-1.2.3-rc1/src/sepolgen/policygen.py +index 34c8401..ebcfcf2 100644 +--- a/sepolgen-1.2.3-rc1/src/sepolgen/policygen.py ++++ b/sepolgen-1.2.3-rc1/src/sepolgen/policygen.py +@@ -82,8 +82,9 @@ class PolicyGenerator: self.module = refpolicy.Module() self.dontaudit = False @@ -1015,7 +198,7 @@ index 5f38577..ebcfcf2 100644 def set_gen_refpol(self, if_set=None, perm_maps=None): """Set whether reference policy interfaces are generated. -@@ -152,6 +154,18 @@ class PolicyGenerator: +@@ -153,6 +154,18 @@ class PolicyGenerator: """Return the generated module""" return self.module @@ -1034,7 +217,7 @@ index 5f38577..ebcfcf2 100644 def __add_allow_rules(self, avs): for av in avs: rule = refpolicy.AVRule(av) -@@ -160,6 +174,34 @@ class PolicyGenerator: +@@ -161,6 +174,34 @@ class PolicyGenerator: rule.comment = "" if self.explain: rule.comment = str(refpolicy.Comment(explain_access(av, verbosity=self.explain))) @@ -1069,1650 +252,3 @@ index 5f38577..ebcfcf2 100644 if av.type == audit2why.ALLOW: rule.comment += "\n#!!!! This avc is allowed in the current policy" if av.type == audit2why.DONTAUDIT: -@@ -167,14 +209,14 @@ class PolicyGenerator: - - if av.type == audit2why.BOOLEAN: - if len(av.data) > 1: -- rule.comment += "\n#!!!! This avc can be allowed using one of the these booleans:\n# %s" % ", ".join(map(lambda x: x[0], av.data)) -+ rule.comment += "\n#!!!! This avc can be allowed using one of the these booleans:\n# %s" % ", ".join([x[0] for x in av.data]) - else: - rule.comment += "\n#!!!! This avc can be allowed using the boolean '%s'" % av.data[0][0] - - if av.type == audit2why.CONSTRAINT: - rule.comment += "\n#!!!! This avc is a constraint violation. You would need to modify the attributes of either the source or target types to allow this access." - rule.comment += "\n#Constraint rule: " -- rule.comment += "\n\t" + av.data[0] -+ rule.comment += "\n#\t" + av.data[0] - for reason in av.data[1:]: - rule.comment += "\n#\tPossible cause is the source %s and target %s are different." % reason - -@@ -186,7 +228,7 @@ class PolicyGenerator: - self.domains = seinfo(ATTRIBUTE, name="domain")[0]["types"] - types=[] - -- for i in map(lambda x: x[TCONTEXT], sesearch([ALLOW], {SCONTEXT: av.src_type, CLASS: av.obj_class, PERMS: av.perms})): -+ for i in [x[TCONTEXT] for x in sesearch([ALLOW], {SCONTEXT: av.src_type, CLASS: av.obj_class, PERMS: av.perms})]: - if i not in self.domains: - types.append(i) - if len(types) == 1: -@@ -275,15 +317,12 @@ def explain_access(av, ml=None, verbosity=SHORT_EXPLANATION): - explain_interfaces() - return s - --def param_comp(a, b): -- return cmp(b.num, a.num) -- - def call_interface(interface, av): - params = [] - args = [] - - params.extend(interface.params.values()) -- params.sort(param_comp) -+ params.sort(key=lambda param: param.num, reverse=True) - - ifcall = refpolicy.InterfaceCall() - ifcall.ifname = interface.name -@@ -296,7 +335,7 @@ def call_interface(interface, av): - elif params[i].type == refpolicy.OBJ_CLASS: - ifcall.args.append(av.obj_class) - else: -- print params[i].type -+ print(params[i].type) - assert(0) - - assert(len(ifcall.args) > 0) -@@ -318,7 +357,7 @@ class InterfaceGenerator: - for x in ifs.interfaces.values(): - params = [] - params.extend(x.params.values()) -- params.sort(param_comp) -+ params.sort(key=lambda param: param.num, reverse=True) - for i in range(len(params)): - # Check that the paramater position matches - # the number (e.g., $1 is the first arg). This -diff --git a/sepolgen-1.2.2/src/sepolgen/refparser.py b/sepolgen-1.2.2/src/sepolgen/refparser.py -index b453a29..f5ff19c 100644 ---- a/sepolgen-1.2.2/src/sepolgen/refparser.py -+++ b/sepolgen-1.2.2/src/sepolgen/refparser.py -@@ -34,12 +34,11 @@ import os - import re - import traceback - --import refpolicy --import access --import defaults -- --import lex --import yacc -+from . import access -+from . import defaults -+from . import lex -+from . import refpolicy -+from . import yacc - - # ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - # -@@ -267,7 +266,7 @@ def t_comment(t): - t.lexer.lineno += 1 - - def t_error(t): -- print "Illegal character '%s'" % t.value[0] -+ print("Illegal character '%s'" % t.value[0]) - t.skip(1) - - def t_newline(t): -@@ -960,7 +959,7 @@ def p_optional_semi(p): - def p_error(tok): - global error, parse_file, success, parser - error = "%s: Syntax error on line %d %s [type=%s]" % (parse_file, tok.lineno, tok.value, tok.type) -- print error -+ print(error) - success = False - - def prep_spt(spt): -@@ -997,7 +996,7 @@ def parse(text, module=None, support=None, debug=False): - - try: - parser.parse(text, debug=debug, lexer=lexer) -- except Exception, e: -+ except Exception as e: - parser = None - lexer = None - error = "internal parser error: %s" % str(e) + "\n" + traceback.format_exc() -@@ -1030,7 +1029,7 @@ def list_headers(root): - - - def parse_headers(root, output=None, expand=True, debug=False): -- import util -+ from . import util - - headers = refpolicy.Headers() - -@@ -1064,9 +1063,9 @@ def parse_headers(root, output=None, expand=True, debug=False): - fd.close() - parse_file = f - parse(txt, module, spt, debug) -- except IOError, e: -+ except IOError as e: - return -- except ValueError, e: -+ except ValueError as e: - raise ValueError("error parsing file %s: %s" % (f, str(e))) - - spt = None -@@ -1102,7 +1101,7 @@ def parse_headers(root, output=None, expand=True, debug=False): - parse_file(x[1], m, spt) - else: - parse_file(x[1], m) -- except ValueError, e: -+ except ValueError as e: - o(str(e) + "\n") - failures.append(x[1]) - continue -diff --git a/sepolgen-1.2.2/src/sepolgen/refpolicy.py b/sepolgen-1.2.2/src/sepolgen/refpolicy.py -index 8ad64a9..a9bb92d 100644 ---- a/sepolgen-1.2.2/src/sepolgen/refpolicy.py -+++ b/sepolgen-1.2.2/src/sepolgen/refpolicy.py -@@ -18,7 +18,6 @@ - # - - import string --import itertools - import selinux - - # OVERVIEW -@@ -85,53 +84,53 @@ class Node(PolicyBase): - # Top level nodes - - def nodes(self): -- return itertools.ifilter(lambda x: isinstance(x, Node), walktree(self)) -+ return filter(lambda x: isinstance(x, Node), walktree(self)) - - def modules(self): -- return itertools.ifilter(lambda x: isinstance(x, Module), walktree(self)) -+ return filter(lambda x: isinstance(x, Module), walktree(self)) - - def interfaces(self): -- return itertools.ifilter(lambda x: isinstance(x, Interface), walktree(self)) -+ return filter(lambda x: isinstance(x, Interface), walktree(self)) - - def templates(self): -- return itertools.ifilter(lambda x: isinstance(x, Template), walktree(self)) -+ return filter(lambda x: isinstance(x, Template), walktree(self)) - - def support_macros(self): -- return itertools.ifilter(lambda x: isinstance(x, SupportMacros), walktree(self)) -+ return filter(lambda x: isinstance(x, SupportMacros), walktree(self)) - - # Common policy statements - - def module_declarations(self): -- return itertools.ifilter(lambda x: isinstance(x, ModuleDeclaration), walktree(self)) -+ return filter(lambda x: isinstance(x, ModuleDeclaration), walktree(self)) - - def interface_calls(self): -- return itertools.ifilter(lambda x: isinstance(x, InterfaceCall), walktree(self)) -+ return filter(lambda x: isinstance(x, InterfaceCall), walktree(self)) - - def avrules(self): -- return itertools.ifilter(lambda x: isinstance(x, AVRule), walktree(self)) -+ return filter(lambda x: isinstance(x, AVRule), walktree(self)) - - def typerules(self): -- return itertools.ifilter(lambda x: isinstance(x, TypeRule), walktree(self)) -+ return filter(lambda x: isinstance(x, TypeRule), walktree(self)) - - def typeattributes(self): - """Iterate over all of the TypeAttribute children of this Interface.""" -- return itertools.ifilter(lambda x: isinstance(x, TypeAttribute), walktree(self)) -+ return filter(lambda x: isinstance(x, TypeAttribute), walktree(self)) - - def roleattributes(self): - """Iterate over all of the RoleAttribute children of this Interface.""" -- return itertools.ifilter(lambda x: isinstance(x, RoleAttribute), walktree(self)) -+ return filter(lambda x: isinstance(x, RoleAttribute), walktree(self)) - - def requires(self): -- return itertools.ifilter(lambda x: isinstance(x, Require), walktree(self)) -+ return filter(lambda x: isinstance(x, Require), walktree(self)) - - def roles(self): -- return itertools.ifilter(lambda x: isinstance(x, Role), walktree(self)) -+ return filter(lambda x: isinstance(x, Role), walktree(self)) - - def role_allows(self): -- return itertools.ifilter(lambda x: isinstance(x, RoleAllow), walktree(self)) -+ return filter(lambda x: isinstance(x, RoleAllow), walktree(self)) - - def role_types(self): -- return itertools.ifilter(lambda x: isinstance(x, RoleType), walktree(self)) -+ return filter(lambda x: isinstance(x, RoleType), walktree(self)) - - def __str__(self): - if self.comment: -@@ -291,7 +290,7 @@ class SecurityContext(Leaf): - self.type = fields[2] - if len(fields) > 3: - # FUTURE - normalize level fields to allow more comparisons to succeed. -- self.level = string.join(fields[3:], ':') -+ self.level = ':'.join(fields[3:]) - else: - self.level = None - -@@ -694,7 +693,7 @@ def print_tree(head): - s = "" - for i in range(depth): - s = s + "\t" -- print s + str(node) -+ print(s + str(node)) - - - class Headers(Node): -@@ -801,7 +800,7 @@ class SupportMacros(Node): - # are ordered correctly so that no macro is used before - # it is defined - s = set() -- if self.map.has_key(perm): -+ if perm in self.map: - for p in self.by_name(perm): - s.update(self.__expand_perm(p)) - else: -@@ -824,7 +823,7 @@ class SupportMacros(Node): - def has_key(self, name): - if not self.map: - self.__gen_map() -- return self.map.has_key(name) -+ return name in self.map - - class Require(Leaf): - def __init__(self, parent=None): -diff --git a/sepolgen-1.2.2/src/sepolgen/util.py b/sepolgen-1.2.2/src/sepolgen/util.py -index 74a11f5..1fca971 100644 ---- a/sepolgen-1.2.2/src/sepolgen/util.py -+++ b/sepolgen-1.2.2/src/sepolgen/util.py -@@ -16,6 +16,19 @@ - # along with this program; if not, write to the Free Software - # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - # -+import locale -+import sys -+ -+ -+PY3 = sys.version_info[0] == 3 -+ -+if PY3: -+ bytes_type=bytes -+ string_type=str -+else: -+ bytes_type=str -+ string_type=unicode -+ - - class ConsoleProgressBar: - def __init__(self, out, steps=100, indicator='#'): -@@ -76,6 +89,88 @@ def first(s, sorted=False): - for x in s: - return x - -+def encode_input(text): -+ import locale -+ """Encode given text via preferred system encoding""" -+ # locale will often find out the correct encoding -+ encoding = locale.getpreferredencoding() -+ try: -+ encoded_text = text.encode(encoding) -+ except UnicodeError: -+ # if it fails to find correct encoding then ascii is used -+ # which may lead to UnicodeError if `text` contains non ascii signs -+ # utf-8 is our guess to fix the situation -+ encoded_text = text.encode('utf-8') -+ return encoded_text -+ -+def decode_input(text): -+ import locale -+ """Decode given text via preferred system encoding""" -+ # locale will often find out the correct encoding -+ encoding = locale.getpreferredencoding() -+ try: -+ decoded_text = text.decode(encoding) -+ except UnicodeError: -+ # if it fails to find correct encoding then ascii is used -+ # which may lead to UnicodeError if `text` contains non ascii signs -+ # utf-8 is our guess to fix the situation -+ decoded_text = text.decode('utf-8') -+ return decoded_text -+ -+class Comparison(): -+ """Class used when implementing rich comparison. -+ -+ Inherit from this class if you want to have a rich -+ comparison withing the class, afterwards implement -+ _compare function within your class.""" -+ -+ def _compare(self, other, method): -+ raise NotImplemented -+ -+ def __eq__(self, other): -+ return self._compare(other, lambda a, b: a == b) -+ -+ def __lt__(self, other): -+ return self._compare(other, lambda a, b: a < b) -+ -+ def __le__(self, other): -+ return self._compare(other, lambda a, b: a <= b) -+ -+ def __ge__(self, other): -+ return self._compare(other, lambda a, b: a >= b) -+ -+ def __gt__(self, other): -+ return self._compare(other, lambda a, b: a > b) -+ -+ def __ne__(self, other): -+ return self._compare(other, lambda a, b: a != b) -+ -+if sys.version_info < (2,7): -+ # cmp_to_key function is missing in python2.6 -+ def cmp_to_key(mycmp): -+ 'Convert a cmp= function into a key= function' -+ class K: -+ def __init__(self, obj, *args): -+ self.obj = obj -+ def __lt__(self, other): -+ return mycmp(self.obj, other.obj) < 0 -+ def __gt__(self, other): -+ return mycmp(self.obj, other.obj) > 0 -+ def __eq__(self, other): -+ return mycmp(self.obj, other.obj) == 0 -+ def __le__(self, other): -+ return mycmp(self.obj, other.obj) <= 0 -+ def __ge__(self, other): -+ return mycmp(self.obj, other.obj) >= 0 -+ def __ne__(self, other): -+ return mycmp(self.obj, other.obj) != 0 -+ return K -+else: -+ from functools import cmp_to_key -+ -+def cmp(first, second): -+ return (first > second) - (second > first) -+ - if __name__ == "__main__": - import sys - import time -diff --git a/sepolgen-1.2.2/src/sepolgen/yacc.py b/sepolgen-1.2.2/src/sepolgen/yacc.py -index bc4536d..f006354 100644 ---- a/sepolgen-1.2.2/src/sepolgen/yacc.py -+++ b/sepolgen-1.2.2/src/sepolgen/yacc.py -@@ -67,7 +67,13 @@ default_lr = 'LALR' # Default LR table generation method - - error_count = 3 # Number of symbols that must be shifted to leave recovery mode - --import re, types, sys, cStringIO, hashlib, os.path -+import re, types, sys, hashlib, os.path -+try: -+ from cStringIO import StringIO -+except ImportError: -+ from io import StringIO -+ -+from . import util - - # Exception raised for yacc-related errors - class YaccError(Exception): pass -@@ -109,7 +115,7 @@ class YaccProduction: - self.stack = stack - - def __getitem__(self,n): -- if type(n) == types.IntType: -+ if type(n) == int: - if n >= 0: return self.slice[n].value - else: return self.stack[n].value - else: -@@ -139,9 +145,9 @@ class YaccProduction: - - def pushback(self,n): - if n <= 0: -- raise ValueError, "Expected a positive value" -+ raise ValueError("Expected a positive value") - if n > (len(self.slice)-1): -- raise ValueError, "Can't push %d tokens. Only %d are available." % (n,len(self.slice)-1) -+ raise ValueError("Can't push %d tokens. Only %d are available." % (n,len(self.slice)-1)) - for i in range(0,n): - self.pbstack.append(self.slice[-i-1]) - -@@ -157,7 +163,7 @@ class Parser: - # object directly. - - if magic != "xyzzy": -- raise YaccError, "Can't instantiate Parser. Use yacc() instead." -+ raise YaccError("Can't instantiate Parser. Use yacc() instead.") - - # Reset internal state - self.productions = None # List of productions -@@ -190,7 +196,7 @@ class Parser: - - # If no lexer was given, we will try to use the lex module - if not lexer: -- import lex -+ from . import lex - lexer = lex.lexer - - pslice.lexer = lexer -@@ -221,7 +227,7 @@ class Parser: - # is already set, we just use that. Otherwise, we'll pull - # the next token off of the lookaheadstack or from the lexer - if debug > 1: -- print 'state', statestack[-1] -+ print('state', statestack[-1]) - if not lookahead: - if not lookaheadstack: - lookahead = get_token() # Get the next token -@@ -239,7 +245,7 @@ class Parser: - t = actions.get((s,ltype),None) - - if debug > 1: -- print 'action', t -+ print('action', t) - if t is not None: - if t > 0: - # shift a symbol on the stack -@@ -396,7 +402,7 @@ class Parser: - continue - - # Call an error function here -- raise RuntimeError, "yacc: internal parser error!!!\n" -+ raise RuntimeError("yacc: internal parser error!!!\n") - - # ----------------------------------------------------------------------------- - # === Parser Construction === -@@ -457,12 +463,12 @@ def validate_dict(d): - - if n[0:2] == 'p_': - sys.stderr.write("yacc: Warning. '%s' not defined as a function\n" % n) -- if 1 and isinstance(v,types.FunctionType) and v.func_code.co_argcount == 1: -+ if 1 and isinstance(v,types.FunctionType) and v.__code__.co_argcount == 1: - try: - doc = v.__doc__.split(" ") - if doc[1] == ':': -- sys.stderr.write("%s:%d: Warning. Possible grammar rule '%s' defined without p_ prefix.\n" % (v.func_code.co_filename, v.func_code.co_firstlineno,n)) -- except StandardError: -+ sys.stderr.write("%s:%d: Warning. Possible grammar rule '%s' defined without p_ prefix.\n" % (v.__code__.co_filename, v.__code__.co_firstlineno,n)) -+ except Exception: - pass - - # ----------------------------------------------------------------------------- -@@ -514,8 +520,8 @@ def initialize_vars(): - - # File objects used when creating the parser.out debugging file - global _vf, _vfc -- _vf = cStringIO.StringIO() -- _vfc = cStringIO.StringIO() -+ _vf = StringIO() -+ _vfc = StringIO() - - # ----------------------------------------------------------------------------- - # class Production: -@@ -581,7 +587,7 @@ class Production: - # Precompute list of productions immediately following - try: - p.lrafter = Prodnames[p.prod[n+1]] -- except (IndexError,KeyError),e: -+ except (IndexError,KeyError) as e: - p.lrafter = [] - try: - p.lrbefore = p.prod[n-1] -@@ -615,7 +621,7 @@ _is_identifier = re.compile(r'^[a-zA-Z0-9_-~]+$') - - def add_production(f,file,line,prodname,syms): - -- if Terminals.has_key(prodname): -+ if prodname in Terminals: - sys.stderr.write("%s:%d: Illegal rule name '%s'. Already defined as a token.\n" % (file,line,prodname)) - return -1 - if prodname == 'error': -@@ -634,7 +640,7 @@ def add_production(f,file,line,prodname,syms): - if (len(c) > 1): - sys.stderr.write("%s:%d: Literal token %s in rule '%s' may only be a single character\n" % (file,line,s, prodname)) - return -1 -- if not Terminals.has_key(c): -+ if c not in Terminals: - Terminals[c] = [] - syms[x] = c - continue -@@ -646,7 +652,7 @@ def add_production(f,file,line,prodname,syms): - - # See if the rule is already in the rulemap - map = "%s -> %s" % (prodname,syms) -- if Prodmap.has_key(map): -+ if map in Prodmap: - m = Prodmap[map] - sys.stderr.write("%s:%d: Duplicate rule %s.\n" % (file,line, m)) - sys.stderr.write("%s:%d: Previous definition at %s:%d\n" % (file,line, m.file, m.line)) -@@ -663,7 +669,7 @@ def add_production(f,file,line,prodname,syms): - - Productions.append(p) - Prodmap[map] = p -- if not Nonterminals.has_key(prodname): -+ if prodname not in Nonterminals: - Nonterminals[prodname] = [ ] - - # Add all terminals to Terminals -@@ -687,13 +693,13 @@ def add_production(f,file,line,prodname,syms): - del p.prod[i] - continue - -- if Terminals.has_key(t): -+ if t in Terminals: - Terminals[t].append(p.number) - # Is a terminal. We'll assign a precedence to p based on this - if not hasattr(p,"prec"): - p.prec = Precedence.get(t,('right',0)) - else: -- if not Nonterminals.has_key(t): -+ if t not in Nonterminals: - Nonterminals[t] = [ ] - Nonterminals[t].append(p.number) - i += 1 -@@ -722,8 +728,8 @@ def add_production(f,file,line,prodname,syms): - # and adds rules to the grammar - - def add_function(f): -- line = f.func_code.co_firstlineno -- file = f.func_code.co_filename -+ line = f.__code__.co_firstlineno -+ file = f.__code__.co_filename - error = 0 - - if isinstance(f,types.MethodType): -@@ -731,11 +737,11 @@ def add_function(f): - else: - reqdargs = 1 - -- if f.func_code.co_argcount > reqdargs: -+ if f.__code__.co_argcount > reqdargs: - sys.stderr.write("%s:%d: Rule '%s' has too many arguments.\n" % (file,line,f.__name__)) - return -1 - -- if f.func_code.co_argcount < reqdargs: -+ if f.__code__.co_argcount < reqdargs: - sys.stderr.write("%s:%d: Rule '%s' requires an argument.\n" % (file,line,f.__name__)) - return -1 - -@@ -776,7 +782,7 @@ def add_function(f): - error += e - - -- except StandardError: -+ except Exception: - sys.stderr.write("%s:%d: Syntax error in rule '%s'\n" % (file,dline,ps)) - error -= 1 - else: -@@ -793,7 +799,7 @@ def compute_reachable(): - (Unused terminals have already had their warning.) - ''' - Reachable = { } -- for s in Terminals.keys() + Nonterminals.keys(): -+ for s in list(Terminals.keys()) + list(Nonterminals.keys()): - Reachable[s] = 0 - - mark_reachable_from( Productions[0].prod[0], Reachable ) -@@ -872,7 +878,7 @@ def compute_terminates(): - some_error = 0 - for (s,terminates) in Terminates.items(): - if not terminates: -- if not Prodnames.has_key(s) and not Terminals.has_key(s) and s != 'error': -+ if s not in Prodnames and s not in Terminals and s != 'error': - # s is used-but-not-defined, and we've already warned of that, - # so it would be overkill to say that it's also non-terminating. - pass -@@ -893,7 +899,7 @@ def verify_productions(cycle_check=1): - if not p: continue - - for s in p.prod: -- if not Prodnames.has_key(s) and not Terminals.has_key(s) and s != 'error': -+ if s not in Prodnames and s not in Terminals and s != 'error': - sys.stderr.write("%s:%d: Symbol '%s' used, but not defined as a token or a rule.\n" % (p.file,p.line,s)) - error = 1 - continue -@@ -935,12 +941,12 @@ def verify_productions(cycle_check=1): - - if yaccdebug: - _vf.write("\nTerminals, with rules where they appear\n\n") -- ks = Terminals.keys() -+ ks = list(Terminals.keys()) - ks.sort() - for k in ks: - _vf.write("%-20s : %s\n" % (k, " ".join([str(s) for s in Terminals[k]]))) - _vf.write("\nNonterminals, with rules where they appear\n\n") -- ks = Nonterminals.keys() -+ ks = list(Nonterminals.keys()) - ks.sort() - for k in ks: - _vf.write("%-20s : %s\n" % (k, " ".join([str(s) for s in Nonterminals[k]]))) -@@ -1003,7 +1009,7 @@ def add_precedence(plist): - sys.stderr.write("yacc: Invalid precedence '%s'\n" % prec) - return -1 - for t in terms: -- if Precedence.has_key(t): -+ if t in Precedence: - sys.stderr.write("yacc: Precedence already specified for terminal '%s'\n" % t) - error += 1 - continue -@@ -1087,7 +1093,7 @@ def compute_follow(start=None): - # Here is the production set - for i in range(len(p.prod)): - B = p.prod[i] -- if Nonterminals.has_key(B): -+ if B in Nonterminals: - # Okay. We got a non-terminal in a production - fst = first(p.prod[i+1:]) - hasempty = 0 -@@ -1259,7 +1265,7 @@ def lr0_items(): - for x in asyms.keys(): - g = lr0_goto(I,x) - if not g: continue -- if _lr0_cidhash.has_key(id(g)): continue -+ if id(g) in _lr0_cidhash: continue - _lr0_cidhash[id(g)] = len(C) - C.append(g) - -@@ -1305,7 +1311,7 @@ def compute_nullable_nonterminals(): - nullable[p.name] = 1 - continue - for t in p.prod: -- if not nullable.has_key(t): break -+ if t not in nullable: break - else: - nullable[p.name] = 1 - if len(nullable) == num_nullable: break -@@ -1329,7 +1335,7 @@ def find_nonterminal_transitions(C): - for p in C[state]: - if p.lr_index < p.len - 1: - t = (state,p.prod[p.lr_index+1]) -- if Nonterminals.has_key(t[1]): -+ if t[1] in Nonterminals: - if t not in trans: trans.append(t) - state = state + 1 - return trans -@@ -1352,7 +1358,7 @@ def dr_relation(C,trans,nullable): - for p in g: - if p.lr_index < p.len - 1: - a = p.prod[p.lr_index+1] -- if Terminals.has_key(a): -+ if a in Terminals: - if a not in terms: terms.append(a) - - # This extra bit is to handle the start state -@@ -1377,7 +1383,7 @@ def reads_relation(C, trans, empty): - for p in g: - if p.lr_index < p.len - 1: - a = p.prod[p.lr_index + 1] -- if empty.has_key(a): -+ if a in empty: - rel.append((j,a)) - - return rel -@@ -1437,15 +1443,15 @@ def compute_lookback_includes(C,trans,nullable): - t = p.prod[lr_index] - - # Check to see if this symbol and state are a non-terminal transition -- if dtrans.has_key((j,t)): -+ if (j,t) in dtrans: - # Yes. Okay, there is some chance that this is an includes relation - # the only way to know for certain is whether the rest of the - # production derives empty - - li = lr_index + 1 - while li < p.len: -- if Terminals.has_key(p.prod[li]): break # No forget it -- if not nullable.has_key(p.prod[li]): break -+ if p.prod[li] in Terminals: break # No forget it -+ if p.prod[li] not in nullable: break - li = li + 1 - else: - # Appears to be a relation between (j,t) and (state,N) -@@ -1466,7 +1472,7 @@ def compute_lookback_includes(C,trans,nullable): - else: - lookb.append((j,r)) - for i in includes: -- if not includedict.has_key(i): includedict[i] = [] -+ if i not in includedict: includedict[i] = [] - includedict[i].append((state,N)) - lookdict[(state,N)] = lookb - -@@ -1513,11 +1519,11 @@ def traverse(x,N,stack,F,X,R,FP): - for a in F.get(y,[]): - if a not in F[x]: F[x].append(a) - if N[x] == d: -- N[stack[-1]] = sys.maxint -+ N[stack[-1]] = sys.maxsize - F[stack[-1]] = F[x] - element = stack.pop() - while element != x: -- N[stack[-1]] = sys.maxint -+ N[stack[-1]] = sys.maxsize - F[stack[-1]] = F[x] - element = stack.pop() - -@@ -1577,7 +1583,7 @@ def add_lookaheads(lookbacks,followset): - for trans,lb in lookbacks.items(): - # Loop over productions in lookback - for state,p in lb: -- if not p.lookaheads.has_key(state): -+ if state not in p.lookaheads: - p.lookaheads[state] = [] - f = followset.get(trans,[]) - for a in f: -@@ -1709,7 +1715,7 @@ def lr_parse_table(method): - else: - i = p.lr_index - a = p.prod[i+1] # Get symbol right after the "." -- if Terminals.has_key(a): -+ if a in Terminals: - g = lr0_goto(I,a) - j = _lr0_cidhash.get(id(g),-1) - if j >= 0: -@@ -1751,22 +1757,22 @@ def lr_parse_table(method): - action[st,a] = j - actionp[st,a] = p - -- except StandardError,e: -- raise YaccError, "Hosed in lr_parse_table", e -+ except Exception as e: -+ raise YaccError("Hosed in lr_parse_table").with_traceback(e) - - # Print the actions associated with each terminal - if yaccdebug: - _actprint = { } - for a,p,m in actlist: -- if action.has_key((st,a)): -+ if (st,a) in action: - if p is actionp[st,a]: - _vf.write(" %-15s %s\n" % (a,m)) - _actprint[(a,m)] = 1 - _vf.write("\n") - for a,p,m in actlist: -- if action.has_key((st,a)): -+ if (st,a) in action: - if p is not actionp[st,a]: -- if not _actprint.has_key((a,m)): -+ if (a,m) not in _actprint: - _vf.write(" ! %-15s [ %s ]\n" % (a,m)) - _actprint[(a,m)] = 1 - -@@ -1776,7 +1782,7 @@ def lr_parse_table(method): - nkeys = { } - for ii in I: - for s in ii.usyms: -- if Nonterminals.has_key(s): -+ if s in Nonterminals: - nkeys[s] = None - for n in nkeys.keys(): - g = lr0_goto(I,n) -@@ -1914,15 +1920,14 @@ del _lr_goto_items - - f.close() - -- except IOError,e: -- print "Unable to create '%s'" % filename -- print e -- return -+ except IOError as e: -+ print("Unable to create '%s'" % filename) -+ print(e) - - def lr_read_tables(module=tab_module,optimize=0): - global _lr_action, _lr_goto, _lr_productions, _lr_method - try: -- exec "import %s as parsetab" % module -+ exec("import %s as parsetab" % module) - - if (optimize) or (Signature.digest() == parsetab._lr_signature): - _lr_action = parsetab._lr_action -@@ -1938,13 +1943,13 @@ def lr_read_tables(module=tab_module,optimize=0): - - - # Available instance types. This is used when parsers are defined by a class. --# it's a little funky because I want to preserve backwards compatibility --# with Python 2.0 where types.ObjectType is undefined. -+# In Python3 the InstanceType and ObjectType are no more, they've passed, ceased -+# to be, they are ex-classes along with old-style classes - - try: - _INSTANCETYPE = (types.InstanceType, types.ObjectType) - except AttributeError: -- _INSTANCETYPE = types.InstanceType -+ _INSTANCETYPE = object - - # ----------------------------------------------------------------------------- - # yacc(module) -@@ -1962,7 +1967,7 @@ def yacc(method=default_lr, debug=yaccdebug, module=None, tabmodule=tab_module, - - - # Add parsing method to signature -- Signature.update(method) -+ Signature.update(util.encode_input(method)) - - # If a "module" parameter was supplied, extract its dictionary. - # Note: a module may in fact be an instance as well. -@@ -1977,7 +1982,7 @@ def yacc(method=default_lr, debug=yaccdebug, module=None, tabmodule=tab_module, - for i in _items: - ldict[i[0]] = i[1] - else: -- raise ValueError,"Expected a module" -+ raise ValueError("Expected a module") - - else: - # No module given. We might be able to get information from the caller. -@@ -1995,7 +2000,7 @@ def yacc(method=default_lr, debug=yaccdebug, module=None, tabmodule=tab_module, - if not start: - start = ldict.get("start",None) - if start: -- Signature.update(start) -+ Signature.update(util.encode_input(start)) - - # If running in optimized mode. We're going to - -@@ -2023,24 +2028,24 @@ def yacc(method=default_lr, debug=yaccdebug, module=None, tabmodule=tab_module, - tokens = ldict.get("tokens",None) - - if not tokens: -- raise YaccError,"module does not define a list 'tokens'" -- if not (isinstance(tokens,types.ListType) or isinstance(tokens,types.TupleType)): -- raise YaccError,"tokens must be a list or tuple." -+ raise YaccError("module does not define a list 'tokens'") -+ if not (isinstance(tokens,list) or isinstance(tokens,tuple)): -+ raise YaccError("tokens must be a list or tuple.") - - # Check to see if a requires dictionary is defined. - requires = ldict.get("require",None) - if requires: -- if not (isinstance(requires,types.DictType)): -- raise YaccError,"require must be a dictionary." -+ if not (isinstance(requires,dict)): -+ raise YaccError("require must be a dictionary.") - - for r,v in requires.items(): - try: -- if not (isinstance(v,types.ListType)): -+ if not (isinstance(v,list)): - raise TypeError - v1 = [x.split(".") for x in v] - Requires[r] = v1 -- except StandardError: -- print "Invalid specification for rule '%s' in require. Expected a list of strings" % r -+ except Exception: -+ print("Invalid specification for rule '%s' in require. Expected a list of strings" % r) - - - # Build the dictionary of terminals. We a record a 0 in the -@@ -2048,12 +2053,12 @@ def yacc(method=default_lr, debug=yaccdebug, module=None, tabmodule=tab_module, - # used in the grammar - - if 'error' in tokens: -- print "yacc: Illegal token 'error'. Is a reserved word." -- raise YaccError,"Illegal token name" -+ print("yacc: Illegal token 'error'. Is a reserved word.") -+ raise YaccError("Illegal token name") - - for n in tokens: -- if Terminals.has_key(n): -- print "yacc: Warning. Token '%s' multiply defined." % n -+ if n in Terminals: -+ print("yacc: Warning. Token '%s' multiply defined." % n) - Terminals[n] = [ ] - - Terminals['error'] = [ ] -@@ -2061,13 +2066,13 @@ def yacc(method=default_lr, debug=yaccdebug, module=None, tabmodule=tab_module, - # Get the precedence map (if any) - prec = ldict.get("precedence",None) - if prec: -- if not (isinstance(prec,types.ListType) or isinstance(prec,types.TupleType)): -- raise YaccError,"precedence must be a list or tuple." -+ if not (isinstance(prec,list) or isinstance(prec,tuple)): -+ raise YaccError("precedence must be a list or tuple.") - add_precedence(prec) -- Signature.update(repr(prec)) -+ Signature.update(util.encode_input(repr(prec))) - - for n in tokens: -- if not Precedence.has_key(n): -+ if n not in Precedence: - Precedence[n] = ('right',0) # Default, right associative, 0 precedence - - # Look for error handler -@@ -2078,17 +2083,17 @@ def yacc(method=default_lr, debug=yaccdebug, module=None, tabmodule=tab_module, - elif isinstance(ef, types.MethodType): - ismethod = 1 - else: -- raise YaccError,"'p_error' defined, but is not a function or method." -- eline = ef.func_code.co_firstlineno -- efile = ef.func_code.co_filename -+ raise YaccError("'p_error' defined, but is not a function or method.") -+ eline = ef.__code__.co_firstlineno -+ efile = ef.__code__.co_filename - files[efile] = None - -- if (ef.func_code.co_argcount != 1+ismethod): -- raise YaccError,"%s:%d: p_error() requires 1 argument." % (efile,eline) -+ if (ef.__code__.co_argcount != 1+ismethod): -+ raise YaccError("%s:%d: p_error() requires 1 argument." % (efile,eline)) - global Errorfunc - Errorfunc = ef - else: -- print "yacc: Warning. no p_error() function is defined." -+ print("yacc: Warning. no p_error() function is defined.") - - # Get the list of built-in functions with p_ prefix - symbols = [ldict[f] for f in ldict.keys() -@@ -2097,27 +2102,27 @@ def yacc(method=default_lr, debug=yaccdebug, module=None, tabmodule=tab_module, - - # Check for non-empty symbols - if len(symbols) == 0: -- raise YaccError,"no rules of the form p_rulename are defined." -+ raise YaccError("no rules of the form p_rulename are defined.") - - # Sort the symbols by line number -- symbols.sort(lambda x,y: cmp(x.func_code.co_firstlineno,y.func_code.co_firstlineno)) -+ symbols.sort(key=lambda x: x.__code__.co_firstlineno) - - # Add all of the symbols to the grammar - for f in symbols: - if (add_function(f)) < 0: - error += 1 - else: -- files[f.func_code.co_filename] = None -+ files[f.__code__.co_filename] = None - - # Make a signature of the docstrings - for f in symbols: - if f.__doc__: -- Signature.update(f.__doc__) -+ Signature.update(util.encode_input(f.__doc__)) - - lr_init_vars() - - if error: -- raise YaccError,"Unable to construct parser." -+ raise YaccError("Unable to construct parser.") - - if not lr_read_tables(tabmodule): - -@@ -2129,8 +2134,8 @@ def yacc(method=default_lr, debug=yaccdebug, module=None, tabmodule=tab_module, - # Validate dictionary - validate_dict(ldict) - -- if start and not Prodnames.has_key(start): -- raise YaccError,"Bad starting symbol '%s'" % start -+ if start and start not in Prodnames: -+ raise YaccError("Bad starting symbol '%s'" % start) - - augment_grammar(start) - error = verify_productions(cycle_check=check_recursion) -@@ -2138,7 +2143,7 @@ def yacc(method=default_lr, debug=yaccdebug, module=None, tabmodule=tab_module, - if (type(f) in (types.FunctionType,types.MethodType) and ldict[f].__name__[:2] != 'p_')] - - if error: -- raise YaccError,"Unable to construct parser." -+ raise YaccError("Unable to construct parser.") - - build_lritems() - compute_first1() -@@ -2147,7 +2152,7 @@ def yacc(method=default_lr, debug=yaccdebug, module=None, tabmodule=tab_module, - if method in ['SLR','LALR']: - lr_parse_table(method) - else: -- raise YaccError, "Unknown parsing method '%s'" % method -+ raise YaccError("Unknown parsing method '%s'" % method) - - if write_tables: - lr_write_tables(tabmodule,outputdir) -@@ -2159,8 +2164,8 @@ def yacc(method=default_lr, debug=yaccdebug, module=None, tabmodule=tab_module, - f.write("\n\n") - f.write(_vf.getvalue()) - f.close() -- except IOError,e: -- print "yacc: can't create '%s'" % debugfile,e -+ except IOError as e: -+ print("yacc: can't create '%s'" % debugfile,e) - - # Made it here. Create a parser object and set up its internal state. - # Set global parse() method to bound method of parser object. -@@ -2205,5 +2210,5 @@ def yacc_cleanup(): - - # Stub that raises an error if parsing is attempted without first calling yacc() - def parse(*args,**kwargs): -- raise YaccError, "yacc: No parser built with yacc()" -+ raise YaccError("yacc: No parser built with yacc()") - -diff --git a/sepolgen-1.2.2/tests/test_access.py b/sepolgen-1.2.2/tests/test_access.py -index fec699e..d45a823 100644 ---- a/sepolgen-1.2.2/tests/test_access.py -+++ b/sepolgen-1.2.2/tests/test_access.py -@@ -32,7 +32,7 @@ class TestAccessVector(unittest.TestCase): - self.assertEqual(a.obj_class, None) - self.assertTrue(isinstance(a.perms, refpolicy.IdSet)) - self.assertTrue(isinstance(a.audit_msgs, type([]))) -- self.assertEquals(len(a.audit_msgs), 0) -+ self.assertEqual(len(a.audit_msgs), 0) - - # Construction from a list - a = access.AccessVector() -@@ -72,8 +72,10 @@ class TestAccessVector(unittest.TestCase): - self.assertEqual(l[0], "foo") - self.assertEqual(l[1], "bar") - self.assertEqual(l[2], "file") -- self.assertEqual(l[3], "read") -- self.assertEqual(l[4], "write") -+ perms = l[3:] -+ perms.sort() -+ self.assertEqual(perms[0], "read") -+ self.assertEqual(perms[1], "write") - - def test_to_string(self): - a = access.AccessVector() -@@ -82,8 +84,21 @@ class TestAccessVector(unittest.TestCase): - a.obj_class = "file" - a.perms.update(["read", "write"]) - -- self.assertEquals(str(a), "allow foo bar:file { read write };") -- self.assertEquals(a.to_string(), "allow foo bar:file { read write };") -+ first, second = str(a).split(':') -+ self.assertEqual(first, "allow foo bar") -+ second = second.split(' ') -+ second.sort() -+ expected = "file { read write };".split(' ') -+ expected.sort() -+ self.assertEqual(second, expected) -+ -+ first, second = a.to_string().split(':') -+ self.assertEqual(first, "allow foo bar") -+ second = second.split(' ') -+ second.sort() -+ expected = "file { read write };".split(' ') -+ expected.sort() -+ self.assertEqual(second, expected) - - def test_cmp(self): - a = access.AccessVector() -@@ -98,36 +113,38 @@ class TestAccessVector(unittest.TestCase): - b.obj_class = "file" - b.perms.update(["read", "write"]) - -- self.assertEquals(a, b) -+ self.assertEqual(a, b) - - # Source Type - b.src_type = "baz" -- self.assertEquals(cmp(a, b), 1) -+ self.assertNotEqual(a, b) -+ self.assertTrue(a > b) - - b.src_type = "gaz" -- self.assertEquals(cmp(a, b), -1) -+ self.assertNotEqual(a, b) -+ self.assertTrue(a < b) - - # Target Type - b.src_type = "foo" - b.tgt_type = "aar" -- self.assertEquals(cmp(a, b), 1) -+ self.assertNotEqual(a, b) -+ self.assertTrue(a > b) - - b.tgt_type = "gaz" -- self.assertEquals(cmp(a, b), -1) -+ self.assertNotEqual(a, b) -+ self.assertTrue(a < b) - - # Perms - b.tgt_type = "bar" - b.perms = refpolicy.IdSet(["read"]) -- ret = cmp(a, b) -- self.assertEquals(ret, 1) -+ self.assertNotEqual(a, b) -+ self.assertTrue(a > b) - - b.perms = refpolicy.IdSet(["read", "write", "append"]) -- ret = cmp(a, b) -- self.assertEquals(ret, -1) -+ self.assertNotEqual(a, b) - - b.perms = refpolicy.IdSet(["read", "append"]) -- ret = cmp(a, b) -- self.assertEquals(ret, 1) -+ self.assertNotEqual(a, b) - - class TestUtilFunctions(unittest.TestCase): - def test_is_idparam(self): -@@ -149,7 +166,7 @@ class TestUtilFunctions(unittest.TestCase): - rule.perms.add("write") - - avs = access.avrule_to_access_vectors(rule) -- self.assertEquals(len(avs), 8) -+ self.assertEqual(len(avs), 8) - comps = [("foo", "what", "dir"), - ("foo", "what", "file"), - ("foo", "bar", "dir"), -@@ -160,15 +177,15 @@ class TestUtilFunctions(unittest.TestCase): - ("baz", "bar", "file")] - status = [False] * 8 - for av in access.avrule_to_access_vectors(rule): -- self.assertEquals(av.perms, refpolicy.IdSet(["read", "write"])) -- for i in xrange(len(comps)): -+ self.assertEqual(av.perms, refpolicy.IdSet(["read", "write"])) -+ for i in range(len(comps)): - if comps[i][0] == av.src_type and \ - comps[i][1] == av.tgt_type and \ - comps[i][2] == av.obj_class: - status[i] = True - - for s in status: -- self.assertEquals(s, True) -+ self.assertEqual(s, True) - - - class TestAccessVectorSet(unittest.TestCase): -@@ -203,18 +220,18 @@ class TestAccessVectorSet(unittest.TestCase): - ("baz", "bar", "file")] - status = [False] * 8 - for av in self.s: -- self.assertEquals(av.perms, refpolicy.IdSet(["read", "write"])) -- for i in xrange(len(comps)): -+ self.assertEqual(av.perms, refpolicy.IdSet(["read", "write"])) -+ for i in range(len(comps)): - if comps[i][0] == av.src_type and \ - comps[i][1] == av.tgt_type and \ - comps[i][2] == av.obj_class: - status[i] = True - - for s in status: -- self.assertEquals(s, True) -+ self.assertEqual(s, True) - - def test_len(self): -- self.assertEquals(len(self.s), 8) -+ self.assertEqual(len(self.s), 8) - - def test_list(self): - a = access.AccessVectorSet() -@@ -223,15 +240,22 @@ class TestAccessVectorSet(unittest.TestCase): - a.add("what", "bar", "file", refpolicy.IdSet(["read", "write"])) - - avl = a.to_list() -+ avl.sort() - - test_l = [['what','bar','file','read','write'], - ['$1','foo','file','read','write'], - ['$1','bar','file','read','write']] -+ test_l.sort() - - for a,b in zip(test_l, avl): - self.assertEqual(len(a), len(b)) -- for x,y in zip(a,b): -+ for x,y in list(zip(a,b))[:3]: - self.assertEqual(x, y) -+ perms1 = a[3:] -+ perms2 = b[3:] -+ perms1.sort() -+ perms2.sort() -+ self.assertEqual(perms1, perms2) - - b = access.AccessVectorSet() - b.from_list(avl) -diff --git a/sepolgen-1.2.2/tests/test_audit.py b/sepolgen-1.2.2/tests/test_audit.py -index 7b74220..6379954 100644 ---- a/sepolgen-1.2.2/tests/test_audit.py -+++ b/sepolgen-1.2.2/tests/test_audit.py -@@ -60,29 +60,29 @@ class TestAVCMessage(unittest.TestCase): - def test_defs(self): - avc = sepolgen.audit.AVCMessage(audit1) - sc = sepolgen.refpolicy.SecurityContext() -- self.assertEquals(avc.scontext, sc) -- self.assertEquals(avc.tcontext, sc) -- self.assertEquals(avc.tclass, "") -- self.assertEquals(avc.accesses, []) -+ self.assertEqual(avc.scontext, sc) -+ self.assertEqual(avc.tcontext, sc) -+ self.assertEqual(avc.tclass, "") -+ self.assertEqual(avc.accesses, []) - - def test_granted(self): - avc = sepolgen.audit.AVCMessage(granted1) - avc.from_split_string(granted1.split()) - -- self.assertEquals(avc.scontext.user, "user_u") -- self.assertEquals(avc.scontext.role, "system_r") -- self.assertEquals(avc.scontext.type, "unconfined_t") -- self.assertEquals(avc.scontext.level, "s0") -+ self.assertEqual(avc.scontext.user, "user_u") -+ self.assertEqual(avc.scontext.role, "system_r") -+ self.assertEqual(avc.scontext.type, "unconfined_t") -+ self.assertEqual(avc.scontext.level, "s0") - -- self.assertEquals(avc.tcontext.user, "user_u") -- self.assertEquals(avc.tcontext.role, "object_r") -- self.assertEquals(avc.tcontext.type, "user_home_t") -- self.assertEquals(avc.tcontext.level, "s0") -+ self.assertEqual(avc.tcontext.user, "user_u") -+ self.assertEqual(avc.tcontext.role, "object_r") -+ self.assertEqual(avc.tcontext.type, "user_home_t") -+ self.assertEqual(avc.tcontext.level, "s0") - -- self.assertEquals(avc.tclass, "file") -- self.assertEquals(avc.accesses, ["getattr"]) -+ self.assertEqual(avc.tclass, "file") -+ self.assertEqual(avc.accesses, ["getattr"]) - -- self.assertEquals(avc.denial, False) -+ self.assertEqual(avc.denial, False) - - - def test_from_split_string(self): -@@ -91,54 +91,54 @@ class TestAVCMessage(unittest.TestCase): - recs = audit1.split() - avc.from_split_string(recs) - -- self.assertEquals(avc.header, "audit(1158064002.046:4):") -- self.assertEquals(avc.scontext.user, "user_u") -- self.assertEquals(avc.scontext.role, "system_r") -- self.assertEquals(avc.scontext.type, "bluetooth_helper_t") -- self.assertEquals(avc.scontext.level, "s0-s0:c0") -+ self.assertEqual(avc.header, "audit(1158064002.046:4):") -+ self.assertEqual(avc.scontext.user, "user_u") -+ self.assertEqual(avc.scontext.role, "system_r") -+ self.assertEqual(avc.scontext.type, "bluetooth_helper_t") -+ self.assertEqual(avc.scontext.level, "s0-s0:c0") - -- self.assertEquals(avc.tcontext.user, "system_u") -- self.assertEquals(avc.tcontext.role, "object_r") -- self.assertEquals(avc.tcontext.type, "xdm_tmp_t") -- self.assertEquals(avc.tcontext.level, "s0") -+ self.assertEqual(avc.tcontext.user, "system_u") -+ self.assertEqual(avc.tcontext.role, "object_r") -+ self.assertEqual(avc.tcontext.type, "xdm_tmp_t") -+ self.assertEqual(avc.tcontext.level, "s0") - -- self.assertEquals(avc.tclass, "file") -- self.assertEquals(avc.accesses, ["read"]) -+ self.assertEqual(avc.tclass, "file") -+ self.assertEqual(avc.accesses, ["read"]) - -- self.assertEquals(avc.comm, "bluez-pin") -+ self.assertEqual(avc.comm, "bluez-pin") - - -- self.assertEquals(avc.denial, True) -+ self.assertEqual(avc.denial, True) - - # audit daemon message - avc = sepolgen.audit.AVCMessage(audit2) - recs = audit2.split() - avc.from_split_string(recs) - -- self.assertEquals(avc.header, "audit(1158584779.745:708):") -- self.assertEquals(avc.scontext.user, "user_u") -- self.assertEquals(avc.scontext.role, "system_r") -- self.assertEquals(avc.scontext.type, "vpnc_t") -- self.assertEquals(avc.scontext.level, "s0") -+ self.assertEqual(avc.header, "audit(1158584779.745:708):") -+ self.assertEqual(avc.scontext.user, "user_u") -+ self.assertEqual(avc.scontext.role, "system_r") -+ self.assertEqual(avc.scontext.type, "vpnc_t") -+ self.assertEqual(avc.scontext.level, "s0") - -- self.assertEquals(avc.tcontext.user, "user_u") -- self.assertEquals(avc.tcontext.role, "system_r") -- self.assertEquals(avc.tcontext.type, "vpnc_t") -- self.assertEquals(avc.tcontext.level, "s0") -+ self.assertEqual(avc.tcontext.user, "user_u") -+ self.assertEqual(avc.tcontext.role, "system_r") -+ self.assertEqual(avc.tcontext.type, "vpnc_t") -+ self.assertEqual(avc.tcontext.level, "s0") - -- self.assertEquals(avc.tclass, "capability") -- self.assertEquals(avc.accesses, ["dac_read_search"]) -+ self.assertEqual(avc.tclass, "capability") -+ self.assertEqual(avc.accesses, ["dac_read_search"]) - -- self.assertEquals(avc.comm, "sh") -+ self.assertEqual(avc.comm, "sh") - -- self.assertEquals(avc.denial, True) -+ self.assertEqual(avc.denial, True) - - class TestPathMessage(unittest.TestCase): - def test_from_split_string(self): - path = sepolgen.audit.PathMessage(path1) - recs = path1.split() - path.from_split_string(recs) -- self.assertEquals(path.path, "/usr/lib/sa/sa1") -+ self.assertEqual(path.path, "/usr/lib/sa/sa1") - - # TODO - add tests for the other message types - -@@ -149,27 +149,28 @@ class TestAuditParser(unittest.TestCase): - def test_parse_string(self): - a = sepolgen.audit.AuditParser() - a.parse_string(log1) -- self.assertEquals(len(a.avc_msgs), 11) -- self.assertEquals(len(a.compute_sid_msgs), 0) -- self.assertEquals(len(a.invalid_msgs), 0) -- self.assertEquals(len(a.policy_load_msgs), 0) -- self.assertEquals(len(a.path_msgs), 1) -+ self.assertEqual(len(a.avc_msgs), 11) -+ self.assertEqual(len(a.compute_sid_msgs), 0) -+ self.assertEqual(len(a.invalid_msgs), 0) -+ self.assertEqual(len(a.policy_load_msgs), 0) -+ self.assertEqual(len(a.path_msgs), 1) - - def test_post_process(self): - a = sepolgen.audit.AuditParser() - a.parse_string(log2) -- self.assertEquals(len(a.avc_msgs), 2) -- self.assertEquals(a.avc_msgs[0].path, "/usr/lib/sa/sa1") -- self.assertEquals(a.avc_msgs[1].path, "/usr/lib/sa/sa1") -+ self.assertEqual(len(a.avc_msgs), 2) -+ self.assertEqual(a.avc_msgs[0].path, "/usr/lib/sa/sa1") -+ self.assertEqual(a.avc_msgs[1].path, "/usr/lib/sa/sa1") - - def test_parse_file(self): - f = open("audit.txt") - a = sepolgen.audit.AuditParser() - a.parse_file(f) -- self.assertEquals(len(a.avc_msgs), 21) -- self.assertEquals(len(a.compute_sid_msgs), 0) -- self.assertEquals(len(a.invalid_msgs), 0) -- self.assertEquals(len(a.policy_load_msgs), 0) -+ f.close() -+ self.assertEqual(len(a.avc_msgs), 21) -+ self.assertEqual(len(a.compute_sid_msgs), 0) -+ self.assertEqual(len(a.invalid_msgs), 0) -+ self.assertEqual(len(a.policy_load_msgs), 0) - - class TestGeneration(unittest.TestCase): - def test_generation(self): -diff --git a/sepolgen-1.2.2/tests/test_interfaces.py b/sepolgen-1.2.2/tests/test_interfaces.py -index b589bdf..a55f7db 100644 ---- a/sepolgen-1.2.2/tests/test_interfaces.py -+++ b/sepolgen-1.2.2/tests/test_interfaces.py -@@ -202,11 +202,11 @@ class TestInterfaceSet(unittest.TestCase): - i = interfaces.InterfaceSet() - i.add_headers(h) - -- self.assertEquals(len(i.interfaces), 1) -+ self.assertEqual(len(i.interfaces), 1) - for key, interface in i.interfaces.items(): -- self.assertEquals(key, interface.name) -- self.assertEquals(key, "foo") -- self.assertEquals(len(interface.access), 2) -+ self.assertEqual(key, interface.name) -+ self.assertEqual(key, "foo") -+ self.assertEqual(len(interface.access), 2) - - # Check the access vectors - comp_avs = [["$1", "usr_t", "dir", "create", "add_name"], -@@ -215,21 +215,21 @@ class TestInterfaceSet(unittest.TestCase): - self.assertTrue(ret) - - # Check the params -- self.assertEquals(len(interface.params), 1) -+ self.assertEqual(len(interface.params), 1) - for param in interface.params.values(): -- self.assertEquals(param.type, refpolicy.SRC_TYPE) -- self.assertEquals(param.name, "$1") -- self.assertEquals(param.num, 1) -- self.assertEquals(param.required, True) -+ self.assertEqual(param.type, refpolicy.SRC_TYPE) -+ self.assertEqual(param.name, "$1") -+ self.assertEqual(param.num, 1) -+ self.assertEqual(param.required, True) - - def test_expansion(self): - h = refparser.parse(test_expansion) - i = interfaces.InterfaceSet() - i.add_headers(h) - -- self.assertEquals(len(i.interfaces), 3) -+ self.assertEqual(len(i.interfaces), 3) - for key, interface in i.interfaces.items(): -- self.assertEquals(key, interface.name) -+ self.assertEqual(key, interface.name) - if key == "foo": - comp_avs = [["$1", "usr_t", "dir", "create", "add_name"], - ["$1", "usr_t", "file", "read", "write"]] -@@ -268,6 +268,7 @@ class TestInterfaceSet(unittest.TestCase): - i2 = interfaces.InterfaceSet() - f = open("output") - i2.from_file(f) -+ f.close() - if_status = [False, False, False] - for ifv in i2.interfaces.values(): - if ifv.name == "files_search_usr": -@@ -277,6 +278,6 @@ class TestInterfaceSet(unittest.TestCase): - if ifv.name == "files_exec_usr_files": - if_status[2] = True - -- self.assertEquals(if_status[0], True) -- self.assertEquals(if_status[1], True) -- self.assertEquals(if_status[2], True) -+ self.assertEqual(if_status[0], True) -+ self.assertEqual(if_status[1], True) -+ self.assertEqual(if_status[2], True) -diff --git a/sepolgen-1.2.2/tests/test_matching.py b/sepolgen-1.2.2/tests/test_matching.py -index 161e001..3ecb80b 100644 ---- a/sepolgen-1.2.2/tests/test_matching.py -+++ b/sepolgen-1.2.2/tests/test_matching.py -@@ -33,15 +33,15 @@ class TestMatch(unittest.TestCase): - b.dist = 100 - b.info_dir_change = True - -- self.assertEquals(a, b) -+ self.assertEqual(a, b) - b.info_dir_change = False -- self.assertEquals(cmp(a, b), 1) -- self.assertEquals(cmp(b, a), -1) -+ self.assertTrue((a > b)) -+ self.assertTrue((b < a)) - - b.dist = 200 - -- self.assertEquals(cmp(a, b), -1) -- self.assertEquals(cmp(b, a), 1) -+ self.assertTrue((a < b)) -+ self.assertTrue((b > a)) - - class TestMatchList(unittest.TestCase): - def test_append(self): -@@ -90,7 +90,7 @@ class TestMatchList(unittest.TestCase): - for x, y in zip(l, ml): - self.assertEqual(x, y) - -- self.assertEquals(ml.best(), c) -+ self.assertEqual(ml.best(), c) - - - test_expansion = """ -diff --git a/sepolgen-1.2.2/tests/test_objectmodel.py b/sepolgen-1.2.2/tests/test_objectmodel.py -index 3db241c..b503672 100644 ---- a/sepolgen-1.2.2/tests/test_objectmodel.py -+++ b/sepolgen-1.2.2/tests/test_objectmodel.py -@@ -25,20 +25,21 @@ class TestInfoFlow(unittest.TestCase): - info = sepolgen.objectmodel.PermMappings() - fd = open("perm_map") - info.from_file(fd) -+ fd.close() - - pm = info.get("filesystem", "mount") -- self.assertEquals(pm.perm, "mount") -- self.assertEquals(pm.dir, sepolgen.objectmodel.FLOW_WRITE) -- self.assertEquals(pm.weight, 1) -+ self.assertEqual(pm.perm, "mount") -+ self.assertEqual(pm.dir, sepolgen.objectmodel.FLOW_WRITE) -+ self.assertEqual(pm.weight, 1) - - self.assertRaises(KeyError, info.get, "filesystem", "foo") - - pm = info.getdefault("filesystem", "foo") -- self.assertEquals(pm.perm, "foo") -- self.assertEquals(pm.dir, sepolgen.objectmodel.FLOW_BOTH) -- self.assertEquals(pm.weight, 5) -+ self.assertEqual(pm.perm, "foo") -+ self.assertEqual(pm.dir, sepolgen.objectmodel.FLOW_BOTH) -+ self.assertEqual(pm.weight, 5) - - pm = info.getdefault("foo", "bar") -- self.assertEquals(pm.perm, "bar") -- self.assertEquals(pm.dir, sepolgen.objectmodel.FLOW_BOTH) -- self.assertEquals(pm.weight, 5) -+ self.assertEqual(pm.perm, "bar") -+ self.assertEqual(pm.dir, sepolgen.objectmodel.FLOW_BOTH) -+ self.assertEqual(pm.weight, 5) -diff --git a/sepolgen-1.2.2/tests/test_refparser.py b/sepolgen-1.2.2/tests/test_refparser.py -index 3fe6d79..d7db145 100644 ---- a/sepolgen-1.2.2/tests/test_refparser.py -+++ b/sepolgen-1.2.2/tests/test_refparser.py -@@ -107,12 +107,12 @@ class TestParser(unittest.TestCase): - h = refparser.parse(interface_example) - #print "" - #refpolicy.print_tree(h) -- #self.assertEquals(len(h.interfaces), 3) -+ #self.assertEqual(len(h.interfaces), 3) - - name = "files_search_usr" - #i = h.interfaces[name] -- #self.assertEquals(i.name, name) -- #self.assertEquals(len(i.rules), 1) -+ #self.assertEqual(i.name, name) -+ #self.assertEqual(len(i.rules), 1) - #rule = i.rules[0] - #self.assertTrue(isinstance(rule, refpolicy.AVRule)) - -diff --git a/sepolgen-1.2.2/tests/test_refpolicy.py b/sepolgen-1.2.2/tests/test_refpolicy.py -index 8c87189..16e6680 100644 ---- a/sepolgen-1.2.2/tests/test_refpolicy.py -+++ b/sepolgen-1.2.2/tests/test_refpolicy.py -@@ -24,10 +24,14 @@ import selinux - class TestIdSet(unittest.TestCase): - def test_set_to_str(self): - s = refpolicy.IdSet(["read", "write", "getattr"]) -- self.assertEquals(s.to_space_str(), "{ read write getattr }") -+ s = s.to_space_str().split(' ') -+ s.sort() -+ expected = "{ read write getattr }".split(' ') -+ expected.sort() -+ self.assertEqual(s, expected) - s = refpolicy.IdSet() - s.add("read") -- self.assertEquals(s.to_space_str(), "read") -+ self.assertEqual(s.to_space_str(), "read") - - class TestSecurityContext(unittest.TestCase): - def test_init(self): -@@ -38,25 +42,25 @@ class TestSecurityContext(unittest.TestCase): - context = "user_u:object_r:foo_t" - sc = refpolicy.SecurityContext() - sc.from_string(context) -- self.assertEquals(sc.user, "user_u") -- self.assertEquals(sc.role, "object_r") -- self.assertEquals(sc.type, "foo_t") -- self.assertEquals(sc.level, None) -+ self.assertEqual(sc.user, "user_u") -+ self.assertEqual(sc.role, "object_r") -+ self.assertEqual(sc.type, "foo_t") -+ self.assertEqual(sc.level, None) - if selinux.is_selinux_mls_enabled(): -- self.assertEquals(str(sc), context + ":s0") -+ self.assertEqual(str(sc), context + ":s0") - else: -- self.assertEquals(str(sc), context) -- self.assertEquals(sc.to_string(default_level="s1"), context + ":s1") -+ self.assertEqual(str(sc), context) -+ self.assertEqual(sc.to_string(default_level="s1"), context + ":s1") - - context = "user_u:object_r:foo_t:s0-s0:c0-c255" - sc = refpolicy.SecurityContext() - sc.from_string(context) -- self.assertEquals(sc.user, "user_u") -- self.assertEquals(sc.role, "object_r") -- self.assertEquals(sc.type, "foo_t") -- self.assertEquals(sc.level, "s0-s0:c0-c255") -- self.assertEquals(str(sc), context) -- self.assertEquals(sc.to_string(), context) -+ self.assertEqual(sc.user, "user_u") -+ self.assertEqual(sc.role, "object_r") -+ self.assertEqual(sc.type, "foo_t") -+ self.assertEqual(sc.level, "s0-s0:c0-c255") -+ self.assertEqual(str(sc), context) -+ self.assertEqual(sc.to_string(), context) - - sc = refpolicy.SecurityContext() - self.assertRaises(ValueError, sc.from_string, "abc") -@@ -67,20 +71,20 @@ class TestSecurityContext(unittest.TestCase): - sc3 = refpolicy.SecurityContext("user_u:object_r:foo_t:s0") - sc4 = refpolicy.SecurityContext("user_u:object_r:bar_t") - -- self.assertEquals(sc1, sc2) -- self.assertNotEquals(sc1, sc3) -- self.assertNotEquals(sc1, sc4) -+ self.assertEqual(sc1, sc2) -+ self.assertNotEqual(sc1, sc3) -+ self.assertNotEqual(sc1, sc4) - - class TestObjecClass(unittest.TestCase): - def test_init(self): - o = refpolicy.ObjectClass(name="file") -- self.assertEquals(o.name, "file") -+ self.assertEqual(o.name, "file") - self.assertTrue(isinstance(o.perms, set)) - - class TestAVRule(unittest.TestCase): - def test_init(self): - a = refpolicy.AVRule() -- self.assertEquals(a.rule_type, a.ALLOW) -+ self.assertEqual(a.rule_type, a.ALLOW) - self.assertTrue(isinstance(a.src_types, set)) - self.assertTrue(isinstance(a.tgt_types, set)) - self.assertTrue(isinstance(a.obj_classes, set)) -@@ -92,7 +96,7 @@ class TestAVRule(unittest.TestCase): - a.tgt_types.add("bar_t") - a.obj_classes.add("file") - a.perms.add("read") -- self.assertEquals(a.to_string(), "allow foo_t bar_t:file read;") -+ self.assertEqual(a.to_string(), "allow foo_t bar_t:file read;") - - a.rule_type = a.DONTAUDIT - a.src_types.add("user_t") -@@ -100,17 +104,20 @@ class TestAVRule(unittest.TestCase): - a.obj_classes.add("lnk_file") - a.perms.add("write") - # This test might need to go because set ordering is not guaranteed -- self.assertEquals(a.to_string(), -- "dontaudit { foo_t user_t } { user_home_t bar_t }:{ lnk_file file } { read write };") -+ a = a.to_string().split(' ') -+ a.sort() -+ b = "dontaudit { foo_t user_t } { user_home_t bar_t }:{ lnk_file file } { read write };".split(' ') -+ b.sort() -+ self.assertEqual(a, b) - - class TestTypeRule(unittest.TestCase): - def test_init(self): - a = refpolicy.TypeRule() -- self.assertEquals(a.rule_type, a.TYPE_TRANSITION) -+ self.assertEqual(a.rule_type, a.TYPE_TRANSITION) - self.assertTrue(isinstance(a.src_types, set)) - self.assertTrue(isinstance(a.tgt_types, set)) - self.assertTrue(isinstance(a.obj_classes, set)) -- self.assertEquals(a.dest_type, "") -+ self.assertEqual(a.dest_type, "") - - def test_to_string(self): - a = refpolicy.TypeRule() -@@ -118,7 +125,7 @@ class TestTypeRule(unittest.TestCase): - a.tgt_types.add("bar_exec_t") - a.obj_classes.add("process") - a.dest_type = "bar_t" -- self.assertEquals(a.to_string(), "type_transition foo_t bar_exec_t:process bar_t;") -+ self.assertEqual(a.to_string(), "type_transition foo_t bar_exec_t:process bar_t;") - - - class TestParseNode(unittest.TestCase):