Skip to content

Commit

Permalink
gui: Fix remove module in system-config-selinux
Browse files Browse the repository at this point in the history
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]>
Signed-off-by: Petr Lautrbach <[email protected]>
  • Loading branch information
bachradsusi authored and stephensmalley committed Sep 26, 2019
1 parent f4e741a commit 5dfa95c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gui/modulesPage.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,10 @@ def new_module(self, args):
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)
Expand Down

0 comments on commit 5dfa95c

Please sign in to comment.