1
0
Fork 0

NFSv4: Disallow security negotiation for lookups when 'sec=' is specified

Ensure that nfs4_proc_lookup_common respects the NFS_MOUNT_SECFLAVOUR
flag.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
hifive-unleashed-5.1
Trond Myklebust 2013-09-07 17:49:05 -04:00
parent 5e6b19901b
commit 41d058c3ba
1 changed files with 3 additions and 1 deletions

View File

@ -3154,7 +3154,9 @@ static int nfs4_proc_lookup_common(struct rpc_clnt **clnt, struct inode *dir,
err = -EPERM;
if (client != *clnt)
goto out;
/* No security negotiation if the user specified 'sec=' */
if (NFS_SERVER(dir)->flags & NFS_MOUNT_SECFLAVOUR)
goto out;
client = nfs4_create_sec_client(client, dir, name);
if (IS_ERR(client))
return PTR_ERR(client);