[nfs-utils/f19] gssd: set $HOME to prevent recursion when home dirs are on kerberized (bz 1052902)

Steve Dickson steved at fedoraproject.org
Wed Jan 22 19:23:18 UTC 2014


commit 8a329e05708c8f5197615cb8a9db1d84175c81dd
Author: Steve Dickson <steved at redhat.com>
Date:   Wed Jan 22 14:22:51 2014 -0500

    gssd: set $HOME to prevent recursion when home dirs are on kerberized (bz 1052902)
    
    Signed-off-by: Steve Dickson <steved at redhat.com>

 nfs-utils-1.2.8-gssd-home.patch |   30 ++++++++++++++++++++++++++++++
 nfs-utils.spec                  |    7 ++++++-
 2 files changed, 36 insertions(+), 1 deletions(-)
---
diff --git a/nfs-utils-1.2.8-gssd-home.patch b/nfs-utils-1.2.8-gssd-home.patch
new file mode 100644
index 0000000..b65c309
--- /dev/null
+++ b/nfs-utils-1.2.8-gssd-home.patch
@@ -0,0 +1,30 @@
+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 {
diff --git a/nfs-utils.spec b/nfs-utils.spec
index ac096a2..7f7bc9a 100644
--- a/nfs-utils.spec
+++ b/nfs-utils.spec
@@ -2,7 +2,7 @@ Summary: NFS utilities and supporting clients and daemons for the kernel NFS ser
 Name: nfs-utils
 URL: http://sourceforge.net/projects/nfs
 Version: 1.2.8
-Release: 6.2%{?dist}
+Release: 6.3%{?dist}
 Epoch: 1
 
 # group all 32bit related archs
@@ -37,6 +37,7 @@ Source52: nfs-server.postconfig
 %define nfs_configs %{SOURCE50} %{SOURCE51} %{SOURCE52} 
 
 Patch001: nfs-utils.1.2.9-rc6.patch
+Patch002: nfs-utils-1.2.8-gssd-home.patch
 
 Patch100: nfs-utils-1.2.1-statdpath-man.patch
 Patch101: nfs-utils-1.2.1-exp-subtree-warn-off.patch
@@ -94,6 +95,7 @@ This package also contains the mount.nfs and umount.nfs program.
 %setup -q
 
 %patch001 -p1
+%patch002 -p1
 
 %patch100 -p1
 %patch101 -p1
@@ -312,6 +314,9 @@ fi
 /sbin/umount.nfs4
 
 %changelog
+* Wed Jan 22 2014 Steve Dickson <steved at redhat.com> 1.2.8-6.3
+- gssd: set $HOME to prevent recursion when home dirs are on kerberized (bz 1052902)
+
 * Fri Jan 10 2014 Steve Dickson <steved at redhat.com> 1.2.8-6.2
 - Fixed typo in nfs-service file. (bz 1047972)
 


More information about the scm-commits mailing list