mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:24:45 +01:00
NFS: Fix up the automount fs_context to use the correct cred
When automounting, the fs_context should be fixed up to use the cred from the parent filesystem, since the operation is just extending the namespace. Authorisation to enter that namespace will already have been provided by the preceding lookup. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
This commit is contained in:
parent
2b092175f5
commit
a2a8fc27dd
1 changed files with 5 additions and 0 deletions
|
|
@ -170,6 +170,11 @@ struct vfsmount *nfs_d_automount(struct path *path)
|
|||
if (!ctx->clone_data.fattr)
|
||||
goto out_fc;
|
||||
|
||||
if (fc->cred != server->cred) {
|
||||
put_cred(fc->cred);
|
||||
fc->cred = get_cred(server->cred);
|
||||
}
|
||||
|
||||
if (fc->net_ns != client->cl_net) {
|
||||
put_net(fc->net_ns);
|
||||
fc->net_ns = get_net(client->cl_net);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue