SELinux Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] gui: Fix remove module in system-config-selinux
@ 2019-09-24 19:12 Petr Lautrbach
  2019-09-26 12:54 ` Stephen Smalley
  0 siblings, 1 reply; 2+ messages in thread
From: Petr Lautrbach @ 2019-09-24 19:12 UTC (permalink / raw)
  To: selinux; +Cc: 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 <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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] gui: Fix remove module in system-config-selinux
  2019-09-24 19:12 [PATCH] gui: Fix remove module in system-config-selinux Petr Lautrbach
@ 2019-09-26 12:54 ` Stephen Smalley
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Smalley @ 2019-09-26 12:54 UTC (permalink / raw)
  To: Petr Lautrbach, selinux

On 9/24/19 3:12 PM, Petr Lautrbach wrote:
> 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>

Thanks, applied.

> ---
>   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)
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-24 19:12 [PATCH] gui: Fix remove module in system-config-selinux Petr Lautrbach
2019-09-26 12:54 ` Stephen Smalley

SELinux Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/selinux/0 selinux/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 selinux selinux/ https://lore.kernel.org/selinux \
		selinux@vger.kernel.org selinux@archiver.kernel.org
	public-inbox-index selinux

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.selinux


AGPL code for this site: git clone https://public-inbox.org/ public-inbox