From 655dea46d746845b4e1d6688438f9096ae82df29 Mon Sep 17 00:00:00 2001 From: liuxinhao Date: Fri, 9 Jun 2023 11:25:25 +0800 Subject: [PATCH] fix(browser): when selinux disable,sealert -b crash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 当禁用selinux,启动SELinux故障排查工具没有弹窗 --- ...when-selinux-disable-sealert-b-crash.patch | 54 +++++++++++++++++++ setroubleshoot.spec | 8 ++- 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 fix-browser-when-selinux-disable-sealert-b-crash.patch diff --git a/fix-browser-when-selinux-disable-sealert-b-crash.patch b/fix-browser-when-selinux-disable-sealert-b-crash.patch new file mode 100644 index 0000000..023d42f --- /dev/null +++ b/fix-browser-when-selinux-disable-sealert-b-crash.patch @@ -0,0 +1,54 @@ +From d73ce9495979b6809f7f63234a63bf6f903bbdbd Mon Sep 17 00:00:00 2001 +From: rpm-build +Date: Fri, 9 Jun 2023 11:20:09 +0800 +Subject: [PATCH] fix(browser): when selinux disable,sealert -b crash +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- 当禁用selinux,启动SELinux故障排查工具没有弹窗 +--- + src/sealert | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/src/sealert b/src/sealert +index 7839367..43cfc04 100755 +--- a/src/sealert ++++ b/src/sealert +@@ -104,10 +104,11 @@ def run_app(user): + + + def error(message): +- dlg = gtk.MessageDialog(None, 0, gtk.MESSAGE_ERROR, +- gtk.BUTTONS_CLOSE, +- message) +- dlg.set_position(gtk.WIN_POS_MOUSE) ++ dlg = Gtk.MessageDialog(parent=None, flags=0, ++ type=Gtk.MessageType.ERROR, ++ buttons=Gtk.ButtonsType.CLOSE, ++ message_format=message) ++ dlg.set_position(Gtk.WindowPosition.CENTER) + dlg.show_all() + dlg.run() + dlg.destroy() +@@ -426,7 +427,7 @@ class SEAlert(object): + def on_quit(self, widget): + if self.alert_client is not None: + self.alert_client.close_connection(ConnectionState.HUP) +- gtk.main_quit() ++ Gtk.main_quit() + + def on_show_browser(self, widget, data_name): + self.show_browser(data_name) +@@ -672,6 +673,8 @@ if __name__ == '__main__': + log_debug("invocation style = '%s'" % invocation_style) + + if invocation_style == 'browser': ++ gi.require_version('Gtk', GTK_VERSION) ++ from gi.repository import Gtk + ask_dbus_to_show_browser() + sys.exit() + elif invocation_style == 'service': +-- +2.33.0 + diff --git a/setroubleshoot.spec b/setroubleshoot.spec index 6a88fb2..43d444f 100644 --- a/setroubleshoot.spec +++ b/setroubleshoot.spec @@ -1,6 +1,6 @@ Name: setroubleshoot Version: 3.3.24 -Release: 3 +Release: 4 Summary: SELinux Trouble Shooting Tool License: GPLv2+ URL: https://pagure.io/setroubleshoot @@ -10,8 +10,11 @@ Source1: %{name}.tmpfiles Patch1: backport-0001-framework-Update-translations.patch +Patch2: fix-browser-when-selinux-disable-sealert-b-crash.patch + Patch9000: Fix-config-file-to-deny-noraml-user-to-stop-Setroubleshootd.patch + BuildRequires: gcc libcap-ng-devel intltool gettext python3 python3-devel git BuildRequires: desktop-file-utils dbus-glib-devel gtk2-devel libnotify-devel audit-libs-devel libselinux-devel polkit-devel BuildRequires: python3-libselinux python3-pydbus python3-gobject gtk3-devel xdg-utils @@ -160,6 +163,9 @@ chown -R setroubleshoot:setroubleshoot %{_localstatedir}/lib/%{name} %{_mandir}/man1/seapplet.1.gz %changelog +* Fri Jun 09 2023 liuxinhao - 3.3.24-4 +- when selinux is disabled, no error box pops up + * Mon Dec 27 2021 Hugel - 3.3.24-3 - Fix the problem when setroubleshoot is installed, or updated. -- Gitee