Use O_CLOEXEC when opening pid file to avoid SELinux issues

Resolves: #809120
This commit is contained in:
Honza Horák 2012-04-16 12:33:17 +02:00
parent 69a9613448
commit 55ad40a9b9
2 changed files with 19 additions and 1 deletions

12
ypserv-2.27-cloexec.patch Normal file
View File

@ -0,0 +1,12 @@
diff -up ypserv-2.26/lib/pidfile.c.cloexec ypserv-2.26/lib/pidfile.c
--- ypserv-2.26/lib/pidfile.c.cloexec 2011-04-15 16:49:41.000000000 +0200
+++ ypserv-2.26/lib/pidfile.c 2012-04-13 20:49:55.643903727 +0200
@@ -33,7 +33,7 @@ create_pidfile (const char *filename, co
char pbuf[50], *ptr;
struct flock lock;
- fd = open (filename, O_CREAT | O_RDWR,
+ fd = open (filename, O_CREAT | O_RDWR | O_CLOEXEC,
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
if (fd < 0)
{

View File

@ -2,7 +2,7 @@ Summary: The NIS (Network Information Service) server
Url: http://www.linux-nis.org/nis/ypserv/index.html
Name: ypserv
Version: 2.27
Release: 1%{?dist}
Release: 2%{?dist}
License: GPLv2
Group: System Environment/Daemons
Source0: ftp://ftp.kernel.org/pub/linux/utils/net/NIS/ypserv-%{version}.tar.bz2
@ -32,6 +32,7 @@ Patch12: ypserv-2.26-shadow.patch
Patch13: ypserv-2.26-errmsg.patch
Patch14: ypserv-2.26-emptydomain.patch
Patch16: ypserv-2.27-confpost.patch
Patch17: ypserv-2.27-cloexec.patch
BuildRequires: compat-gdbm-devel
BuildRequires: systemd-units
@ -72,6 +73,7 @@ machines.
%patch13 -p1 -b .errmsg
%patch14 -p1 -b .emptydomain
%patch16 -p1 -b .confpost
%patch17 -p1 -b .cloexec
autoreconf
@ -176,6 +178,10 @@ exit 0
%{_includedir}/*/*
%changelog
* Fri Apr 13 2012 Honza Horak <hhorak@redhat.com> - 2.27-2
- Use O_CLOEXEC when opening pid file to avoid SELinux issues
Resolves: #809120
* Wed Feb 01 2012 Honza Horak <hhorak@redhat.com> - 2.27-1
- Update to new upstream version, which fixes several bugs
(removing patches that aren't needed any more)