Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e68fd7c8 authored by Steve Dickson's avatar Steve Dickson Committed by Trond Myklebust
Browse files

mount: use sec= that was specified on the command line

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: default avatarSteve Dickson <steved@redhat.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent f7db0b28
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -1684,6 +1684,7 @@ 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
@@ -1691,13 +1692,20 @@ static int nfs_verify_authflavors(struct nfs_parsed_mount_data *args,
	 *
	 * 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;
	}