From patchwork Thu Dec 8 04:27:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 9465769 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B9FCD60459 for ; Thu, 8 Dec 2016 04:30:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0F062855B for ; Thu, 8 Dec 2016 04:30:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 952C42857F; Thu, 8 Dec 2016 04:30:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E09FA2855B for ; Thu, 8 Dec 2016 04:30:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932193AbcLHEaB (ORCPT ); Wed, 7 Dec 2016 23:30:01 -0500 Received: from mx2.suse.de ([195.135.220.15]:44053 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752887AbcLHEaA (ORCPT ); Wed, 7 Dec 2016 23:30:00 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 57E13ABFA; Thu, 8 Dec 2016 04:28:45 +0000 (UTC) From: NeilBrown To: "J. Bruce Fields" , Steve Dickson Date: Thu, 08 Dec 2016 15:27:26 +1100 Subject: [PATCH 10/10] svcgssd: add /etc/nfs.conf support Cc: linux-nfs@vger.kernel.org Message-ID: <148117124604.31271.10528572108892267997.stgit@noble> In-Reply-To: <148117122602.31271.13586847542442809540.stgit@noble> References: <148117122602.31271.13586847542442809540.stgit@noble> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: NeilBrown --- 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 --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