make commandtest more robust

remotes/origin/f15
Laine Stump 2011-07-06 10:54:36 -04:00
parent 6051cec412
commit 05aa1933ee
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,32 @@
From 12509c09a55bd2ab171f9fa029fb94f297adc0a0 Mon Sep 17 00:00:00 2001
From: Daniel P. Berrange <berrange@redhat.com>
Date: Thu, 24 Feb 2011 12:12:27 +0000
Subject: [PATCH] Make commandtest more robust wrt its execution environment
When executed from cron, commandtest would fail to correctly
identify daemon processes. Set session ID and process group
IDs at startup to ensure we have a consistent environment to
run in.
* tests/commandtest.c: Call setsid() and setpgid()
---
tests/commandtest.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/tests/commandtest.c b/tests/commandtest.c
index 7157c51..dc2f8a1 100644
--- a/tests/commandtest.c
+++ b/tests/commandtest.c
@@ -730,6 +730,9 @@ mymain(int argc, char **argv)
if (chdir("/tmp") < 0)
return(EXIT_FAILURE);
+ setpgid(0, 0);
+ setsid();
+
/* Kill off any inherited fds that might interfere with our
* testing. */
fd = 3;
--
1.7.3.4

View File

@ -219,6 +219,7 @@ Patch7: %{name}-%{version}-virt-pki-validate-behave-when-CERTTOOL-is-missing.pat
Patch8: %{name}-%{version}-build-add-dependency-on-gnutls-utils.patch
Patch9: %{name}-%{version}-rpm-add-missing-dependencies.patch
Patch10: %{name}-%{version}-remote-protect-against-integer-overflow.patch
Patch11: %{name}-%{version}-make-commandtest-more-robust.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
URL: http://libvirt.org/
BuildRequires: python-devel
@ -501,6 +502,7 @@ of recent versions of Linux (and other OSes).
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%build
%if ! %{with_xen}
@ -1030,6 +1032,7 @@ fi
Bug 717204
- Add several build and runtime dependencies to specfile
Bug 680270
- Make commandtest more robust.
* Tue Apr 5 2011 Laine Stump <laine@redhat.com> 0.8.8-4
- Fix for CVE-2011-1486, error reporting in libvirtd is not thread safe,