setroubleshoot-3.3.24-4

- sealert: exit on any connection close
This commit is contained in:
Vit Mojzis 2021-02-02 16:00:23 +01:00
parent 179d13d432
commit c42ca71e46
2 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,30 @@
From e339956442fb7284bce31e132b0be7ad0f3badc5 Mon Sep 17 00:00:00 2001
From: Vit Mojzis <vmojzis@redhat.com>
Date: Tue, 2 Feb 2021 13:18:49 +0100
Subject: [PATCH] framework/sealert: exit on any connection close
SECommandLine is only connecting to setroubleshootd for a short time.
Therefore any connection close from "server" side should be treated as
error.
This prevents "sealert" from hanging when setroubleshootd crashes.
---
framework/src/sealert | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/framework/src/sealert b/framework/src/sealert
index 7839367..bae0c81 100755
--- a/framework/src/sealert
+++ b/framework/src/sealert
@@ -488,7 +488,7 @@ class SECommandLine(object):
def on_connection_state_change(self, connection, connection_state, flags, flags_added, flags_removed):
log_debug("%s.on_connection_state_change: connection_state=%s flags_added=%s flags_removed=%s address=%s" % (self.__class__.__name__, connection_state, connection_state.flags_to_string(flags_added), connection_state.flags_to_string(flags_removed), connection.socket_address))
- if flags_added & ConnectionState.ERROR:
+ if (flags_added & (ConnectionState.ERROR | ConnectionState.HUP)) or (flags_removed & ConnectionState.OPEN):
errno, strerror = connection_state.get_result()
print("failed to connect to server: %s" % (strerror), file=sys.stderr)
sys.exit(1)
--
2.29.2

View File

@ -4,7 +4,7 @@
Summary: Helps troubleshoot SELinux problems
Name: setroubleshoot
Version: 3.3.24
Release: 3%{?dist}
Release: 4%{?dist}
License: GPLv2+
URL: https://pagure.io/setroubleshoot
Source0: https://releases.pagure.org/setroubleshoot/%{name}-%{version}.tar.gz
@ -13,6 +13,7 @@ Source1: %{name}.tmpfiles
# i=1; for j in 00*patch; do printf "Patch%04d: %s\n" $i $j; i=$((i+1));done
Patch0001: 0001-framework-Update-translations.patch
Patch0002: 0002-framework-util-optimize-get_rpm_nvr_by_type-by-addin.patch
Patch0003: 0003-framework-sealert-exit-on-any-connection-close.patch
BuildRequires: gcc
BuildRequires: make
BuildRequires: libcap-ng-devel
@ -190,6 +191,9 @@ chown -R setroubleshoot:setroubleshoot %{pkgvardatadir}
%doc AUTHORS COPYING ChangeLog DBUS.md NEWS README TODO
%changelog
* Tue Feb 02 2021 Vit Mojzis <vmojzis@redhat.com> - 3.3.24-4
- sealert: exit on any connection close
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.24-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild