From patchwork Fri Jul 28 20:50:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Adamson X-Patchwork-Id: 9869443 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 277AF6038F for ; Fri, 28 Jul 2017 20:50:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0FB3E288E2 for ; Fri, 28 Jul 2017 20:50:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04BDD28907; Fri, 28 Jul 2017 20:50:32 +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 7F3E228905 for ; Fri, 28 Jul 2017 20:50:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752957AbdG1Uu3 (ORCPT ); Fri, 28 Jul 2017 16:50:29 -0400 Received: from mx143.netapp.com ([216.240.21.24]:53523 "EHLO mx143.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752949AbdG1Uu1 (ORCPT ); Fri, 28 Jul 2017 16:50:27 -0400 X-IronPort-AV: E=Sophos;i="5.40,427,1496127600"; d="scan'208";a="208503179" Received: from vmwexchts01-prd.hq.netapp.com ([10.122.105.12]) by mx143-out.netapp.com with ESMTP; 28 Jul 2017 13:28:25 -0700 Received: from smtp2.corp.netapp.com (10.57.159.114) by VMWEXCHTS01-PRD.hq.netapp.com (10.122.105.12) with Microsoft SMTP Server id 15.0.1210.3; Fri, 28 Jul 2017 13:50:26 -0700 Received: from localhost.localdomain.localdomain (dros-16.vpn.netapp.com [10.55.79.21]) by smtp2.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id v6SKoOuY019054; Fri, 28 Jul 2017 13:50:26 -0700 (PDT) From: To: CC: , , , Andy Adamson Subject: [PATCH Version 4 2/2] GSSD add option to not put gss version in downcall Date: Fri, 28 Jul 2017 16:50:22 -0400 Message-ID: <1501275022-24313-3-git-send-email-andros@netapp.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1501275022-24313-1-git-send-email-andros@netapp.com> References: <1501275022-24313-1-git-send-email-andros@netapp.com> 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 From: Andy Adamson This results in using GSSv1, and not trying GSSv3 Signed-off-by: Andy Adamson --- utils/gssd/gssd.c | 9 +++++++-- utils/gssd/gssd.h | 1 + utils/gssd/gssd_proc.c | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/utils/gssd/gssd.c b/utils/gssd/gssd.c index 4d18d35..58cd0b2 100644 --- a/utils/gssd/gssd.c +++ b/utils/gssd/gssd.c @@ -89,6 +89,8 @@ unsigned int rpc_timeout = 5; char *preferred_realm = NULL; /* Avoid DNS reverse lookups on server names */ static bool avoid_dns = true; +/* Add gss version to downcall for GSSv3 */ +bool use_gss_vers = true; int thread_started = false; pthread_mutex_t pmutex = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t pcond = PTHREAD_COND_INITIALIZER; @@ -832,7 +834,7 @@ sig_die(int signal) static void usage(char *progname) { - fprintf(stderr, "usage: %s [-f] [-l] [-M] [-n] [-v] [-r] [-p pipefsdir] [-k keytab] [-d ccachedir] [-t timeout] [-R preferred realm] [-D]\n", + fprintf(stderr, "usage: %s [-f] [-l] [-M] [-n] [-v] [-r] [-p pipefsdir] [-k keytab] [-d ccachedir] [-t timeout] [-R preferred realm] [-D] [-G]\n", progname); exit(1); } @@ -877,7 +879,7 @@ main(int argc, char *argv[]) if (s) preferred_realm = s; - while ((opt = getopt(argc, argv, "DfvrlmnMp:k:d:t:T:R:")) != -1) { + while ((opt = getopt(argc, argv, "DGfvrlmnMp:k:d:t:T:R:")) != -1) { switch (opt) { case 'f': fg = 1; @@ -925,6 +927,9 @@ main(int argc, char *argv[]) case 'D': avoid_dns = false; break; + case 'G': + use_gss_vers = false; + break; default: usage(argv[0]); break; diff --git a/utils/gssd/gssd.h b/utils/gssd/gssd.h index f4f5975..e2604c0 100644 --- a/utils/gssd/gssd.h +++ b/utils/gssd/gssd.h @@ -66,6 +66,7 @@ extern pthread_mutex_t ple_lock; extern pthread_cond_t pcond; extern pthread_mutex_t pmutex; extern int thread_started; +extern bool use_gss_vers; struct clnt_info { TAILQ_ENTRY(clnt_info) list; diff --git a/utils/gssd/gssd_proc.c b/utils/gssd/gssd_proc.c index 689d916..f2cee58 100644 --- a/utils/gssd/gssd_proc.c +++ b/utils/gssd/gssd_proc.c @@ -149,7 +149,6 @@ do_downcall(int k5_fd, uid_t uid, struct authgss_private_data *pd, char *buf = NULL, *p = NULL, *end = NULL; unsigned int timeout = context_timeout; unsigned int buf_size = 0; - bool use_gss_vers = true; retry: printerr(2, "doing downcall: lifetime_rec=%u acceptor=%.*s" @@ -330,6 +329,7 @@ create_auth_rpc_client(struct clnt_info *clp, sec.svc = RPCSEC_GSS_SVC_NONE; sec.cred = cred; sec.req_flags = 0; + sec.gss_vers = use_gss_vers ? RPCSEC_GSS3_VERSION : RPCSEC_GSS_VERSION; if (authtype == AUTHTYPE_KRB5) { sec.mech = (gss_OID)&krb5oid; sec.req_flags = GSS_C_MUTUAL_FLAG;