Blame SOURCES/nfs-utils-2.3.3-gssd-usegssproxy.patch

bc9fd4
commit 104f90f4ce964ddcfe50d4d24cc5e7ff96952299
bc9fd4
Author: Steve Dickson <steved@redhat.com>
bc9fd4
Date:   Sat Oct 20 12:01:37 2018 -0400
bc9fd4
bc9fd4
    gssd: Introduce use-gss-proxy boolean to nfs.conf
bc9fd4
    
bc9fd4
    Allow the used of the gssprox-mech(8) through a the
bc9fd4
    boolean variable in the [gssd] section of nfs.conf
bc9fd4
    
bc9fd4
    Signed-off-by: Steve Dickson <steved@redhat.com>
bc9fd4
bc9fd4
diff --git a/nfs.conf b/nfs.conf
bc9fd4
index 0d0ec9b..5546109 100644
bc9fd4
--- a/nfs.conf
bc9fd4
+++ b/nfs.conf
bc9fd4
@@ -11,6 +11,7 @@
bc9fd4
 #[gssd]
bc9fd4
 # use-memcache=0
bc9fd4
 # use-machine-creds=1
bc9fd4
+# use-gss-proxy=0
bc9fd4
 # avoid-dns=1
bc9fd4
 # limit-to-legacy-enctypes=0
bc9fd4
 # context-timeout=0
bc9fd4
diff --git a/systemd/nfs.conf.man b/systemd/nfs.conf.man
bc9fd4
index 189b052..699db3f 100644
bc9fd4
--- a/systemd/nfs.conf.man
bc9fd4
+++ b/systemd/nfs.conf.man
bc9fd4
@@ -213,6 +213,7 @@ for details.
bc9fd4
 Recognized values:
bc9fd4
 .BR use-memcache ,
bc9fd4
 .BR use-machine-creds ,
bc9fd4
+.BR use-gss-proxy ,
bc9fd4
 .BR avoid-dns ,
bc9fd4
 .BR limit-to-legacy-enctypes ,
bc9fd4
 .BR context-timeout ,
bc9fd4
diff --git a/utils/gssd/gssd.c b/utils/gssd/gssd.c
bc9fd4
index 00df2fc..2e92f28 100644
bc9fd4
--- a/utils/gssd/gssd.c
bc9fd4
+++ b/utils/gssd/gssd.c
bc9fd4
@@ -89,6 +89,7 @@ char *preferred_realm = NULL;
bc9fd4
 char *ccachedir = NULL;
bc9fd4
 /* Avoid DNS reverse lookups on server names */
bc9fd4
 static bool avoid_dns = true;
bc9fd4
+static bool use_gssproxy = false;
bc9fd4
 int thread_started = false;
bc9fd4
 pthread_mutex_t pmutex = PTHREAD_MUTEX_INITIALIZER;
bc9fd4
 pthread_cond_t pcond = PTHREAD_COND_INITIALIZER;
bc9fd4
@@ -872,6 +873,7 @@ read_gss_conf(void)
bc9fd4
 	if (s)
bc9fd4
 		preferred_realm = s;
bc9fd4
 
bc9fd4
+	use_gssproxy = conf_get_bool("gssd", "use-gss-proxy", use_gssproxy);
bc9fd4
 }
bc9fd4
 
bc9fd4
 int
bc9fd4
@@ -957,6 +959,14 @@ main(int argc, char *argv[])
bc9fd4
 		exit(1);
bc9fd4
 	}
bc9fd4
 
bc9fd4
+	if (use_gssproxy) {
bc9fd4
+		if (setenv("GSS_USE_PROXY", "yes", 1) < 0) {
bc9fd4
+			printerr(0, "gssd: Unable to set $GSS_USE_PROXY: %s\n", 
bc9fd4
+				strerror(errno));
bc9fd4
+			exit(EXIT_FAILURE);
bc9fd4
+		}
bc9fd4
+	}
bc9fd4
+
bc9fd4
 	if (ccachedir) {
bc9fd4
 		char *ccachedir_copy;
bc9fd4
 		char *ptr;