diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-05-02 17:32:50 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-05-02 17:32:50 +0300 |
commit | a2c9c3581a75382ba468ba865c9d31c60cc884b3 (patch) | |
tree | 058ddabba23d052f9d4fad4256de7e113767c3b7 /fs/smb/client/fs_context.c | |
parent | ba5daf9b30e7a60335ba59f85a0d611008aea025 (diff) | |
parent | 5697d159afef8c475f13a0b7b85f09bd4578106c (diff) | |
download | linux-a2c9c3581a75382ba468ba865c9d31c60cc884b3.tar.xz |
Merge v6.6.30
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/smb/client/fs_context.c')
-rw-r--r-- | fs/smb/client/fs_context.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c index 58567ae617b9..103421791bb5 100644 --- a/fs/smb/client/fs_context.c +++ b/fs/smb/client/fs_context.c @@ -714,6 +714,16 @@ static int smb3_fs_context_validate(struct fs_context *fc) /* set the port that we got earlier */ cifs_set_port((struct sockaddr *)&ctx->dstaddr, ctx->port); + if (ctx->uid_specified && !ctx->forceuid_specified) { + ctx->override_uid = 1; + pr_notice("enabling forceuid mount option implicitly because uid= option is specified\n"); + } + + if (ctx->gid_specified && !ctx->forcegid_specified) { + ctx->override_gid = 1; + pr_notice("enabling forcegid mount option implicitly because gid= option is specified\n"); + } + if (ctx->override_uid && !ctx->uid_specified) { ctx->override_uid = 0; pr_notice("ignoring forceuid mount option specified with no uid= option\n"); @@ -983,12 +993,14 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, ctx->override_uid = 0; else ctx->override_uid = 1; + ctx->forceuid_specified = true; break; case Opt_forcegid: if (result.negated) ctx->override_gid = 0; else ctx->override_gid = 1; + ctx->forcegid_specified = true; break; case Opt_perm: if (result.negated) |