diff options
author | jpaetzel <jpaetzel@FreeBSD.org> | 2016-01-01 17:06:16 +0000 |
---|---|---|
committer | jpaetzel <jpaetzel@FreeBSD.org> | 2016-01-01 17:06:16 +0000 |
commit | 5fd886aabf257d475889d0c57e9d15a6a27fff17 (patch) | |
tree | 999f4281209e2cacf1b5b91f31efe8360c331e34 | |
parent | 348ef00d1d3ac66572754b667c5ae8bd6d2d2d07 (diff) | |
download | FreeBSD-src-5fd886aabf257d475889d0c57e9d15a6a27fff17.zip FreeBSD-src-5fd886aabf257d475889d0c57e9d15a6a27fff17.tar.gz |
Unset the gss kernel state when gssd exits
When gssd exits it leaves the kernel state set by
gssd_syscall(). nfsd sees this and waits endlessly
in an unkillable state for gssd to come back. If you
had acidentally started gssd then stopped it, then
started nfsd you'd be in a bad way until you either
restarted gssd or rebooted the system. This change
fixes that by setting the kernel state to "" when
gssd exits.
Reviewed by: rmacklem
MFC after: 1 week
Sponsored by: iXsystems
-rw-r--r-- | sys/kgssapi/gss_impl.c | 19 | ||||
-rw-r--r-- | usr.sbin/gssd/gssd.c | 2 |
2 files changed, 13 insertions, 8 deletions
diff --git a/sys/kgssapi/gss_impl.c b/sys/kgssapi/gss_impl.c index ab6e55b..3a427a5 100644 --- a/sys/kgssapi/gss_impl.c +++ b/sys/kgssapi/gss_impl.c @@ -105,14 +105,17 @@ sys_gssd_syscall(struct thread *td, struct gssd_syscall_args *uap) if (error) return (error); - sun.sun_family = AF_LOCAL; - strcpy(sun.sun_path, path); - sun.sun_len = SUN_LEN(&sun); - - nconf = getnetconfigent("local"); - cl = clnt_reconnect_create(nconf, - (struct sockaddr *) &sun, GSSD, GSSDVERS, - RPC_MAXDATASIZE, RPC_MAXDATASIZE); + if (path[0] != '\0') { + sun.sun_family = AF_LOCAL; + strcpy(sun.sun_path, path); + sun.sun_len = SUN_LEN(&sun); + + nconf = getnetconfigent("local"); + cl = clnt_reconnect_create(nconf, + (struct sockaddr *) &sun, GSSD, GSSDVERS, + RPC_MAXDATASIZE, RPC_MAXDATASIZE); + } else + cl = NULL; mtx_lock(&kgss_gssd_lock); oldcl = kgss_gssd_handle; diff --git a/usr.sbin/gssd/gssd.c b/usr.sbin/gssd/gssd.c index e85dfd7..f3e5ce9 100644 --- a/usr.sbin/gssd/gssd.c +++ b/usr.sbin/gssd/gssd.c @@ -254,6 +254,7 @@ main(int argc, char **argv) gssd_syscall(_PATH_GSSDSOCK); svc_run(); + gssd_syscall(""); return (0); } @@ -1285,6 +1286,7 @@ void gssd_terminate(int sig __unused) if (hostbased_initiator_cred != 0) unlink(GSSD_CREDENTIAL_CACHE_FILE); #endif + gssd_syscall(""); exit(0); } |