Skip to content

Commit

Permalink
NFSv4: Disallow security negotiation for lookups when 'sec=' is speci…
Browse files Browse the repository at this point in the history
…fied

Ensure that nfs4_proc_lookup_common respects the NFS_MOUNT_SECFLAVOUR
flag.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Sep 7, 2013
1 parent 5e6b199 commit 41d058c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 41d058c

Please sign in to comment.