Skip to contentSkip to conversation

gui: Fix remove module in system-config-selinux

PATCH Applied Petr Lautrbach 2 participants 2 messages Sep 24, 2019 – Sep 26, 2019 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 <[email protected]>

---
 gui/modulesPage.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
gui/modulesPage.py +2 -1
index cb856b2d..0584acf9 100644
@@ -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)
Signature · 1 line
2.23.0
#1 lore raw
Quoted 10 lines · Petr Lautrbach

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 <[email protected]>

Thanks, applied.

Quoted 21 lines
---
  gui/modulesPage.py | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
gui/modulesPage.py +2 -1
index cb856b2d..0584acf9 100644
@@ -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)