mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 22:21:21 +00:00
nfs4: copy acceptor name from context to nfs_client
The current CB_COMPOUND handling code tries to compare the principal name of the request with the cl_hostname in the client. This is not guaranteed to ever work, particularly if the client happened to mount a CNAME of the server or a non-fqdn. Fix this by instead comparing the cr_principal string with the acceptor name that we get from gssd. In the event that gssd didn't send one down (i.e. it was too old), then we fall back to trying to use the cl_hostname as we do today. Signed-off-by: Jeff Layton <jlayton@poochiereds.net> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
parent
a0337d1ddb
commit
f11b2a1cfb
5 changed files with 47 additions and 1 deletions
|
@ -428,6 +428,18 @@ check_gss_callback_principal(struct nfs_client *clp, struct svc_rqst *rqstp)
|
|||
if (p == NULL)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* Did we get the acceptor from userland during the SETCLIENID
|
||||
* negotiation?
|
||||
*/
|
||||
if (clp->cl_acceptor)
|
||||
return !strcmp(p, clp->cl_acceptor);
|
||||
|
||||
/*
|
||||
* Otherwise try to verify it using the cl_hostname. Note that this
|
||||
* doesn't work if a non-canonical hostname was used in the devname.
|
||||
*/
|
||||
|
||||
/* Expect a GSS_C_NT_HOSTBASED_NAME like "nfs@serverhostname" */
|
||||
|
||||
if (memcmp(p, "nfs@", 4) != 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue