From d6f96f416d880912870686ed5e0f9b172ee71432 Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Thu, 29 Aug 2019 10:08:55 +0200 Subject: [PATCH] gui: Fix remove module in system-config-selinux When a user tried to remove a policy module with priority other than 400 via GUI, it failed with a message: libsemanage.semanage_direct_remove_key: Unable to remove module somemodule at priority 400. (No such file or directory). This is fixed by calling "semodule -x PRIORITY -r NAME" instead of "semodule -r NAME". Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1740936 --- ...move-module-in-system-config-selinux.patch | 38 +++++++++++++++++++ policycoreutils.spec | 1 + 2 files changed, 39 insertions(+) create mode 100644 0025-gui-Fix-remove-module-in-system-config-selinux.patch diff --git a/0025-gui-Fix-remove-module-in-system-config-selinux.patch b/0025-gui-Fix-remove-module-in-system-config-selinux.patch new file mode 100644 index 0000000..57dec35 --- /dev/null +++ b/0025-gui-Fix-remove-module-in-system-config-selinux.patch @@ -0,0 +1,38 @@ +From eed9aca2fa1b5668b9ddca10cfe96695fa7d2b9f Mon Sep 17 00:00:00 2001 +From: Petr Lautrbach +Date: Thu, 29 Aug 2019 08:58:20 +0200 +Subject: [PATCH] gui: Fix remove module in system-config-selinux + +When a user tried to remove a policy module with priority other than 400 via +GUI, it failed with a message: + +libsemanage.semanage_direct_remove_key: Unable to remove module somemodule at priority 400. (No such file or directory). + +This is fixed by calling "semodule -x PRIORITY -r NAME" instead of +"semodule -r NAME". + +From Jono Hein +Signed-off-by: Petr Lautrbach +--- + gui/modulesPage.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/gui/modulesPage.py b/gui/modulesPage.py +index 26ac5404..35a0129b 100644 +--- a/gui/modulesPage.py ++++ b/gui/modulesPage.py +@@ -125,9 +125,10 @@ class modulesPage(semanagePage): + def delete(self): + store, iter = self.view.get_selection().get_selected() + module = store.get_value(iter, 0) ++ priority = store.get_value(iter, 1) + try: + self.wait() +- status, output = getstatusoutput("semodule -r %s" % module) ++ status, output = getstatusoutput("semodule -X %s -r %s" % (priority, module)) + self.ready() + if status != 0: + self.error(output) +-- +2.23.0 + diff --git a/policycoreutils.spec b/policycoreutils.spec index 51e9d20..0024616 100644 --- a/policycoreutils.spec +++ b/policycoreutils.spec @@ -62,6 +62,7 @@ Patch0021: 0021-python-semanage-Do-not-traceback-when-the-default-po.patch Patch0022: 0022-policycoreutils-fixfiles-Fix-B-F-onboot.patch Patch0023: 0023-policycoreutils-fixfiles-Force-full-relabel-when-SEL.patch Patch0024: 0024-policycoreutils-fixfiles-Fix-unbound-variable-proble.patch +Patch0025: 0025-gui-Fix-remove-module-in-system-config-selinux.patch Obsoletes: policycoreutils < 2.0.61-2 Conflicts: filesystem < 3, selinux-policy-base < 3.13.1-138