diff mbox

[10/10] svcgssd: add /etc/nfs.conf support

Message ID 148117124604.31271.10528572108892267997.stgit@noble (mailing list archive)
State New, archived
Headers show

Commit Message

NeilBrown Dec. 8, 2016, 4:27 a.m. UTC
Signed-off-by: NeilBrown <neilb@suse.com>
---
 systemd/nfs.conf.man   |    9 +++++++++
 utils/gssd/svcgssd.c   |   14 ++++++++++++++
 utils/gssd/svcgssd.man |   17 +++++++++++++++++
 3 files changed, 40 insertions(+)



--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/systemd/nfs.conf.man b/systemd/nfs.conf.man
index 938b9705414a..91c49a0f76ab 100644
--- a/systemd/nfs.conf.man
+++ b/systemd/nfs.conf.man
@@ -208,6 +208,15 @@  See
 for details.
 
 .TP
+.B svcgssd
+Recognized values:
+.BR principal .
+
+See
+.BR rpc.svcgssd (8)
+for details.
+
+.TP
 .B exportfs
 Only
 .B debug=
diff --git a/utils/gssd/svcgssd.c b/utils/gssd/svcgssd.c
index 0fe7c6ddb686..1fb579aa03f3 100644
--- a/utils/gssd/svcgssd.c
+++ b/utils/gssd/svcgssd.c
@@ -61,6 +61,9 @@ 
 #include "svcgssd.h"
 #include "gss_util.h"
 #include "err_util.h"
+#include "conffile.h"
+
+char *conf_path = NFS_CONFFILE;
 
 void
 sig_die(int signal)
@@ -98,6 +101,17 @@  main(int argc, char *argv[])
 	extern char *optarg;
 	char *progname;
 	char *principal = NULL;
+	char *s;
+
+	conf_init();
+
+	s = conf_get_str("svcgssd", "principal");
+	if (!s)
+		;
+	else if (strcmp(s, "system")== 0)
+		get_creds = 0;
+	else
+		principal = s;
 
 	while ((opt = getopt(argc, argv, "fivrnp:")) != -1) {
 		switch (opt) {
diff --git a/utils/gssd/svcgssd.man b/utils/gssd/svcgssd.man
index 7b2de6b1ab91..15ef4c94af19 100644
--- a/utils/gssd/svcgssd.man
+++ b/utils/gssd/svcgssd.man
@@ -45,6 +45,23 @@  Use the system default credentials
 .RI (host/ FQDN @ REALM )
 rather than the default
 .RI nfs/ FQDN @ REALM .
+.SH CONFIGURATION FILE
+Some of the options that can be set on the command line can also be
+controlled through values set in the
+.B [svcgssd]
+section of the
+.I /etc/nfs.conf
+configuration file.  Values recognized include:
+.TP
+.B principal
+If set to
+.B system
+this is equivalent to the
+.B -n
+option.  If set to any other value, that is used like the
+.B -p
+option.
+
 .SH SEE ALSO
 .BR rpc.gssd(8),
 .SH AUTHORS