linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sunrpc: Add comment defining gssd upcall API keywords
@ 2018-08-20 14:39 Chuck Lever
  2018-08-20 15:55 ` Steve Dickson
  2018-08-20 19:05 ` J. Bruce Fields
  0 siblings, 2 replies; 3+ messages in thread
From: Chuck Lever @ 2018-08-20 14:39 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs, simo

During review, it was found that the target, service, and srchost
keywords are easily conflated. Add an explainer.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 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.
+	 */
 	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.
+	 */
 	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);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] sunrpc: Add comment defining gssd upcall API keywords
  2018-08-20 14:39 [PATCH] sunrpc: Add comment defining gssd upcall API keywords Chuck Lever
@ 2018-08-20 15:55 ` Steve Dickson
  2018-08-20 19:05 ` J. Bruce Fields
  1 sibling, 0 replies; 3+ messages in thread
From: Steve Dickson @ 2018-08-20 15:55 UTC (permalink / raw)
  To: Chuck Lever, bfields; +Cc: linux-nfs, simo

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 <chuck.lever@oracle.com>
> ---
>  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);
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] sunrpc: Add comment defining gssd upcall API keywords
  2018-08-20 14:39 [PATCH] sunrpc: Add comment defining gssd upcall API keywords Chuck Lever
  2018-08-20 15:55 ` Steve Dickson
@ 2018-08-20 19:05 ` J. Bruce Fields
  1 sibling, 0 replies; 3+ messages in thread
From: J. Bruce Fields @ 2018-08-20 19:05 UTC (permalink / raw)
  To: Chuck Lever; +Cc: linux-nfs, simo

On Mon, Aug 20, 2018 at 10:39:16AM -0400, 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 <chuck.lever@oracle.com>
> ---
>  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?

Will do, it'll probably just be another week or so before I publish a
4.19 branch.

--b.

> 
> 
> 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.
> +	 */
>  	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.
> +	 */
>  	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);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-08-20 22:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-20 14:39 [PATCH] sunrpc: Add comment defining gssd upcall API keywords Chuck Lever
2018-08-20 15:55 ` Steve Dickson
2018-08-20 19:05 ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).