All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] policycoreutils/sepolicy/gui: fix current selinux state radiobutton
@ 2016-11-29  9:09 Vit Mojzis
  2016-11-29 14:02 ` Stephen Smalley
  0 siblings, 1 reply; 7+ messages in thread
From: Vit Mojzis @ 2016-11-29  9:09 UTC (permalink / raw)
  To: selinux

Radiobutton was always set to "Permissive" and couldn't be switched.
Update radiobutton together with status text in bottom left corner.

Signed-off-by: Vit Mojzis <vmojzis@redhat.com>
---
 python/sepolicy/sepolicy/gui.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/python/sepolicy/sepolicy/gui.py b/python/sepolicy/sepolicy/gui.py
index ee78e0c..3c5a9d2 100644
--- a/python/sepolicy/sepolicy/gui.py
+++ b/python/sepolicy/sepolicy/gui.py
@@ -2609,9 +2609,10 @@ class SELinuxGui():
     def set_enforce_text(self, value):
         if value:
             self.status_bar.push(self.context_id, _("System Status: Enforcing"))
+            self.current_status_enforcing.set_active(True)
         else:
             self.status_bar.push(self.context_id, _("System Status: Permissive"))
-        self.current_status_permissive.set_active(True)
+            self.current_status_permissive.set_active(True)
 
     def set_enforce(self, button):
         self.dbus.setenforce(button.get_active())
-- 
2.7.4

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

* Re: [PATCH] policycoreutils/sepolicy/gui: fix current selinux state radiobutton
  2016-11-29  9:09 [PATCH] policycoreutils/sepolicy/gui: fix current selinux state radiobutton Vit Mojzis
@ 2016-11-29 14:02 ` Stephen Smalley
       [not found]   ` <5717f0f3-0322-21b2-692e-c1c5fc8ac40f@redhat.com>
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Smalley @ 2016-11-29 14:02 UTC (permalink / raw)
  To: Vit Mojzis, selinux

On 11/29/2016 04:09 AM, Vit Mojzis wrote:
> Radiobutton was always set to "Permissive" and couldn't be switched.
> Update radiobutton together with status text in bottom left corner.
> 
> Signed-off-by: Vit Mojzis <vmojzis@redhat.com>

Thanks, applied.  However, sepolicy gui doesn't work for me (before or
after this change):
$ cd selinux
$ sudo make LIBDIR=/usr/lib64 SHLIBDIR=/lib64 install install-pywrap relabel
$ sepolicy gui
Traceback (most recent call last):
  File "/usr/bin/sepolicy", line 699, in <module>
    args.func(args)
  File "/usr/bin/sepolicy", line 327, in gui_run
    sepolicy.gui.SELinuxGui(args.domain, args.test)
  File "/usr/lib/python2.7/site-packages/sepolicy/gui.py", line 135, in
__init__
    builder.add_from_file(glade_file)
GLib.Error: g-file-error-quark: Failed to open file
'/usr/lib64/python2.7/site-packages/sepolicy/sepolicy.glade': No such
file or directory (4)

Are we failing to install the glade file properly in the Makefiles?
And does python/sepolicy/sepolicy/sepolicy.glade belong under gui/ instead?

> ---
>  python/sepolicy/sepolicy/gui.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/python/sepolicy/sepolicy/gui.py b/python/sepolicy/sepolicy/gui.py
> index ee78e0c..3c5a9d2 100644
> --- a/python/sepolicy/sepolicy/gui.py
> +++ b/python/sepolicy/sepolicy/gui.py
> @@ -2609,9 +2609,10 @@ class SELinuxGui():
>      def set_enforce_text(self, value):
>          if value:
>              self.status_bar.push(self.context_id, _("System Status: Enforcing"))
> +            self.current_status_enforcing.set_active(True)
>          else:
>              self.status_bar.push(self.context_id, _("System Status: Permissive"))
> -        self.current_status_permissive.set_active(True)
> +            self.current_status_permissive.set_active(True)
>  
>      def set_enforce(self, button):
>          self.dbus.setenforce(button.get_active())
> 

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

* Re: [PATCH] policycoreutils/sepolicy/gui: fix current selinux state radiobutton
       [not found]   ` <5717f0f3-0322-21b2-692e-c1c5fc8ac40f@redhat.com>
@ 2016-11-30 13:52     ` Stephen Smalley
  2016-11-30 14:24       ` Vit Mojzis
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Smalley @ 2016-11-30 13:52 UTC (permalink / raw)
  To: Vit Mojzis, SELinux

On 11/30/2016 08:44 AM, Vit Mojzis wrote:
> The glade file is installed properly, only
> python/sepolicy/sepolicy/gui.py is searching for it in the wrong place
> (lib64). Please find attached patch that should fix the issue.

Thanks, but now I get:
$ sepolicy gui

(sepolicy:18202): Gtk-WARNING **: Could not load image
'images/booleans.png': Failed to open file
'/usr/lib/python2.7/site-packages/sepolicy/images/booleans.png': No such
file or directory

(sepolicy:18202): Gtk-WARNING **: Overriding tab label for notebook
Traceback (most recent call last):
  File "/usr/bin/sepolicy", line 699, in <module>
    args.func(args)
  File "/usr/bin/sepolicy", line 327, in gui_run
    sepolicy.gui.SELinuxGui(args.domain, args.test)
  File "/usr/lib/python2.7/site-packages/sepolicy/gui.py", line 517, in
__init__
    path = sepolicy.find_entrypoint_path(entrypoint)
  File "/usr/lib/python2.7/site-packages/sepolicy/__init__.py", line
486, in find_entrypoint_path
    if exe.endswith("_exec_t") and exe not in exclude_list:
AttributeError: 'list' object has no attribute 'endswith'

> 
> 
> On 29.11.2016 15:02, Stephen Smalley wrote:
>> On 11/29/2016 04:09 AM, Vit Mojzis wrote:
>>> Radiobutton was always set to "Permissive" and couldn't be switched.
>>> Update radiobutton together with status text in bottom left corner.
>>>
>>> Signed-off-by: Vit Mojzis <vmojzis@redhat.com>
>> Thanks, applied.  However, sepolicy gui doesn't work for me (before or
>> after this change):
>> $ cd selinux
>> $ sudo make LIBDIR=/usr/lib64 SHLIBDIR=/lib64 install install-pywrap
>> relabel
>> $ sepolicy gui
>> Traceback (most recent call last):
>>    File "/usr/bin/sepolicy", line 699, in <module>
>>      args.func(args)
>>    File "/usr/bin/sepolicy", line 327, in gui_run
>>      sepolicy.gui.SELinuxGui(args.domain, args.test)
>>    File "/usr/lib/python2.7/site-packages/sepolicy/gui.py", line 135, in
>> __init__
>>      builder.add_from_file(glade_file)
>> GLib.Error: g-file-error-quark: Failed to open file
>> '/usr/lib64/python2.7/site-packages/sepolicy/sepolicy.glade': No such
>> file or directory (4)
>>
>> Are we failing to install the glade file properly in the Makefiles?
>> And does python/sepolicy/sepolicy/sepolicy.glade belong under gui/
>> instead?
>>
>>> ---
>>>   python/sepolicy/sepolicy/gui.py | 3 ++-
>>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/python/sepolicy/sepolicy/gui.py
>>> b/python/sepolicy/sepolicy/gui.py
>>> index ee78e0c..3c5a9d2 100644
>>> --- a/python/sepolicy/sepolicy/gui.py
>>> +++ b/python/sepolicy/sepolicy/gui.py
>>> @@ -2609,9 +2609,10 @@ class SELinuxGui():
>>>       def set_enforce_text(self, value):
>>>           if value:
>>>               self.status_bar.push(self.context_id, _("System Status:
>>> Enforcing"))
>>> +            self.current_status_enforcing.set_active(True)
>>>           else:
>>>               self.status_bar.push(self.context_id, _("System Status:
>>> Permissive"))
>>> -        self.current_status_permissive.set_active(True)
>>> +            self.current_status_permissive.set_active(True)
>>>         def set_enforce(self, button):
>>>           self.dbus.setenforce(button.get_active())
>>>
> 

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

* Re: [PATCH] policycoreutils/sepolicy/gui: fix current selinux state radiobutton
  2016-11-30 13:52     ` Stephen Smalley
@ 2016-11-30 14:24       ` Vit Mojzis
  2016-12-06 14:58         ` [PATCH] python/sepolicy/sepolicy/gui: Reflect sepolicy changes into gui Vit Mojzis
  0 siblings, 1 reply; 7+ messages in thread
From: Vit Mojzis @ 2016-11-30 14:24 UTC (permalink / raw)
  To: Stephen Smalley, SELinux

This is caused by recent changes in sepolicy that were not reflected in 
gui. I'm working on the issue, but it's probably gonna take some time.

Thanks for the feedback.


On 30.11.2016 14:52, Stephen Smalley wrote:
> On 11/30/2016 08:44 AM, Vit Mojzis wrote:
>> The glade file is installed properly, only
>> python/sepolicy/sepolicy/gui.py is searching for it in the wrong place
>> (lib64). Please find attached patch that should fix the issue.
> Thanks, but now I get:
> $ sepolicy gui
>
> (sepolicy:18202): Gtk-WARNING **: Could not load image
> 'images/booleans.png': Failed to open file
> '/usr/lib/python2.7/site-packages/sepolicy/images/booleans.png': No such
> file or directory
>
> (sepolicy:18202): Gtk-WARNING **: Overriding tab label for notebook
> Traceback (most recent call last):
>    File "/usr/bin/sepolicy", line 699, in <module>
>      args.func(args)
>    File "/usr/bin/sepolicy", line 327, in gui_run
>      sepolicy.gui.SELinuxGui(args.domain, args.test)
>    File "/usr/lib/python2.7/site-packages/sepolicy/gui.py", line 517, in
> __init__
>      path = sepolicy.find_entrypoint_path(entrypoint)
>    File "/usr/lib/python2.7/site-packages/sepolicy/__init__.py", line
> 486, in find_entrypoint_path
>      if exe.endswith("_exec_t") and exe not in exclude_list:
> AttributeError: 'list' object has no attribute 'endswith'
>
>>
>> On 29.11.2016 15:02, Stephen Smalley wrote:
>>> On 11/29/2016 04:09 AM, Vit Mojzis wrote:
>>>> Radiobutton was always set to "Permissive" and couldn't be switched.
>>>> Update radiobutton together with status text in bottom left corner.
>>>>
>>>> Signed-off-by: Vit Mojzis <vmojzis@redhat.com>
>>> Thanks, applied.  However, sepolicy gui doesn't work for me (before or
>>> after this change):
>>> $ cd selinux
>>> $ sudo make LIBDIR=/usr/lib64 SHLIBDIR=/lib64 install install-pywrap
>>> relabel
>>> $ sepolicy gui
>>> Traceback (most recent call last):
>>>     File "/usr/bin/sepolicy", line 699, in <module>
>>>       args.func(args)
>>>     File "/usr/bin/sepolicy", line 327, in gui_run
>>>       sepolicy.gui.SELinuxGui(args.domain, args.test)
>>>     File "/usr/lib/python2.7/site-packages/sepolicy/gui.py", line 135, in
>>> __init__
>>>       builder.add_from_file(glade_file)
>>> GLib.Error: g-file-error-quark: Failed to open file
>>> '/usr/lib64/python2.7/site-packages/sepolicy/sepolicy.glade': No such
>>> file or directory (4)
>>>
>>> Are we failing to install the glade file properly in the Makefiles?
>>> And does python/sepolicy/sepolicy/sepolicy.glade belong under gui/
>>> instead?
>>>
>>>> ---
>>>>    python/sepolicy/sepolicy/gui.py | 3 ++-
>>>>    1 file changed, 2 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/python/sepolicy/sepolicy/gui.py
>>>> b/python/sepolicy/sepolicy/gui.py
>>>> index ee78e0c..3c5a9d2 100644
>>>> --- a/python/sepolicy/sepolicy/gui.py
>>>> +++ b/python/sepolicy/sepolicy/gui.py
>>>> @@ -2609,9 +2609,10 @@ class SELinuxGui():
>>>>        def set_enforce_text(self, value):
>>>>            if value:
>>>>                self.status_bar.push(self.context_id, _("System Status:
>>>> Enforcing"))
>>>> +            self.current_status_enforcing.set_active(True)
>>>>            else:
>>>>                self.status_bar.push(self.context_id, _("System Status:
>>>> Permissive"))
>>>> -        self.current_status_permissive.set_active(True)
>>>> +            self.current_status_permissive.set_active(True)
>>>>          def set_enforce(self, button):
>>>>            self.dbus.setenforce(button.get_active())
>>>>

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

* [PATCH] python/sepolicy/sepolicy/gui: Reflect sepolicy changes into gui
  2016-11-30 14:24       ` Vit Mojzis
@ 2016-12-06 14:58         ` Vit Mojzis
  2016-12-06 14:58           ` Vit Mojzis
  0 siblings, 1 reply; 7+ messages in thread
From: Vit Mojzis @ 2016-12-06 14:58 UTC (permalink / raw)
  To: selinux

This patch should get sepolicy gui working again, however it's still unusable due to SETools-4 speed (initial policy analysis takes a few hours at this point, but can be significantly optimised).

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

* [PATCH] python/sepolicy/sepolicy/gui: Reflect sepolicy changes into gui
  2016-12-06 14:58         ` [PATCH] python/sepolicy/sepolicy/gui: Reflect sepolicy changes into gui Vit Mojzis
@ 2016-12-06 14:58           ` Vit Mojzis
  2016-12-06 17:43             ` Stephen Smalley
  0 siblings, 1 reply; 7+ messages in thread
From: Vit Mojzis @ 2016-12-06 14:58 UTC (permalink / raw)
  To: selinux

sepolicy.get_init_entrypoint() now returns list of Type objects
instead of single string, which caused sepolicy gui to crash.

Signed-off-by: Vit Mojzis <vmojzis@redhat.com>
---
 python/sepolicy/sepolicy/gui.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/python/sepolicy/sepolicy/gui.py b/python/sepolicy/sepolicy/gui.py
index 3c5a9d2..6ccd02a 100644
--- a/python/sepolicy/sepolicy/gui.py
+++ b/python/sepolicy/sepolicy/gui.py
@@ -512,8 +512,8 @@ class SELinuxGui():
             self.progress_bar.set_pulse_step(self.percentage)
             self.idle_func()
 
-            entrypoint = sepolicy.get_init_entrypoint(domain)
-            if entrypoint:
+            entrypoints = [str(x) for x in sepolicy.get_init_entrypoint(domain)]
+            for entrypoint in entrypoints:
                 path = sepolicy.find_entrypoint_path(entrypoint)
                 if path:
                     self.combo_box_initialize(path, None)
-- 
2.7.4

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

* Re: [PATCH] python/sepolicy/sepolicy/gui: Reflect sepolicy changes into gui
  2016-12-06 14:58           ` Vit Mojzis
@ 2016-12-06 17:43             ` Stephen Smalley
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Smalley @ 2016-12-06 17:43 UTC (permalink / raw)
  To: Vit Mojzis, selinux

On 12/06/2016 09:58 AM, Vit Mojzis wrote:
> sepolicy.get_init_entrypoint() now returns list of Type objects
> instead of single string, which caused sepolicy gui to crash.

Thanks, applied.

> 
> Signed-off-by: Vit Mojzis <vmojzis@redhat.com>
> ---
>  python/sepolicy/sepolicy/gui.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/python/sepolicy/sepolicy/gui.py b/python/sepolicy/sepolicy/gui.py
> index 3c5a9d2..6ccd02a 100644
> --- a/python/sepolicy/sepolicy/gui.py
> +++ b/python/sepolicy/sepolicy/gui.py
> @@ -512,8 +512,8 @@ class SELinuxGui():
>              self.progress_bar.set_pulse_step(self.percentage)
>              self.idle_func()
>  
> -            entrypoint = sepolicy.get_init_entrypoint(domain)
> -            if entrypoint:
> +            entrypoints = [str(x) for x in sepolicy.get_init_entrypoint(domain)]
> +            for entrypoint in entrypoints:
>                  path = sepolicy.find_entrypoint_path(entrypoint)
>                  if path:
>                      self.combo_box_initialize(path, None)
> 

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

end of thread, other threads:[~2016-12-06 17:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-29  9:09 [PATCH] policycoreutils/sepolicy/gui: fix current selinux state radiobutton Vit Mojzis
2016-11-29 14:02 ` Stephen Smalley
     [not found]   ` <5717f0f3-0322-21b2-692e-c1c5fc8ac40f@redhat.com>
2016-11-30 13:52     ` Stephen Smalley
2016-11-30 14:24       ` Vit Mojzis
2016-12-06 14:58         ` [PATCH] python/sepolicy/sepolicy/gui: Reflect sepolicy changes into gui Vit Mojzis
2016-12-06 14:58           ` Vit Mojzis
2016-12-06 17:43             ` Stephen Smalley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.