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

Commit 79caa5fa authored by Trond Myklebust's avatar Trond Myklebust Committed by Anna Schumaker
Browse files

SUNRPC: Cache cred of process creating the rpc_client



When converting kuids to AUTH_UNIX creds, etc we will want to use the
same user namespace as the process that created the rpc client.

Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 2cfd11f1
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -458,6 +458,7 @@ nlm_bind_host(struct nlm_host *host)
			.authflavor	= RPC_AUTH_UNIX,
			.authflavor	= RPC_AUTH_UNIX,
			.flags		= (RPC_CLNT_CREATE_NOPING |
			.flags		= (RPC_CLNT_CREATE_NOPING |
					   RPC_CLNT_CREATE_AUTOBIND),
					   RPC_CLNT_CREATE_AUTOBIND),
			.cred		= current_cred(),
		};
		};


		/*
		/*
+1 −0
Original line number Original line Diff line number Diff line
@@ -82,6 +82,7 @@ static struct rpc_clnt *nsm_create(struct net *net, const char *nodename)
		.version		= NSM_VERSION,
		.version		= NSM_VERSION,
		.authflavor		= RPC_AUTH_NULL,
		.authflavor		= RPC_AUTH_NULL,
		.flags			= RPC_CLNT_CREATE_NOPING,
		.flags			= RPC_CLNT_CREATE_NOPING,
		.cred			= current_cred(),
	};
	};


	return rpc_create(&args);
	return rpc_create(&args);
+1 −0
Original line number Original line Diff line number Diff line
@@ -500,6 +500,7 @@ int nfs_create_rpc_client(struct nfs_client *clp,
		.program	= &nfs_program,
		.program	= &nfs_program,
		.version	= clp->rpc_ops->version,
		.version	= clp->rpc_ops->version,
		.authflavor	= flavor,
		.authflavor	= flavor,
		.cred		= current_cred(),
	};
	};


	if (test_bit(NFS_CS_DISCRTRY, &clp->cl_flags))
	if (test_bit(NFS_CS_DISCRTRY, &clp->cl_flags))
+2 −0
Original line number Original line Diff line number Diff line
@@ -163,6 +163,7 @@ int nfs_mount(struct nfs_mount_request *info)
		.program	= &mnt_program,
		.program	= &mnt_program,
		.version	= info->version,
		.version	= info->version,
		.authflavor	= RPC_AUTH_UNIX,
		.authflavor	= RPC_AUTH_UNIX,
		.cred		= current_cred(),
	};
	};
	struct rpc_clnt		*mnt_clnt;
	struct rpc_clnt		*mnt_clnt;
	int			status;
	int			status;
@@ -249,6 +250,7 @@ void nfs_umount(const struct nfs_mount_request *info)
		.version	= info->version,
		.version	= info->version,
		.authflavor	= RPC_AUTH_UNIX,
		.authflavor	= RPC_AUTH_UNIX,
		.flags		= RPC_CLNT_CREATE_NOPING,
		.flags		= RPC_CLNT_CREATE_NOPING,
		.cred		= current_cred(),
	};
	};
	struct rpc_message msg	= {
	struct rpc_message msg	= {
		.rpc_argp	= info->dirpath,
		.rpc_argp	= info->dirpath,
+1 −0
Original line number Original line Diff line number Diff line
@@ -868,6 +868,7 @@ static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *c
		.program	= &cb_program,
		.program	= &cb_program,
		.version	= 1,
		.version	= 1,
		.flags		= (RPC_CLNT_CREATE_NOPING | RPC_CLNT_CREATE_QUIET),
		.flags		= (RPC_CLNT_CREATE_NOPING | RPC_CLNT_CREATE_QUIET),
		.cred		= current_cred(),
	};
	};
	struct rpc_clnt *client;
	struct rpc_clnt *client;
	const struct cred *cred;
	const struct cred *cred;
Loading