summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2013-11-20 12:59:39 -0500
committerSteve Dickson <steved@redhat.com>2013-11-20 15:04:47 -0500
commit95af6be7a7039282243118447d6d1895671504da (patch)
tree4ff14c5df449bd4b69043067fe9974721de5d04c
parentf47f22007c27a03c8ed4c53fe568eefa3c3de94e (diff)
downloadnfs-utils-95af6be7a7039282243118447d6d1895671504da.tar.gz
nfs-utils-95af6be7a7039282243118447d6d1895671504da.tar.xz
nfs-utils-95af6be7a7039282243118447d6d1895671504da.zip
gssd: don't let spurious signals interrupt the wait after forking
Because gssd uses dnotify under the hood, it's easily possible that the parent process can catch a signal while processing an upcall. If that happens, then we'll currently exit the wait for the child task to exit, and it'll end up as a zombie. Fix this by ensuring that we only wait for the child to actually exit. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--utils/gssd/gssd_proc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/utils/gssd/gssd_proc.c b/utils/gssd/gssd_proc.c
index 63fb3ec..2a6ea97 100644
--- a/utils/gssd/gssd_proc.c
+++ b/utils/gssd/gssd_proc.c
@@ -1044,7 +1044,10 @@ process_krb5_upcall(struct clnt_info *clp, uid_t uid, int fd, char *tgtname,
return;
default:
/* Parent: just wait on child to exit and return */
- wait(&err);
+ do {
+ pid = wait(&err);
+ } while(pid == -1 && errno != -ECHILD);
+
if (WIFSIGNALED(err))
printerr(0, "WARNING: forked child was killed with signal %d\n",
WTERMSIG(err));