selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Petr Lautrbach <plautrba@redhat.com>
To: selinux@vger.kernel.org
Cc: Petr Lautrbach <plautrba@redhat.com>
Subject: [PATCH] gui: Fix remove module in system-config-selinux
Date: Tue, 24 Sep 2019 21:12:21 +0200	[thread overview]
Message-ID: <20190924191221.245789-1-plautrba@redhat.com> (raw)

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 <fredwacko40@hotmail.com>
Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
---
 gui/modulesPage.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gui/modulesPage.py b/gui/modulesPage.py
index cb856b2d..0584acf9 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


             reply	other threads:[~2019-09-24 19:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-24 19:12 Petr Lautrbach [this message]
2019-09-26 12:54 ` [PATCH] gui: Fix remove module in system-config-selinux Stephen Smalley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190924191221.245789-1-plautrba@redhat.com \
    --to=plautrba@redhat.com \
    --cc=selinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).