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: 9465771 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 26488607D3 for ; Thu, 8 Dec 2016 04:30:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DBB02855B for ; Thu, 8 Dec 2016 04:30:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 02B152857B; 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 8D7E22857D for ; Thu, 8 Dec 2016 04:30:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752887AbcLHEaC (ORCPT ); Wed, 7 Dec 2016 23:30:02 -0500 Received: from mx2.suse.de ([195.135.220.15]:44037 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752789AbcLHEaB (ORCPT ); Wed, 7 Dec 2016 23:30:01 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 23F81ABDD; Thu, 8 Dec 2016 04:28:39 +0000 (UTC) From: NeilBrown To: "J. Bruce Fields" , Steve Dickson Date: Thu, 08 Dec 2016 15:27:26 +1100 Subject: [PATCH 09/10] gssd: add /etc/nfs.conf support Cc: linux-nfs@vger.kernel.org Message-ID: <148117124585.31271.16880270503226995999.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 | 18 +++++++++++++++++ utils/gssd/gssd.c | 29 +++++++++++++++++++++++++++ utils/gssd/gssd.man | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 101 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 9e427a61d621..938b9705414a 100644 --- a/systemd/nfs.conf.man +++ b/systemd/nfs.conf.man @@ -190,6 +190,24 @@ See for details. .TP +.B gssd +Recognized values: +.BR use-memcache , +.BR use-machine-creds , +.BR avoid-dns , +.BR limit-to-legacy-enctypes , +.BR context-timeout , +.BR rpc-timeout , +.BR pipefs-directory , +.BR keytab-file , +.BR cred-cache-directory , +.BR preferred-realm . + +See +.BR rpc.gssd (8) +for details. + +.TP .B exportfs Only .B debug= diff --git a/utils/gssd/gssd.c b/utils/gssd/gssd.c index 3b4d1476c0ad..c65e97cb8fac 100644 --- a/utils/gssd/gssd.c +++ b/utils/gssd/gssd.c @@ -71,6 +71,7 @@ #include "gss_util.h" #include "krb5_util.h" #include "nfslib.h" +#include "conffile.h" static char *pipefs_path = GSSD_PIPEFS_DIR; static DIR *pipefs_dir; @@ -78,6 +79,7 @@ static int pipefs_fd; static int inotify_fd; struct event inotify_ev; +char *conf_path = NFS_CONFFILE; char *keytabfile = GSSD_DEFAULT_KEYTAB_FILE; char **ccachesearch; int use_memcache = 0; @@ -847,6 +849,33 @@ main(int argc, char *argv[]) char *progname; char *ccachedir = NULL; struct event sighup_ev; + char *s; + + conf_init(); + use_memcache = conf_get_bool("gssd", "use-memcache", use_memcache); + root_uses_machine_creds = conf_get_bool("gssd", "use-machine-creds", + root_uses_machine_creds); + avoid_dns = conf_get_bool("gssd", "avoid-dns", avoid_dns); +#ifdef HAVE_SET_ALLOWABLE_ENCTYPES + limit_to_legacy_enctypes = conf_get_bool("gssd", "limit-to-legacy-enctypes", + limit_to_legacy_enctypes); +#endif + context_timeout = conf_get_num("gssd", "context-timeout", context_timeout); + rpc_timeout = conf_get_num("gssd", "rpc-timeout", rpc_timeout); + s = conf_get_str("gssd", "pipefs-directory"); + if (!s) + s = conf_get_str("general", "pipefs-directory"); + if (s) + pipefs_path = s; + s = conf_get_str("gssd", "keytab-file"); + if (s) + keytablfile = s; + s = conf_get_str("gssd", "cred-cache-directory"); + if (s) + ccachedir = s; + s = conf_get_str("gssd", "preferred-realm"); + if (s) + preferred_realm = s; while ((opt = getopt(argc, argv, "DfvrlmnMp:k:d:t:T:R:")) != -1) { switch (opt) { diff --git a/utils/gssd/gssd.man b/utils/gssd/gssd.man index ea58fa0965e8..87eef0249a12 100644 --- a/utils/gssd/gssd.man +++ b/utils/gssd/gssd.man @@ -297,6 +297,60 @@ The default timeout is set to 5 seconds. If you get messages like "WARNING: can't create tcp rpc_clnt to server %servername% for user with uid %uid%: RPC: Remote system error - Connection timed out", you should consider an increase of this timeout. +.SH CONFIGURATION FILE +Many of the options that can be set on the command line can also be +controlled through values set in the +.B [gssd] +section of the +.I /etc/nfs.conf +configuration file. Values recognized include: +.TP +.B use-memcache +A Boolean flag equivalent to +.BR -M . +.TP +.B use-machine-creds +A Boolean flag. Setting to +.B false +is equivalent to giving the +.B -n +flag. +.TP +.B avoid-dns +Setting to +.B false +is equivalent to providing the +.B -D +flag. +.TP +.B limit-to-legacy-enctypes +Equivalent to +.BR -l . +.TP +.B context-timeout +Equivalent to +.BR -T . +.TP +.B rpc-timeout +Equivalent to +.BR -t . +.TP +.B pipefs-directory +Equivalent to +.BR -p . +.TP +.B keytab-file +Equivalent to +.BR -k . +.TP +.BR cred-cache-directory +Equivalent to +.BR -d . +.TP +.B preferred-realm +Equivalent to +.BR -R . + .SH SEE ALSO .BR rpc.svcgssd (8), .BR kerberos (1),