[setroubleshoot/f18] Fix timeout of setroubleshoot so that it dies after 10 seconds of non use

Daniel J Walsh dwalsh at fedoraproject.org
Fri Apr 19 13:12:20 UTC 2013


commit 320d67bf770e1139fa0cfa32885613b23e6860ae
Author: Dan Walsh <dwalsh at redhat.com>
Date:   Fri Apr 19 09:12:12 2013 -0400

    Fix timeout of setroubleshoot so that it dies after 10 seconds of non use

 setroubleshoot-3.2.3_timeout.patch |   35 +++++++++++++++++++++++++++++++++++
 setroubleshoot.spec                |    7 ++++++-
 2 files changed, 41 insertions(+), 1 deletions(-)
---
diff --git a/setroubleshoot-3.2.3_timeout.patch b/setroubleshoot-3.2.3_timeout.patch
new file mode 100644
index 0000000..0040a13
--- /dev/null
+++ b/setroubleshoot-3.2.3_timeout.patch
@@ -0,0 +1,35 @@
+diff -up setroubleshoot-3.2.3/src/setroubleshootd~ setroubleshoot-3.2.3/src/setroubleshootd
+--- setroubleshoot-3.2.3/src/setroubleshootd~	2012-07-10 08:59:53.000000000 -0400
++++ setroubleshoot-3.2.3/src/setroubleshootd	2013-04-19 09:09:20.659883409 -0400
+@@ -38,12 +38,11 @@ def usage():
+     print '''
+ -f --nofork				no fork
+ -c --config section.option=value	set a configuration value
+--v --verbose                            log INFO level and higher messages to console
+--V --debug                              log DEBUG level and higher messages to console
+ -h --help				display help info
+ '''
+ 
+ fork = True
++timeout = 10
+ 
+ try:
+     opts, args = getopt.getopt(sys.argv[1:], "fc:h", ["nofork","config=","help"])
+@@ -59,6 +58,7 @@ for o, a in opts:
+ 
+     if o in ("-f", "--nofork"):
+         fork = False
++	timeout = 0 
+ 
+     if o in ("-c", "--config"):
+         config_setting = a
+@@ -73,9 +73,7 @@ import dbus.service
+ import dbus
+ 
+ try: 
+-    timeout = 0
+     if fork:
+-        timeput = 10
+         # do the UNIX double-fork magic, see Stevens' "Advanced 
+         # Programming in the UNIX Environment" for details (ISBN 0201563177)
+         pid = os.fork() 
diff --git a/setroubleshoot.spec b/setroubleshoot.spec
index 1a5a7db..0ff930c 100644
--- a/setroubleshoot.spec
+++ b/setroubleshoot.spec
@@ -1,13 +1,14 @@
 Summary: Helps troubleshoot SELinux problems
 Name: setroubleshoot
 Version: 3.2.3
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: GPLv2+
 Group: Applications/System
 URL: https://fedorahosted.org/setroubleshoot
 # git clone git://git.fedorahosted.org/git/setroubleshoot.git; cd setroubleshoot
 # git archive --prefix setroubleshoot-3.0.10/426cf8ea7a38e8c5179981219d831368161b65f2 > setroubleshoot-3.0.10.tar.gz
 Source0: %{name}-%{version}.tar.gz
+Patch0: setroubleshoot-3.2.3_timeout.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: perl-XML-Parser
 BuildRequires: libcap-ng-devel
@@ -79,6 +80,7 @@ fi
 
 %prep
 %setup -q
+%patch0 -p1 -b .timeout
 
 %build
 %configure
@@ -182,6 +184,9 @@ rm -rf %{buildroot}
 %{_datadir}/dbus-1/system-services/org.fedoraproject.SetroubleshootFixit.service
 
 %changelog
+* Fri Apr 19 2013 Dan Walsh <dwalsh at redhat.com> - 3.2.3-2
+- Fix timeout of setroubleshoot so that it dies after 10 seconds of non use
+
 * Fri Feb 15 2013 Dan Walsh <dwalsh at redhat.com> - 3.2.3-1
 - Update Translations
 - Fix audit2allow -R output to actually work.


More information about the scm-commits mailing list