From: Petr Lautrbach <plautrba@redhat.com>
To: selinux@tycho.nsa.gov
Subject: [PATCH 1/4] gui/polgengui.py: Fix sepolicy.generate import in polgengui.py
Date: Wed, 14 Feb 2018 10:53:34 +0100 [thread overview]
Message-ID: <20180214095337.1945-2-plautrba@redhat.com> (raw)
In-Reply-To: <20180214095337.1945-1-plautrba@redhat.com>
b43991f9 added direct import of sepolicy but it forgot to import
sepolicy.generate and didn't change use of generate to sepolicy.generate
Fixes:
Traceback (most recent call last):
File "/usr/bin/selinux-polgengui", line 778, in <module>
app = childWindow()
File "/usr/bin/selinux-polgengui", line 205, in __init__
self.all_types = sepolicy.generate.get_all_types()
AttributeError: 'module' object has no attribute 'generate'
Traceback (most recent call last):
File "/usr/share/system-config-selinux/polgengui.py", line 365, in forward
if self.on_in_net_page_next():
File "/usr/share/system-config-selinux/polgengui.py", line 701, in on_in_net_page_next
generate.verify_ports(self.in_tcp_entry.get_text())
NameError: global name 'generate' is not defined
Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
---
gui/polgengui.py | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/gui/polgengui.py b/gui/polgengui.py
index af6b822b..09723278 100644
--- a/gui/polgengui.py
+++ b/gui/polgengui.py
@@ -34,7 +34,9 @@ except ValueError as e:
sys.stderr.write("%s: %s\n" % (e.__class__.__name__, str(e)))
sys.exit(1)
+import sepolicy.generate
import sepolicy.interface
+
try:
from subprocess import getstatusoutput
except ImportError:
@@ -696,16 +698,16 @@ class childWindow:
def on_in_net_page_next(self, *args):
try:
- generate.verify_ports(self.in_tcp_entry.get_text())
- generate.verify_ports(self.in_udp_entry.get_text())
+ sepolicy.generate.verify_ports(self.in_tcp_entry.get_text())
+ sepolicy.generate.verify_ports(self.in_udp_entry.get_text())
except ValueError as e:
self.error(e.message)
return True
def on_out_net_page_next(self, *args):
try:
- generate.verify_ports(self.out_tcp_entry.get_text())
- generate.verify_ports(self.out_udp_entry.get_text())
+ sepolicy.generate.verify_ports(self.out_tcp_entry.get_text())
+ sepolicy.generate.verify_ports(self.out_udp_entry.get_text())
except ValueError as e:
self.error(e.message)
return True
@@ -741,7 +743,7 @@ class childWindow:
if exe == "":
self.error(_("You must enter a executable"))
return True
- policy = generate.policy(name, self.get_type())
+ policy = sepolicy.generate.policy(name, self.get_type())
policy.set_program(exe)
policy.gen_writeable()
policy.gen_symbols()
--
2.16.1
next prev parent reply other threads:[~2018-02-14 9:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-14 9:53 Update selinux-sepolgengui to be compatible with Gtk3, Python 3 Petr Lautrbach
2018-02-14 9:53 ` Petr Lautrbach [this message]
2018-02-14 9:53 ` [PATCH 2/4] gui/polgengui.py: Convert polgen.glade to Builder format polgen.ui Petr Lautrbach
2018-02-14 9:53 ` [PATCH 3/4] python/sepolicy: Use list instead of map Petr Lautrbach
2018-02-14 9:53 ` [PATCH 4/4] python/sepolicy: Do not use types.BooleanType Petr Lautrbach
2018-02-18 18:09 ` Update selinux-sepolgengui to be compatible with Gtk3, Python 3 Nicolas Iooss
2018-02-18 18:20 ` Nicolas Iooss
2018-02-22 15:31 ` Petr Lautrbach
2018-02-22 16:59 ` Petr Lautrbach
2018-02-22 19:09 ` Nicolas Iooss
2018-02-23 20:29 ` 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=20180214095337.1945-2-plautrba@redhat.com \
--to=plautrba@redhat.com \
--cc=selinux@tycho.nsa.gov \
/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 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.