Return-Path: Received: from mx1.redhat.com ([209.132.183.28]:41614 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726033AbeHTTLs (ORCPT ); Mon, 20 Aug 2018 15:11:48 -0400 Subject: Re: [PATCH] sunrpc: Add comment defining gssd upcall API keywords To: Chuck Lever , bfields@fieldses.org Cc: linux-nfs@vger.kernel.org, simo@redhat.com References: <20180820143801.10060.61177.stgit@klimt.1015granger.net> From: Steve Dickson Message-ID: <4c37c307-c0c9-f833-45b4-01d6c5d4d1a5@RedHat.com> Date: Mon, 20 Aug 2018 11:55:30 -0400 MIME-Version: 1.0 In-Reply-To: <20180820143801.10060.61177.stgit@klimt.1015granger.net> Content-Type: text/plain; charset=utf-8 Sender: linux-nfs-owner@vger.kernel.org List-ID: Hello, I found your examples in the "Enable the kernel to specify the hostname..." thread to be very useful. See below. On 08/20/2018 10:39 AM, Chuck Lever wrote: > During review, it was found that the target, service, and srchost > keywords are easily conflated. Add an explainer. > > Signed-off-by: Chuck Lever > --- > net/sunrpc/auth_gss/auth_gss.c | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > Hi Bruce- > > I've received no objections to this patch. Can you include it in > v4.19 with the other patches I've already submitted? > > > diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c > index 1943e11..2460759 100644 > --- a/net/sunrpc/auth_gss/auth_gss.c > +++ b/net/sunrpc/auth_gss/auth_gss.c > @@ -461,12 +461,28 @@ static int gss_encode_v1_msg(struct gss_upcall_msg *gss_msg, > buflen -= len; > p += len; > gss_msg->msg.len = len; > + > + /* > + * target= is a full service principal that names the remote > + * identity that we are authenticating to. * In full, the target is: * host/manet.example.net@EXAMPLE.NET > + */ > if (target_name) { > len = scnprintf(p, buflen, "target=%s ", target_name); > buflen -= len; > p += len; > gss_msg->msg.len += len; > } > + > + /* > + * gssd uses service= and srchost= to select a matching key from > + * the system's keytab to use as the source principal. > + * > + * service= is the service name part of the source principal, > + * or "*" (meaning choose any). > + * > + * srchost= is the hostname part of the source principal. When > + * not provided, gssd uses the local hostname. * Thus the full source principal has to be: * nfs/klimt.ib.example.net@EXAMPLE.NET > + */ Just a suggestion... steved. > if (service_name) { > char *c = strchr(service_name, '@'); > > @@ -482,6 +498,7 @@ static int gss_encode_v1_msg(struct gss_upcall_msg *gss_msg, > p += len; > gss_msg->msg.len += len; > } > + > if (mech->gm_upcall_enctypes) { > len = scnprintf(p, buflen, "enctypes=%s ", > mech->gm_upcall_enctypes); >