Skip to content

Commit

Permalink
mount: use sec= that was specified on the command line
Browse files Browse the repository at this point in the history
When older servers return RPC_AUTH_NULL, it means the
rpc creds will be ignored. In that case use the sec=
that was specified instead of setting sec=null

Fixes Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1112983
Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
  • Loading branch information
Steve Dickson authored and Trond Myklebust committed Jul 19, 2016
1 parent f7db0b2 commit e68fd7c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions fs/nfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1684,21 +1684,29 @@ static int nfs_verify_authflavors(struct nfs_parsed_mount_data *args,
{
rpc_authflavor_t flavor = RPC_AUTH_MAXFLAVOR;
unsigned int i;
int use_auth_null = false;

/*
* If the sec= mount option is used, the specified flavor or AUTH_NULL
* must be in the list returned by the server.
*
* AUTH_NULL has a special meaning when it's in the server list - it
* means that the server will ignore the rpc creds, so any flavor
* can be used.
* can be used but still use the sec= that was specified.
*/
for (i = 0; i < count; i++) {
flavor = server_authlist[i];

if (nfs_auth_info_match(&args->auth_info, flavor) ||
flavor == RPC_AUTH_NULL)
if (nfs_auth_info_match(&args->auth_info, flavor))
goto out;

if (flavor == RPC_AUTH_NULL)
use_auth_null = true;
}

if (use_auth_null) {
flavor = RPC_AUTH_NULL;
goto out;
}

dfprintk(MOUNT,
Expand Down

0 comments on commit e68fd7c

Please sign in to comment.