Blob Blame History Raw
diff -up nfs-utils-1.2.8/utils/gssd/gssd.c.orig nfs-utils-1.2.8/utils/gssd/gssd.c
--- nfs-utils-1.2.8/utils/gssd/gssd.c.orig	2013-04-22 12:47:20.000000000 -0400
+++ nfs-utils-1.2.8/utils/gssd/gssd.c	2014-01-22 14:26:22.072929000 -0500
@@ -46,6 +46,7 @@
 
 #include <unistd.h>
 #include <err.h>
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -159,6 +160,18 @@ main(int argc, char *argv[])
 		}
 	}
 
+	/*
+	 * Some krb5 routines try to scrape info out of files in the user's
+	 * home directory. This can easily deadlock when that homedir is on a
+	 * kerberized NFS mount. By setting $HOME unconditionally to "/", we
+	 * prevent this behavior in routines that use $HOME in preference to
+	 * the results of getpw*.
+	 */
+	if (setenv("HOME", "/", 1)) {
+		printerr(1, "Unable to set $HOME: %s\n", strerror(errno));
+		exit(1);
+	}
+
 	i = 0;
 	ccachesearch[i++] = strtok(ccachedir, ":");
 	do {