Some calls to "_" where unsuccessful because the function was
initialized with a different translation domain than the string.
e.g. selinux-polgengui calls functions from sepolicy.generate, which end
up printing untranslated strings because polgengui uses selinux-gui
domain while sepolicy uses selinux-python
- Set "_" in module namespace instead of "builtins"
- Set the whole "sepolicy.generate()" confirmation as translatable
- Drop "codeset" parameter since it is deprecated
Signed-off-by: Vit Mojzis <vmojzis@redhat.com>
Acked-by: James Carter <jwcart2@gmail.com>
When policycoreutils was split into policycoreutils/ python/ gui/ and sandbox/
sub-directories, po/ translation files stayed in policycoreutils/.
This commit splits original policycoreutils translations to
policycoreutils, selinux-python, selinux-gui, and selinux-sandbox.
See original Fedora issue https://github.com/fedora-selinux/selinux/issues/43
Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
Acked-by: James Carter <jwcart2@gmail.com>
A change in seobject.py file_type_str_to_option made the "file type"
list not compatible with items in this ComboBox.
See commit 317743bbe2 ("python/semanage: fix export of fcontext socket
entries")
Avoid this in the future by populating the ComboBox using keys from
file_type_str_to_option.
This change disables translations on the file types, but those cause
other issues (adding file context fails the same way as with 'socket
file' since the translated strings differ form
file_type_str_to_option.keys, 'properties' of a file context entry
shows no file type for the same reason).
Fixes:
Traceback (most recent call last):
File "/usr/share/system-config-selinux/system-config-selinux.py", line 136, in add
self.tabs[self.notebook.get_current_page()].addDialog()
File "/usr/share/system-config-selinux/semanagePage.py", line 143, in addDialog
if self.add() is False:
File "/usr/share/system-config-selinux/fcontextPage.py", line 195, in add
(rc, out) = getstatusoutput("semanage fcontext -a -t %s -r %s -f '%s' '%s'" % (type, mls, seobject.file_type_str_to_option[ftype], fspec))
KeyError: 'socket file'
Signed-off-by: Vit Mojzis <vmojzis@redhat.com>
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>
Use codespell (https://github.com/codespell-project/codespell) in order
to find many common misspellings that are present in English texts.
Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
/usr/share/applications is a standard directory for .desktop files.
Installation path can be changed using DESKTOPDIR variable in installation
phase, e.g.
make DESKTOPDIR=/usr/local/share/applications install
Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
setools 4.2.0 dropped support for Python 2. On systems where
/usr/bin/python is Python 2, several tools are now broken because of
this. Update the shebang of these tools to /usr/bin/python3.
For future reference, as semanage/seobject.py, sepolicy and sepolgen
import setools, every program that uses one of these modules need to be
run with Python 3. The following programs do not use any of these
modules so their shebangs have not been modified:
dbus/selinux_server.py
libsemanage/utils/semanage_migrate_store
mcstrans/share/util/mlscolor-test
mcstrans/share/util/mlstrans-test
sandbox/start
Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
"Edit" and "add" dialogues weren't closed after successful transaction
("add" and "edit" methods return "None" if successful).
Signed-off-by: Vit Mojzis <vmojzis@redhat.com>
- $ gtk-builder-convert polgen.glade polgen.ui
- use get_object instead of get_widget
- use connect_signals instead of signal_connect
Signed-off-by: Petr Lautrbach <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>
Function delete() is defined twice in class usersPage and the first one
invoke semanagePage.delete(), which does not exist.
Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
The output of "semodule -lfull" changed from "module version" to
"priority module kind". Update system-config-selinux to use this new
format in its tab "Policy Module".
Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
PyGTK has been deprecated in favor of PyGI+GTK and thus has never been
ported to python3. Using pygi-convert.sh from
https://git.gnome.org/browse/pygobject/tree/pygi-convert.sh helps
migrating most of the API but gnome-python.
The glade file has been converted to GtkBuilder using
gtk-builder-convert system-config-selinux.glade system-config-selinux.ui
and some fixes in order to provide an application window (object
GnomeApp disappeared, GtkVBox is deprecated, etc.). The associated
Python code also needed some modifications in order to migrate to
GtkBuilder.
The result has been tested on Arch Linux with Python 3.6. There are some
bugs in the GUI itself, for which patches will be sent afterwards.
Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>