summaryrefslogtreecommitdiffstats
path: root/utils/idmapd/idmapd.c
diff options
context:
space:
mode:
authorSteve Dickson <steved@redhat.com>2009-06-29 10:44:20 -0400
committerSteve Dickson <steved@redhat.com>2009-06-29 10:44:20 -0400
commit1aa4121ba599de836702d7b2d38cad63e6a09044 (patch)
treea75fb1475e690378125748180da37d37b4d02a3e /utils/idmapd/idmapd.c
parent097128d72d1ab4be299bf5fdc0b8e83667fc159b (diff)
downloadnfs-utils-1aa4121ba599de836702d7b2d38cad63e6a09044.tar.gz
nfs-utils-1aa4121ba599de836702d7b2d38cad63e6a09044.tar.xz
nfs-utils-1aa4121ba599de836702d7b2d38cad63e6a09044.zip
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@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/idmapd/idmapd.c')
-rw-r--r--utils/idmapd/idmapd.c9
1 files changed, 6 insertions, 3 deletions
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;