summaryrefslogtreecommitdiffstats
path: root/utils/gssd/gssd.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2013-11-20 13:55:50 -0500
committerSteve Dickson <steved@redhat.com>2013-11-20 15:04:47 -0500
commit250dbae681c3bd589f2fe52871b0c3611f72b87f (patch)
treeabba39124ec01d6e9b84e4365d7e5b1168248660 /utils/gssd/gssd.c
parent6a46d870c61433c8dea0270d9c10702b7b4b3d99 (diff)
downloadnfs-utils-250dbae681c3bd589f2fe52871b0c3611f72b87f.tar.gz
nfs-utils-250dbae681c3bd589f2fe52871b0c3611f72b87f.tar.xz
nfs-utils-250dbae681c3bd589f2fe52871b0c3611f72b87f.zip
gssd: don't let parent exit until child has a chance to scan directory once
With some proposed kernel changes, it won't even attempt to upcall sometimes if it doesn't appear that gssd is running. This means that we have a theoretical race between gssd starting up at boot time and the init process attempting to mount kerberized filesystems. Fix this by switching gssd to use mydaemon() and having the child only release the parent after it has processed the directory once. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/gssd/gssd.c')
-rw-r--r--utils/gssd/gssd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/utils/gssd/gssd.c b/utils/gssd/gssd.c
index 8ee478b..fdad153 100644
--- a/utils/gssd/gssd.c
+++ b/utils/gssd/gssd.c
@@ -54,6 +54,7 @@
#include "err_util.h"
#include "gss_util.h"
#include "krb5_util.h"
+#include "nfslib.h"
char pipefs_dir[PATH_MAX] = GSSD_PIPEFS_DIR;
char keytabfile[PATH_MAX] = GSSD_DEFAULT_KEYTAB_FILE;
@@ -63,6 +64,7 @@ int use_memcache = 0;
int root_uses_machine_creds = 1;
unsigned int context_timeout = 0;
char *preferred_realm = NULL;
+int pipefds[2] = { -1, -1 };
void
sig_die(int signal)
@@ -187,8 +189,8 @@ main(int argc, char *argv[])
if (gssd_check_mechs() != 0)
errx(1, "Problem with gssapi library");
- if (!fg && daemon(0, 0) < 0)
- errx(1, "fork");
+ if (!fg)
+ mydaemon(0, 0, pipefds);
signal(SIGINT, sig_die);
signal(SIGTERM, sig_die);