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:25:15 +02:00
parent 0de35c3f0d
commit 44759b5a05
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.26
Release: 9%{?dist}
Release: 10%{?dist}
License: GPLv2
Group: System Environment/Daemons
Source0: ftp://ftp.kernel.org/pub/linux/utils/net/NIS/ypserv-%{version}.tar.bz2
@ -34,6 +34,7 @@ Patch12: ypserv-2.26-shadow.patch
Patch13: ypserv-2.26-errmsg.patch
Patch14: ypserv-2.26-emptydomain.patch
Patch15: ypserv-2.26-retval.patch
Patch16: ypserv-2.27-cloexec.patch
BuildRequires: gdbm-devel
BuildRequires: systemd-units
BuildRequires: autoconf, automake
@ -75,6 +76,7 @@ machines.
%patch13 -p1 -b .errmsg
%patch14 -p1 -b .emptydomain
%patch15 -p1 -b .retval
%patch16 -p1 -b .cloexec
autoreconf
@ -179,6 +181,10 @@ exit 0
%{_includedir}/*/*
%changelog
* Fri Apr 13 2012 Honza Horak <hhorak@redhat.com> - 2.26-10
- Use O_CLOEXEC when opening pid file to avoid SELinux issues
Resolves: #809120
* Thu Jan 12 2012 Honza Horak <hhorak@redhat.com> - 2.26-9
- Added ypserv-pre-setdomain to respect NISDOMAIN environment variable
and set domainname if empty