Hello community,

here is the log from the commit of package policycoreutils for 
openSUSE:Leap:15.2 checked in at 2020-02-29 17:15:21
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/policycoreutils (Old)
 and      /work/SRC/openSUSE:Leap:15.2/.policycoreutils.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "policycoreutils"

Sat Feb 29 17:15:21 2020 rev:26 rq:779852 version:2.8

Changes:
--------
--- /work/SRC/openSUSE:Leap:15.2/policycoreutils/policycoreutils.changes        
2020-02-06 21:37:02.664120725 +0100
+++ 
/work/SRC/openSUSE:Leap:15.2/.policycoreutils.new.26092/policycoreutils.changes 
    2020-02-29 17:15:27.168919893 +0100
@@ -1,0 +2,6 @@
+Tue Feb  4 16:11:48 UTC 2020 - Johannes Segitz <[email protected]>
+
+- Added seobject_late_init.patch to prevent failures when loading 
+  seobject on systems without policies (bsc#1162674)
+
+-------------------------------------------------------------------

New:
----
  seobject_late_init.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ policycoreutils.spec ++++++
--- /var/tmp/diff_new_pack.KEk0Xq/_old  2020-02-29 17:15:28.060921731 +0100
+++ /var/tmp/diff_new_pack.KEk0Xq/_new  2020-02-29 17:15:28.060921731 +0100
@@ -41,6 +41,7 @@
 Patch0:         make_targets.patch
 Patch1:         python3.patch
 Patch2:         chcat_join.patch
+Patch3:         seobject_late_init.patch
 BuildRequires:  audit-devel >= %{libaudit_ver}
 BuildRequires:  bison
 BuildRequires:  dbus-1-glib-devel
@@ -157,6 +158,7 @@
 %prep
 %setup -q -T -D -b 1 -n selinux-python-%{version}
 %patch2 -p1
+%patch3 -p1
 setools_python_pwd=`pwd`
 %setup -q -T -D -b 8 -n semodule-utils-%{version}
 semodule_utils_pwd=`pwd`

++++++ seobject_late_init.patch ++++++
Index: selinux-python-2.8/semanage/seobject.py
===================================================================
--- selinux-python-2.8.orig/semanage/seobject.py        2018-05-24 
18:21:09.000000000 +0000
+++ selinux-python-2.8/semanage/seobject.py     2020-02-04 16:11:06.886848929 
+0000
@@ -1043,13 +1043,14 @@ class seluserRecords(semanageRecords):
 
 
 class portRecords(semanageRecords):
-    try:
-        valid_types = list(list(sepolicy.info(sepolicy.ATTRIBUTE, 
"port_type"))[0]["types"])
-    except RuntimeError:
-        valid_types = []
+    valid_types = []
 
     def __init__(self, args = None):
         semanageRecords.__init__(self, args)
+        try:
+            valid_types = list(list(sepolicy.info(sepolicy.ATTRIBUTE, 
"port_type"))[0]["types"])
+        except RuntimeError:
+            pass
 
     def __genkey(self, port, proto):
         if proto == "tcp":
@@ -1807,14 +1808,15 @@ class ibendportRecords(semanageRecords):
             print(rec)
 
 class nodeRecords(semanageRecords):
-    try:
-        valid_types = list(list(sepolicy.info(sepolicy.ATTRIBUTE, 
"node_type"))[0]["types"])
-    except RuntimeError:
-        valid_types = []
+    valid_types = []
 
     def __init__(self, args = None):
         semanageRecords.__init__(self, args)
         self.protocol = ["ipv4", "ipv6"]
+        try:
+            valid_types = list(list(sepolicy.info(sepolicy.ATTRIBUTE, 
"node_type"))[0]["types"])
+        except RuntimeError:
+            pass
 
     def validate(self, addr, mask, protocol):
         newaddr = addr
@@ -2238,15 +2240,16 @@ class interfaceRecords(semanageRecords):
 
 
 class fcontextRecords(semanageRecords):
-    try:
-        valid_types = list(list(sepolicy.info(sepolicy.ATTRIBUTE, 
"file_type"))[0]["types"])
-        valid_types += list(list(sepolicy.info(sepolicy.ATTRIBUTE, 
"device_node"))[0]["types"])
-        valid_types.append("<<none>>")
-    except RuntimeError:
-        valid_types = []
+    valid_types = []
 
     def __init__(self, args = None):
         semanageRecords.__init__(self, args)
+        try:
+            valid_types = list(list(sepolicy.info(sepolicy.ATTRIBUTE, 
"file_type"))[0]["types"])
+            valid_types += list(list(sepolicy.info(sepolicy.ATTRIBUTE, 
"device_node"))[0]["types"])
+            valid_types.append("<<none>>")
+        except RuntimeError:
+            pass
         self.equiv = {}
         self.equiv_dist = {}
         self.equal_ind = False


Reply via email to