diff --git a/sys/kgssapi/gss_impl.c b/sys/kgssapi/gss_impl.c index 8ed984484809..4359c9edc07b 100644 --- a/sys/kgssapi/gss_impl.c +++ b/sys/kgssapi/gss_impl.c @@ -112,6 +112,15 @@ sys_gssd_syscall(struct thread *td, struct gssd_syscall_args *uap) cl = clnt_reconnect_create(nconf, (struct sockaddr *) &sun, GSSD, GSSDVERS, RPC_MAXDATASIZE, RPC_MAXDATASIZE); + /* + * The number of retries defaults to INT_MAX, which effectively + * means an infinite, uninterruptable loop. Limiting it to + * five retries keeps it from running forever. + */ + if (cl != NULL) { + int retry_count = 5; + CLNT_CONTROL(cl, CLSET_RETRIES, &retry_count); + } } else cl = NULL; diff --git a/usr.sbin/gssd/gssd.c b/usr.sbin/gssd/gssd.c index 488c7de0d581..92dd93db2751 100644 --- a/usr.sbin/gssd/gssd.c +++ b/usr.sbin/gssd/gssd.c @@ -202,6 +202,7 @@ main(int argc, char **argv) signal(SIGHUP, SIG_IGN); } signal(SIGTERM, gssd_terminate); + signal(SIGPIPE, gssd_terminate); memset(&sun, 0, sizeof sun); sun.sun_family = AF_LOCAL;