Compare commits
5 Commits
Author | SHA1 | Date |
---|---|---|
Petr Lautrbach | 40f0194dee | |
Petr Lautrbach | bedf0d4f2a | |
Petr Lautrbach | 5bc197c4d4 | |
Petr Lautrbach | d9da4bfafa | |
Petr Lautrbach | 12d0eb118b |
|
@ -1,26 +0,0 @@
|
|||
From a1d303150b341d6cfdc1f7d36c38004cee01fdb7 Mon Sep 17 00:00:00 2001
|
||||
From: Dominik Perpeet <dperpeet@redhat.com>
|
||||
Date: Wed, 6 Apr 2016 10:09:55 +0200
|
||||
Subject: [PATCH] setroubleshoot: Ensure that dbus string param isn't null
|
||||
|
||||
An alert's level can be None, but DBUS doesn't allow that for string parameters.
|
||||
---
|
||||
framework/src/setroubleshoot/server.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/framework/src/setroubleshoot/server.py b/framework/src/setroubleshoot/server.py
|
||||
index 87722c9..e788d41 100755
|
||||
--- a/framework/src/setroubleshoot/server.py
|
||||
+++ b/framework/src/setroubleshoot/server.py
|
||||
@@ -579,7 +579,7 @@ Return an alert with summary, audit events, fix suggestions
|
||||
|
||||
return (alert.local_id, alert.summary(), alert.report_count,
|
||||
audit_events, plugins,
|
||||
- str(alert.first_seen_date), str(alert.last_seen_date), alert.level
|
||||
+ str(alert.first_seen_date), str(alert.last_seen_date), alert.level or ''
|
||||
)
|
||||
|
||||
|
||||
--
|
||||
2.7.3
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
From e9e2872101db300938a56d79899496c3080a1565 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Lautrbach <plautrba@redhat.com>
|
||||
Date: Wed, 12 Jul 2017 18:03:57 +0200
|
||||
Subject: [PATCH 02/19] framework: Don't stop when the plugin directory is
|
||||
empty
|
||||
|
||||
Fixes: https://pagure.io/setroubleshoot/issue/5
|
||||
failed to load __init__ plugin
|
||||
Traceback (most recent call last):
|
||||
File "/usr/lib/python3/dist-packages/setroubleshoot/server.py", line 771, in RunFaultServer
|
||||
analyze_thread = AnalyzeThread(analysis_queue)
|
||||
File "/usr/lib/python3/dist-packages/setroubleshoot/analyze.py", line 220, in __init__
|
||||
Analyze.__init__(self)
|
||||
File "/usr/lib/python3/dist-packages/setroubleshoot/analyze.py", line 135, in __init__
|
||||
self.plugins = load_plugins()
|
||||
File "/usr/lib/python3/dist-packages/setroubleshoot/util.py", line 488, in load_plugins
|
||||
if mod_fp:
|
||||
UnboundLocalError: local variable 'mod_fp' referenced before assignment
|
||||
exception UnboundLocalError: local variable 'mod_fp' referenced before assignment
|
||||
---
|
||||
framework/src/setroubleshoot/util.py | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/framework/src/setroubleshoot/util.py b/framework/src/setroubleshoot/util.py
|
||||
index d0341d4..de8cda9 100755
|
||||
--- a/framework/src/setroubleshoot/util.py
|
||||
+++ b/framework/src/setroubleshoot/util.py
|
||||
@@ -483,7 +483,8 @@ def load_plugins(filter_glob=None):
|
||||
mod_fp, mod_path, mod_description = imp.find_module(plugin_name, [plugin_dir])
|
||||
mod = imp.load_module(module_name, mod_fp, mod_path, mod_description)
|
||||
except Exception:
|
||||
- syslog.syslog(syslog.LOG_ERR, "failed to load %s plugin" % plugin_name)
|
||||
+ syslog.syslog(syslog.LOG_ERR, "failed to initialize plugins in %s" % plugin_dir)
|
||||
+ return []
|
||||
|
||||
if mod_fp:
|
||||
mod_fp.close()
|
||||
--
|
||||
2.14.1
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
From 4271b72e879ca25ba244036c0c2b6b9dbf7b2edf Mon Sep 17 00:00:00 2001
|
||||
From: Petr Lautrbach <plautrba@redhat.com>
|
||||
Date: Thu, 14 Apr 2016 10:36:14 +0200
|
||||
Subject: [PATCH 2/2] framework: Drop unwanted debug message in sedispatch
|
||||
|
||||
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1326985
|
||||
---
|
||||
framework/src/sedispatch.c | 5 ++---
|
||||
1 file changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/framework/src/sedispatch.c b/framework/src/sedispatch.c
|
||||
index 6417a10..bec3aa9 100644
|
||||
--- a/framework/src/sedispatch.c
|
||||
+++ b/framework/src/sedispatch.c
|
||||
@@ -147,10 +147,9 @@ int main(int argc __attribute__((unused)), char *argv[] __attribute__((unused)))
|
||||
FD_SET(0, &rfds);
|
||||
tv.tv_sec = 3;
|
||||
tv.tv_usec = 0;
|
||||
- if (select(1, &rfds, NULL, NULL, &tv) == 0) {
|
||||
- syslog(LOG_ERR, "timeout flush");
|
||||
+ if (select(1, &rfds, NULL, NULL, &tv) == 0)
|
||||
+ /* The timeout occurred, the event is probably complete */
|
||||
auparse_flush_feed(au);
|
||||
- }
|
||||
}
|
||||
if (feof(stdin))
|
||||
break;
|
||||
--
|
||||
2.7.3
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
From 8d2d943dfb4c752aaf0f847994261beef26e73b8 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Palenik <mpalenik@redhat.com>
|
||||
Date: Thu, 3 Aug 2017 22:15:19 +0200
|
||||
Subject: [PATCH 03/19] Fix missing margins on Troubleshoot window
|
||||
|
||||
After clicking the Troubleshoot buttons, the text on the left (if-text) and the buttons on the right (Report Details, Report Bug) are glued to the outside window frame.
|
||||
|
||||
This fix adds margins both on the left and on the right side of the vindow triggered by the Troubleshoot button.
|
||||
---
|
||||
framework/gui/browser.glade | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/framework/gui/browser.glade b/framework/gui/browser.glade
|
||||
index ea17e8a..de6cbaf 100644
|
||||
--- a/framework/gui/browser.glade
|
||||
+++ b/framework/gui/browser.glade
|
||||
@@ -629,6 +629,8 @@ John Dennis <jdennis@redhat.com></property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="row_spacing">3</property>
|
||||
<property name="column_spacing">3</property>
|
||||
+ <property name="margin_left">16</property>
|
||||
+ <property name="margin_right">12</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
--
|
||||
2.14.1
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
From 5e97f34c60487476527581ed7ba93fd3a8406c06 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Palenik <mpalenik@redhat.com>
|
||||
Date: Fri, 4 Aug 2017 13:05:44 +0200
|
||||
Subject: [PATCH 04/19] Resize all solutions panels horizontally
|
||||
|
||||
After clicking the Troubleshoot button, the height of the proposed solutions has been too small, hiding parts of the then-text. Scrolling has been required to read the whole then-text, even though there was still vertical space inside the window that allowed more text to be displayed.
|
||||
|
||||
This fix allows dynamic (horizontal) resize of all solution panels, depending on the actual window size.
|
||||
---
|
||||
framework/src/setroubleshoot/browser.py | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/framework/src/setroubleshoot/browser.py b/framework/src/setroubleshoot/browser.py
|
||||
index 5e0977f..2169693 100644
|
||||
--- a/framework/src/setroubleshoot/browser.py
|
||||
+++ b/framework/src/setroubleshoot/browser.py
|
||||
@@ -503,6 +503,7 @@ class BrowserApplet:
|
||||
then_scroll.set_sensitive(False)
|
||||
then_scroll.set_size_request(450, 90)
|
||||
then_scroll.set_hexpand(True)
|
||||
+ then_scroll.set_vexpand(True)
|
||||
# self.table.resize(rows, cols) GtkGrid resize automatically
|
||||
sev_toggle.connect("toggled", self.on_sev_togglebutton_activated, rows)
|
||||
# col = 0
|
||||
--
|
||||
2.14.1
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
From 3afcbef8ec3f03c7f5562bbedad86ceb778c318b Mon Sep 17 00:00:00 2001
|
||||
From: Martin Palenik <mpalenik@redhat.com>
|
||||
Date: Thu, 3 Aug 2017 23:34:17 +0200
|
||||
Subject: [PATCH 05/19] Fix missing priority color for proposed solutions
|
||||
|
||||
After clicking the Troubleshoot button, the colors (green, yellow, red) marking
|
||||
the priority of the solution have not been shown. Instead, the color has always
|
||||
been gray, while it should have been yellow by default.
|
||||
|
||||
This fix enables the colors that represent the priorities of the solutions.
|
||||
---
|
||||
framework/gui/Makefile.am | 1 +
|
||||
framework/gui/style.css | 17 +++++++++++++++++
|
||||
framework/src/setroubleshoot/browser.py | 28 +++++++++-------------------
|
||||
3 files changed, 27 insertions(+), 19 deletions(-)
|
||||
create mode 100644 framework/gui/style.css
|
||||
|
||||
diff --git a/framework/gui/Makefile.am b/framework/gui/Makefile.am
|
||||
index cd4bfa4..83baab5 100644
|
||||
--- a/framework/gui/Makefile.am
|
||||
+++ b/framework/gui/Makefile.am
|
||||
@@ -18,6 +18,7 @@ GUI_FILES = \
|
||||
bug_report.glade \
|
||||
fail_dialog.glade \
|
||||
success_dialog.glade \
|
||||
+ style.css \
|
||||
$(NULL)
|
||||
|
||||
icondir = /usr/share/icons/hicolor/
|
||||
diff --git a/framework/gui/style.css b/framework/gui/style.css
|
||||
new file mode 100644
|
||||
index 0000000..1215979
|
||||
--- /dev/null
|
||||
+++ b/framework/gui/style.css
|
||||
@@ -0,0 +1,17 @@
|
||||
+.toggle.green {
|
||||
+ border-image: none;
|
||||
+ background-image: none;
|
||||
+ background-color: green;
|
||||
+}
|
||||
+
|
||||
+.toggle.red {
|
||||
+ border-image: none;
|
||||
+ background-image: none;
|
||||
+ background-color: red;
|
||||
+}
|
||||
+
|
||||
+.toggle.yellow {
|
||||
+ border-image: none;
|
||||
+ background-image: none;
|
||||
+ background-color: yellow;
|
||||
+}
|
||||
\ No newline at end of file
|
||||
diff --git a/framework/src/setroubleshoot/browser.py b/framework/src/setroubleshoot/browser.py
|
||||
index 2169693..a772f59 100644
|
||||
--- a/framework/src/setroubleshoot/browser.py
|
||||
+++ b/framework/src/setroubleshoot/browser.py
|
||||
@@ -441,29 +441,19 @@ class BrowserApplet:
|
||||
if not if_text:
|
||||
return
|
||||
|
||||
- black = Gdk.Color(0,0,0)
|
||||
+ sev_toggle = Gtk.ToggleButton()
|
||||
if plugin.level == "red":
|
||||
- color = Gdk.Color(65535,0,0)
|
||||
+ sev_toggle.get_style_context().add_class("red")
|
||||
elif plugin.level == "yellow":
|
||||
- color = Gdk.Color(65535,65525,0)
|
||||
+ sev_toggle.get_style_context().add_class("yellow")
|
||||
elif plugin.level == "green":
|
||||
- color = Gdk.Color(0,65535,0)
|
||||
-
|
||||
- sev_toggle = Gtk.ToggleButton()
|
||||
-# sev_toggle.set_size_request(20,20)
|
||||
- sev_toggle.modify_bg(Gtk.StateType.PRELIGHT, color)
|
||||
- sev_toggle.modify_bg(Gtk.StateType.SELECTED, black)
|
||||
- sev_toggle.modify_bg(Gtk.StateType.ACTIVE, color)
|
||||
- sev_toggle.modify_bg(Gtk.StateType.NORMAL, color)
|
||||
-
|
||||
- sev_toggle.modify_fg(Gtk.StateType.PRELIGHT, color)
|
||||
- sev_toggle.modify_fg(Gtk.StateType.SELECTED, black)
|
||||
- sev_toggle.modify_fg(Gtk.StateType.ACTIVE, black)
|
||||
- sev_toggle.modify_fg(Gtk.StateType.NORMAL, color)
|
||||
-
|
||||
- sev_toggle.modify_base(Gtk.StateType.SELECTED, black)
|
||||
+ sev_toggle.get_style_context().add_class("green")
|
||||
|
||||
- sev_toggle.set_alignment(0.5, 0.0)
|
||||
+ cssProvider = Gtk.CssProvider()
|
||||
+ cssProvider.load_from_path('/usr/share/setroubleshoot/gui/style.css')
|
||||
+ screen = Gdk.Screen.get_default()
|
||||
+ styleContext = Gtk.StyleContext()
|
||||
+ styleContext.add_provider_for_screen(screen, cssProvider, Gtk.STYLE_PROVIDER_PRIORITY_USER)
|
||||
|
||||
self.toggles.append(sev_toggle)
|
||||
sev_toggle.show()
|
||||
--
|
||||
2.14.1
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
From 4a0172ae99bbda60ba0cae7b070285ed55bb2be0 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Lautrbach <plautrba@redhat.com>
|
||||
Date: Tue, 22 Aug 2017 10:44:23 +0200
|
||||
Subject: [PATCH 07/19] framework: we need to set translation domain for
|
||||
Gtk.Builder() object to have strings correctly translated
|
||||
|
||||
Related: https://github.com/fedora-selinux/setroubleshoot/issues/63
|
||||
---
|
||||
framework/src/setroubleshoot/browser.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/framework/src/setroubleshoot/browser.py b/framework/src/setroubleshoot/browser.py
|
||||
index a4a3388..dbfccb0 100644
|
||||
--- a/framework/src/setroubleshoot/browser.py
|
||||
+++ b/framework/src/setroubleshoot/browser.py
|
||||
@@ -182,7 +182,7 @@ class BrowserApplet:
|
||||
|
||||
self.read_config()
|
||||
builder = Gtk.Builder()
|
||||
-# builder.set_translation_domain("setroubleshoot")
|
||||
+ builder.set_translation_domain(domain)
|
||||
builder.add_from_file("/usr/share/setroubleshoot/gui/browser.glade")
|
||||
self.plugins = load_plugins()
|
||||
|
||||
--
|
||||
2.14.1
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
From 8be44048b35333c9745e7c8949f2b69ef1efa2e5 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Lautrbach <plautrba@redhat.com>
|
||||
Date: Tue, 22 Aug 2017 10:45:38 +0200
|
||||
Subject: [PATCH 08/19] framework: Make labels on GtkButtons translatable
|
||||
|
||||
Related: https://github.com/fedora-selinux/setroubleshoot/issues/63
|
||||
---
|
||||
framework/gui/browser.glade | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/framework/gui/browser.glade b/framework/gui/browser.glade
|
||||
index de6cbaf..4522572 100644
|
||||
--- a/framework/gui/browser.glade
|
||||
+++ b/framework/gui/browser.glade
|
||||
@@ -112,7 +112,7 @@ John Dennis <jdennis@redhat.com></property>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="delete_list_button">
|
||||
- <property name="label">Delete</property>
|
||||
+ <property name="label" translatable="yes">Delete</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
@@ -187,7 +187,7 @@ John Dennis <jdennis@redhat.com></property>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="close_details_button">
|
||||
- <property name="label">Close</property>
|
||||
+ <property name="label" translatable="yes">Close</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
@@ -561,7 +561,7 @@ John Dennis <jdennis@redhat.com></property>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="delete_button">
|
||||
- <property name="label">Delete</property>
|
||||
+ <property name="label" translatable="yes">Delete</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
@@ -666,7 +666,7 @@ John Dennis <jdennis@redhat.com></property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="previous_button">
|
||||
- <property name="label">Previous</property>
|
||||
+ <property name="label" translatable="yes">Previous</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
@@ -698,7 +698,7 @@ John Dennis <jdennis@redhat.com></property>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="next_button">
|
||||
- <property name="label">Next</property>
|
||||
+ <property name="label" translatable="yes">Next</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
--
|
||||
2.14.1
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
From 64f09779477f17759aa8e3d5ca47975ca46856d0 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Lautrbach <plautrba@redhat.com>
|
||||
Date: Mon, 28 Aug 2017 09:01:44 +0200
|
||||
Subject: [PATCH 11/19] framework: Handla all exceptions from
|
||||
do_analyze_logfile()
|
||||
|
||||
Fixes:
|
||||
$ sudo umount /sys/fs/selinux
|
||||
|
||||
$ sudo sealert -a /var/log/audit/audit.log
|
||||
Opps, sealert hit an error!
|
||||
|
||||
ValueError: You must specify the -p option with the path to the policy file.
|
||||
|
||||
The above exception was the direct cause of the following exception:
|
||||
|
||||
Traceback (most recent call last):
|
||||
File "/usr/bin/sealert", line 695, in <module>
|
||||
do_analyze_logfile(logfile)
|
||||
File "/usr/bin/sealert", line 532, in do_analyze_logfile
|
||||
audit2why.init()
|
||||
SystemError: <built-in function init> returned a result with an error set
|
||||
---
|
||||
framework/src/sealert | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/framework/src/sealert b/framework/src/sealert
|
||||
index c8036f8..b7d5898 100755
|
||||
--- a/framework/src/sealert
|
||||
+++ b/framework/src/sealert
|
||||
@@ -699,7 +699,7 @@ if __name__ == '__main__':
|
||||
except ProgramError as e:
|
||||
print(e.strerror, file=sys.stderr)
|
||||
sys.exit(3)
|
||||
- except ValueError as e:
|
||||
+ except Exception as e:
|
||||
print("SELinux is disabled or we can't open a policy file")
|
||||
sys.exit(3)
|
||||
|
||||
--
|
||||
2.14.1
|
||||
|
|
@ -0,0 +1,169 @@
|
|||
From 67c8d8d452c44519ba78fc0f605d6754afc4fe0b Mon Sep 17 00:00:00 2001
|
||||
From: Vit Mojzis <vmojzis@redhat.com>
|
||||
Date: Tue, 5 Sep 2017 13:33:52 +0200
|
||||
Subject: [PATCH 12/19] framework: Fix semi-translated messages
|
||||
|
||||
Gettext domains were hardcoded in some modules (pointing to translations
|
||||
for setroubleshoot plugins) which caused semi-translated messages.
|
||||
Remove hardcoded gettext domain and use value from config file instead.
|
||||
|
||||
Note:
|
||||
gettext.install sets the "_" function into global builtins namespace,
|
||||
as opposed "manually" setting "_" with gettext.translation(...).gettext,
|
||||
which only affects given module. Therefore in some cases both methods
|
||||
were left in use.
|
||||
|
||||
Fixes:
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1332126
|
||||
|
||||
Signed-off-by: Vit Mojzis <vmojzis@redhat.com>
|
||||
---
|
||||
framework/src/setroubleshoot/Plugin.py | 10 +++++++---
|
||||
framework/src/setroubleshoot/browser.py | 7 +++++--
|
||||
framework/src/setroubleshoot/errcode.py | 11 ++++++++---
|
||||
framework/src/setroubleshoot/server.py | 7 +++++--
|
||||
framework/src/setroubleshoot/signature.py | 17 ++++++++++-------
|
||||
6 files changed, 41 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/framework/src/setroubleshoot/Plugin.py b/framework/src/setroubleshoot/Plugin.py
|
||||
index 8ec8deb..c67b6ad 100644
|
||||
--- a/framework/src/setroubleshoot/Plugin.py
|
||||
+++ b/framework/src/setroubleshoot/Plugin.py
|
||||
@@ -20,12 +20,16 @@
|
||||
#
|
||||
|
||||
import gettext
|
||||
-translation=gettext.translation('setroubleshoot-plugins', fallback=True)
|
||||
+from setroubleshoot.config import parse_config_setting, get_config
|
||||
+
|
||||
+translation=gettext.translation(domain = get_config('general', 'i18n_text_domain'),
|
||||
+ localedir = get_config('general', 'i18n_locale_dir'),
|
||||
+ fallback = True)
|
||||
|
||||
try:
|
||||
- _ = translation.ugettext # This raises exception in Python3, succ. in Py2
|
||||
+ _ = translation.ugettext # Unicode version of gettext for Py2
|
||||
except AttributeError:
|
||||
- _ = translation.gettext # Python3
|
||||
+ _ = translation.gettext # Python3 (uses unicode by default)
|
||||
|
||||
from setroubleshoot.signature import *
|
||||
from setroubleshoot.util import *
|
||||
diff --git a/framework/src/setroubleshoot/browser.py b/framework/src/setroubleshoot/browser.py
|
||||
index dbfccb0..84aef6d 100644
|
||||
--- a/framework/src/setroubleshoot/browser.py
|
||||
+++ b/framework/src/setroubleshoot/browser.py
|
||||
@@ -29,15 +29,18 @@ from setroubleshoot.config import parse_config_setting, get_config
|
||||
import six
|
||||
import sys
|
||||
domain = get_config('general', 'i18n_text_domain')
|
||||
+localedir = get_config('general', 'i18n_locale_dir')
|
||||
|
||||
kwargs = {}
|
||||
if sys.version_info < (3,):
|
||||
kwargs['unicode'] = True
|
||||
gettext.install(domain = domain,
|
||||
- localedir = get_config('general', 'i18n_locale_dir'),
|
||||
+ localedir = localedir,
|
||||
**kwargs)
|
||||
|
||||
-translation=gettext.translation(domain, fallback=True)
|
||||
+translation=gettext.translation(domain = domain,
|
||||
+ localedir = localedir,
|
||||
+ fallback=True)
|
||||
|
||||
rows = 1
|
||||
|
||||
diff --git a/framework/src/setroubleshoot/errcode.py b/framework/src/setroubleshoot/errcode.py
|
||||
index b1e6da8..804aaa1 100644
|
||||
--- a/framework/src/setroubleshoot/errcode.py
|
||||
+++ b/framework/src/setroubleshoot/errcode.py
|
||||
@@ -17,12 +17,17 @@
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
import gettext
|
||||
-translation=gettext.translation('setroubleshoot-plugins', fallback=True)
|
||||
+from setroubleshoot.config import parse_config_setting, get_config
|
||||
+
|
||||
+translation=gettext.translation(domain = get_config('general', 'i18n_text_domain'),
|
||||
+ localedir = get_config('general', 'i18n_locale_dir'),
|
||||
+ fallback = True)
|
||||
|
||||
try:
|
||||
- _ = translation.ugettext # This raises exception in Python3, succ. in Py2
|
||||
+ _ = translation.ugettext # Unicode version of gettext for Py2
|
||||
except AttributeError:
|
||||
- _ = translation.gettext # Python3
|
||||
+ _ = translation.gettext # Python3 (uses unicode by default)
|
||||
+
|
||||
|
||||
__all__ = [
|
||||
'ProgramError',
|
||||
diff --git a/framework/src/setroubleshoot/server.py b/framework/src/setroubleshoot/server.py
|
||||
index f336f1a..7093bff 100755
|
||||
--- a/framework/src/setroubleshoot/server.py
|
||||
+++ b/framework/src/setroubleshoot/server.py
|
||||
@@ -48,14 +48,17 @@ import systemd.journal
|
||||
from setroubleshoot.config import parse_config_setting, get_config
|
||||
|
||||
domain = get_config('general', 'i18n_text_domain')
|
||||
+localedir = get_config('general', 'i18n_locale_dir')
|
||||
kwargs = {}
|
||||
if sys.version_info < (3,):
|
||||
kwargs['unicode'] = True
|
||||
gettext.install(domain = domain,
|
||||
- localedir = get_config('general', 'i18n_locale_dir'),
|
||||
+ localedir = localedir,
|
||||
**kwargs)
|
||||
|
||||
-translation=gettext.translation(domain, fallback=True)
|
||||
+translation=gettext.translation(domain = domain,
|
||||
+ localedir = localedir,
|
||||
+ fallback = True)
|
||||
|
||||
try:
|
||||
_ = translation.ugettext # This raises exception in Python3, succ. in Py2
|
||||
diff --git a/framework/src/setroubleshoot/signature.py b/framework/src/setroubleshoot/signature.py
|
||||
index b3ef158..27f5e57 100755
|
||||
--- a/framework/src/setroubleshoot/signature.py
|
||||
+++ b/framework/src/setroubleshoot/signature.py
|
||||
@@ -24,15 +24,20 @@ from __future__ import print_function
|
||||
import six
|
||||
import syslog
|
||||
from subprocess import *
|
||||
-import gettext
|
||||
from six.moves import range
|
||||
from functools import cmp_to_key
|
||||
-translation=gettext.translation('setroubleshoot-plugins', fallback=True)
|
||||
+import gettext
|
||||
+from setroubleshoot.config import parse_config_setting, get_config
|
||||
+
|
||||
+translation=gettext.translation(domain = get_config('general', 'i18n_text_domain'),
|
||||
+ localedir = get_config('general', 'i18n_locale_dir'),
|
||||
+ fallback = True)
|
||||
|
||||
try:
|
||||
- _ = translation.ugettext # This raises exception in Python3, succ. in Py2
|
||||
+ _ = translation.ugettext # Unicode version of gettext for Py2
|
||||
except AttributeError:
|
||||
- _ = translation.gettext # Python3
|
||||
+ _ = translation.gettext # Python3 (uses unicode by default)
|
||||
+
|
||||
|
||||
__all__ = [
|
||||
'SignatureMatch',
|
||||
@@ -56,10 +61,8 @@ __all__ = [
|
||||
]
|
||||
|
||||
if __name__ == "__main__":
|
||||
- import gettext
|
||||
- from setroubleshoot.config import parse_config_setting, get_config
|
||||
gettext.install(domain = get_config('general', 'i18n_text_domain'),
|
||||
- localedir = get_config('general', 'i18n_locale_dir'))
|
||||
+ localedir = get_config('general', 'i18n_locale_dir'))
|
||||
|
||||
from gettext import ngettext as P_
|
||||
from setroubleshoot.config import get_config
|
||||
--
|
||||
2.14.1
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
From fb9b7c9ecd55456cbf078ec2e4cd26f0074a2045 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Lautrbach <plautrba@redhat.com>
|
||||
Date: Thu, 14 Sep 2017 07:48:38 +0200
|
||||
Subject: [PATCH 13/19] setroubleshoot project was moved to
|
||||
https://pagure.io/setroubleshoot
|
||||
|
||||
---
|
||||
framework/DBUS.md | 2 +-
|
||||
framework/setroubleshoot.appdata.xml | 4 ++--
|
||||
framework/src/config.py.in | 4 ++--
|
||||
3 files changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/framework/DBUS.md b/framework/DBUS.md
|
||||
index c517819..e38b134 100644
|
||||
--- a/framework/DBUS.md
|
||||
+++ b/framework/DBUS.md
|
||||
@@ -121,7 +121,7 @@ Sets a filter on an alert. The alert can be "always" filtered, "never" filtered
|
||||
|
||||
* `local_id(s)`: an alert id
|
||||
* `filter_type(s)`: "always", "never", "after_first", see
|
||||
- https://fedorahosted.org/setroubleshoot/wiki/SETroubleShoot%20User%20FAQ#email-alerts
|
||||
+ https://docs.pagure.org/setroubleshoot/SETroubleShootUserFAQ.html#email-alerts
|
||||
|
||||
###### return value
|
||||
|
||||
diff --git a/framework/setroubleshoot.appdata.xml b/framework/setroubleshoot.appdata.xml
|
||||
index 0c59775..46a9e1a 100644
|
||||
--- a/framework/setroubleshoot.appdata.xml
|
||||
+++ b/framework/setroubleshoot.appdata.xml
|
||||
@@ -18,9 +18,9 @@ SentUpstream: 2014-07-02
|
||||
troubleshooting interface to help track down the cause of the denial.
|
||||
</p>
|
||||
</description>
|
||||
- <url type="homepage">https://fedorahosted.org/setroubleshoot/</url>
|
||||
+ <url type="homepage">https://pagure.io/setroubleshoot/</url>
|
||||
<screenshots>
|
||||
- <screenshot type="default">https://fedorahosted.org/setroubleshoot/raw-attachment/wiki/WikiStart/setroubleshoot.png</screenshot>
|
||||
+ <screenshot type="default">https://docs.pagure.org/setroubleshoot/setroubleshoot.png</screenshot>
|
||||
</screenshots>
|
||||
<updatecontact>setroubleshoot-owner@fedoraproject.org</updatecontact>
|
||||
</application>
|
||||
diff --git a/framework/src/config.py.in b/framework/src/config.py.in
|
||||
index f73066a..86754d5 100644
|
||||
--- a/framework/src/config.py.in
|
||||
+++ b/framework/src/config.py.in
|
||||
@@ -67,7 +67,7 @@ defaults = {
|
||||
'readOnly' : True,
|
||||
},
|
||||
'project_url' : {
|
||||
- 'value' : 'https://fedorahosted.org/setroubleshoot',
|
||||
+ 'value' : 'https://pagure.io/setroubleshoot',
|
||||
'description' : 'URL of project website',
|
||||
},
|
||||
'rpc_version' : {
|
||||
@@ -325,7 +325,7 @@ system. The wildcard '*' is NOT allowed.'''
|
||||
},
|
||||
'help' : {
|
||||
'help_url': {
|
||||
- 'value' : 'https://fedorahosted.org/setroubleshoot/wiki/SETroubleShoot%20User%20FAQ',
|
||||
+ 'value' : 'https://pagure.io/docs/setroubleshoot/',
|
||||
'description' : 'URL to user help information',
|
||||
},
|
||||
'bug_report_url': {
|
||||
--
|
||||
2.14.1
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
From a176d587b7d66ba37f07e9f122be4b6664553e92 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Lautrbach <plautrba@redhat.com>
|
||||
Date: Thu, 14 Sep 2017 07:50:26 +0200
|
||||
Subject: [PATCH 14/19] framework: Allow to specify 'setup.py install --prefix'
|
||||
via $PREFIX variable
|
||||
|
||||
In recent Fedora, there's a change which makes default prefix to be
|
||||
/usr/local and we need to use /usr
|
||||
|
||||
Usage: make PREFIX=/usr/ install
|
||||
---
|
||||
framework/src/Makefile.am | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/framework/src/Makefile.am b/framework/src/Makefile.am
|
||||
index b0e87da..725cb96 100644
|
||||
--- a/framework/src/Makefile.am
|
||||
+++ b/framework/src/Makefile.am
|
||||
@@ -107,7 +107,8 @@ python-build:
|
||||
$(PYTHON) setup.py build
|
||||
|
||||
install-exec-hook:
|
||||
- $(PYTHON) setup.py install `test -n "$(DESTDIR)" && echo --root $(DESTDIR)`
|
||||
+ $(PYTHON) setup.py install `test -n "$(DESTDIR)" && echo --root $(DESTDIR)` \
|
||||
+ `test -n "$(PREFIX)" && echo --prefix $(PREFIX)`
|
||||
|
||||
uninstall-hook:
|
||||
$(PYTHON) setup.py uninstall `test -n "$(DESTDIR)" && echo --root $(DESTDIR)`
|
||||
--
|
||||
2.14.1
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
From af2aa6c0491cb719d4be2ce60bc79c0541d18a44 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Lautrbach <plautrba@redhat.com>
|
||||
Date: Thu, 14 Sep 2017 07:53:10 +0200
|
||||
Subject: [PATCH 15/19] framework: Don not catch POSIX signals
|
||||
|
||||
Let it kill your process in the normal way
|
||||
|
||||
See https://bugzilla.redhat.com/show_bug.cgi?id=1366004#c35
|
||||
|
||||
Fixes:
|
||||
Traceback (most recent call last):
|
||||
File "/usr/lib64/python3.6/site-packages/dbus/service.py", line 647, in _message_cb
|
||||
if not isinstance(message, MethodCallMessage):
|
||||
SystemError: <built-in function isinstance> returned a result with an error set
|
||||
Traceback (most recent call last):
|
||||
File "/usr/lib64/python3.6/site-packages/dbus/connection.py", line 521, in _signal_func
|
||||
def _signal_func(self, message):
|
||||
File "/usr/lib/python3.6/site-packages/setroubleshoot/server.py", line 114, in sighandler
|
||||
sys.exit()
|
||||
---
|
||||
framework/src/setroubleshoot/server.py | 5 -----
|
||||
1 file changed, 5 deletions(-)
|
||||
|
||||
diff --git a/framework/src/setroubleshoot/server.py b/framework/src/setroubleshoot/server.py
|
||||
index 7093bff..ccabff5 100755
|
||||
--- a/framework/src/setroubleshoot/server.py
|
||||
+++ b/framework/src/setroubleshoot/server.py
|
||||
@@ -113,8 +113,6 @@ def sighandler(signum, frame):
|
||||
log_debug("reloading configuration file")
|
||||
config.config_init()
|
||||
return
|
||||
- import sys
|
||||
- sys.exit()
|
||||
|
||||
def make_instance_id():
|
||||
import time
|
||||
@@ -710,9 +708,6 @@ def RunFaultServer(timeout=10):
|
||||
global host_database, analysis_queue, email_recipients
|
||||
|
||||
signal.signal(signal.SIGHUP, sighandler)
|
||||
- signal.signal(signal.SIGQUIT, sighandler)
|
||||
- signal.signal(signal.SIGTERM, sighandler)
|
||||
- signal.signal(signal.SIGALRM, sighandler)
|
||||
|
||||
#interface_registry.dump_interfaces()
|
||||
|
||||
--
|
||||
2.14.1
|
||||
|
|
@ -1,12 +1,24 @@
|
|||
Summary: Helps troubleshoot SELinux problems
|
||||
Name: setroubleshoot
|
||||
Version: 3.3.12
|
||||
Release: 1%{?dist}
|
||||
Release: 3%{?dist}
|
||||
License: GPLv2+
|
||||
Group: Applications/System
|
||||
URL: https://pagure.io/setroubleshoot
|
||||
Source0: https://releases.pagure.org/setroubleshoot/%{name}-%{version}.tar.gz
|
||||
Source1: %{name}.tmpfiles
|
||||
Patch1: 0002-framework-Don-t-stop-when-the-plugin-directory-is-em.patch
|
||||
Patch2: 0003-Fix-missing-margins-on-Troubleshoot-window.patch
|
||||
Patch3: 0004-Resize-all-solutions-panels-horizontally.patch
|
||||
Patch4: 0005-Fix-missing-priority-color-for-proposed-solutions.patch
|
||||
Patch5: 0007-framework-we-need-to-set-translation-domain-for-Gtk..patch
|
||||
Patch6: 0008-framework-Make-labels-on-GtkButtons-translatable.patch
|
||||
Patch7: 0011-framework-Handla-all-exceptions-from-do_analyze_logf.patch
|
||||
Patch8: 0012-framework-Fix-semi-translated-messages.patch
|
||||
Patch9: 0013-setroubleshoot-project-was-moved-to-https-pagure.io-.patch
|
||||
Patch10: 0014-framework-Allow-to-specify-setup.py-install-prefix-v.patch
|
||||
Patch11: 0015-framework-Don-not-catch-POSIX-signals.patch
|
||||
|
||||
BuildRequires: perl-XML-Parser
|
||||
BuildRequires: libcap-ng-devel
|
||||
BuildRequires: intltool gettext python3 python3-devel
|
||||
|
@ -90,6 +102,9 @@ rm -rf %{buildroot}/usr/share/doc/
|
|||
# create /run/setroubleshoot on boot
|
||||
install -m644 -D %{SOURCE1} $RPM_BUILD_ROOT%{_tmpfilesdir}/%{name}.conf
|
||||
|
||||
# install style.css - it's automatic in 3.3.13
|
||||
install -m644 gui/style.css %{buildroot}%{pkgguidir}/
|
||||
|
||||
|
||||
%find_lang %{name}
|
||||
|
||||
|
@ -202,6 +217,21 @@ rm -rf %{buildroot}
|
|||
|
||||
|
||||
%changelog
|
||||
* Tue Sep 19 2017 Petr Lautrbach <plautrba@redhat.com> - 3.3.12-3
|
||||
- Install style.css file (rhbz#1492761)
|
||||
|
||||
* Fri Sep 15 2017 Petr Lautrbach <plautrba@redhat.com> - 3.3.12-2
|
||||
- Don't stop when the plugin directory is empty
|
||||
- Fix missing margins on Troubleshoot window
|
||||
- Resize all solutions panels horizontally
|
||||
- Fix missing priority color for proposed solutions
|
||||
- Set translation domain for Gtk.Builder() object to have strings
|
||||
correctly translated
|
||||
- Make labels on GtkButtons translatable
|
||||
- Handla all exceptions from do_analyze_logfile()
|
||||
- Fix semi-translated messages
|
||||
- Do not catch POSIX signals (rhbz#1366004, rhbz#1419245)
|
||||
|
||||
* Tue Jun 13 2017 Petr Lautrbach <plautrba@redhat.com> - 3.3.12-1
|
||||
- Remove "Report bug" button when mozplugger plugin is used (#1290135)
|
||||
- Change "check_for_man" return value upon failure (#1431191)
|
||||
|
|
Loading…
Reference in New Issue