rpms/nfs-utils/devel nfs-utils-1.2.1-mydaemon.patch, NONE, 1.1 nfs-utils.spec, 1.233, 1.234

Steve Dickson steved at fedoraproject.org
Mon Jun 29 14:59:09 UTC 2009


Author: steved

Update of /cvs/pkgs/rpms/nfs-utils/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv3443

Modified Files:
	nfs-utils.spec 
Added Files:
	nfs-utils-1.2.1-mydaemon.patch 
Log Message:
Stopped rpc.idmapd from spinning (bz 508221)


nfs-utils-1.2.1-mydaemon.patch:

--- NEW FILE nfs-utils-1.2.1-mydaemon.patch ---
commit 1aa4121ba599de836702d7b2d38cad63e6a09044
Author: Steve Dickson <steved at redhat.com>
Date:   Mon Jun 29 10:44:20 2009 -0400

    mydaemon: remove closeall() calls from mydaemon()
    
    idmapd and svcgssd have a mydaemon() routine that uses closeall() to
    close file descriptors. Unfortunately, they aren't using it correctly
    and it ends up closing the pipe that the child process uses to talk to
    its parent.
    
    Fix this by not using closeall() in this routine and instead, just close
    the file descriptors that we know need to be closed. If /dev/null can't
    be opened for some reason, then just have the child exit with a non-zero
    error.
    
    Signed-off-by: Jeff Layton <jlayton at redhat.com>
    Signed-off-by: Steve Dickson <steved at redhat.com>

diff --git a/utils/gssd/svcgssd.c b/utils/gssd/svcgssd.c
index 69d2a69..729b6a6 100644
--- a/utils/gssd/svcgssd.c
+++ b/utils/gssd/svcgssd.c
@@ -117,10 +117,16 @@ mydaemon(int nochdir, int noclose)
 
 	if (noclose == 0) {
 		tempfd = open("/dev/null", O_RDWR);
-		dup2(tempfd, 0);
-		dup2(tempfd, 1);
-		dup2(tempfd, 2);
-		closeall(3);
+		if (tempfd >= 0) {
+			dup2(tempfd, 0);
+			dup2(tempfd, 1);
+			dup2(tempfd, 2);
+			close(tempfd);
+		} else {
+			printerr(1, "mydaemon: can't open /dev/null: errno %d "
+				    "(%s)\n", errno, strerror(errno));
+			exit(1);
+		}
 	}
 
 	return;
diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c
index b690e21..9cbe96c 100644
--- a/utils/idmapd/idmapd.c
+++ b/utils/idmapd/idmapd.c
@@ -978,9 +978,12 @@ mydaemon(int nochdir, int noclose)
 			dup2(tempfd, 0);
 			dup2(tempfd, 1);
 			dup2(tempfd, 2);
-			closeall(3);
-		} else
-			closeall(0);
+			close(tempfd);
+		} else {
+			err(1, "mydaemon: can't open /dev/null: errno %d",
+			       errno);
+			exit(1);
+		}
 	}
 
 	return;


Index: nfs-utils.spec
===================================================================
RCS file: /cvs/pkgs/rpms/nfs-utils/devel/nfs-utils.spec,v
retrieving revision 1.233
retrieving revision 1.234
diff -u -p -r1.233 -r1.234
--- nfs-utils.spec	22 Jun 2009 15:47:16 -0000	1.233
+++ nfs-utils.spec	29 Jun 2009 14:58:38 -0000	1.234
@@ -2,7 +2,7 @@ Summary: NFS utilities and supporting cl
 Name: nfs-utils
 URL: http://sourceforge.net/projects/nfs
 Version: 1.2.0
-Release: 4%{?dist}
+Release: 5%{?dist}
 Epoch: 1
 
 # group all 32bit related archs
@@ -23,6 +23,7 @@ Patch01: nfs-utils-1.1.0-smnotify-path.p
 Patch02: nfs-utils-1.1.0-exp-subtree-warn-off.patch
 
 Patch100: nfs-utils-1.2.1-rc1.patch
+Patch101: nfs-utils-1.2.1-mydaemon.patch
 
 Group: System Environment/Daemons
 Provides: exportfs    = %{epoch}:%{version}-%{release}
@@ -47,14 +48,14 @@ Buildroot: %{_tmppath}/%{name}-%{version
 Requires: rpcbind, sed, gawk, sh-utils, fileutils, textutils, grep
 Requires: modutils >= 2.4.26-9
 BuildRequires: libgssglue-devel libevent-devel
-BuildRequires: nfs-utils-lib-devel >= 1.1.0-3 libtirpc-devel libblkid-devel
+BuildRequires: nfs-utils-lib-devel >= 1.1.0-3 libtirpc-devel
 BuildRequires: krb5-libs >= 1.4 autoconf >= 2.57 openldap-devel >= 2.2
 BuildRequires: automake, libtool, glibc-headers
 BuildRequires: e2fsprogs-devel, krb5-devel, tcp_wrappers-devel
 Requires(pre): shadow-utils >= 4.0.3-25
 Requires(pre): /sbin/chkconfig /sbin/nologin
 Requires: nfs-utils-lib >= 1.1.0-3 libgssglue libevent
-Requires: libtirpc libblkid
+Requires: libtirpc e2fsprogs-libs
 
 %description
 The nfs-utils package provides a daemon for the kernel NFS server and
@@ -75,6 +76,7 @@ This package also contains the mount.nfs
 %patch02 -p1
 
 %patch100 -p1
+%patch101 -p1
 
 # Remove .orig files
 find . -name "*.orig" | xargs rm -f
@@ -243,6 +245,9 @@ fi
 %attr(4755,root,root)   /sbin/umount.nfs4
 
 %changelog
+* Mon Jun 29 2009 <steved at redhat.com> 1.2.0-5
+- Stopped rpc.idmapd from spinning (bz 508221)
+
 * Mon Jun 22 2009 <steved at redhat.com> 1.2.0-4
 - Added upstream 1.2.1-rc1 patch 
   - Fix to check in closeall()




More information about the fedora-extras-commits mailing list