diff options
author | Eric Sandeen <sandeen@redhat.com> | 2024-07-03 01:23:24 +0300 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2024-07-03 17:55:11 +0300 |
commit | eea6a8322efd3982e59c41a5b61948a0b043ca58 (patch) | |
tree | 8c683689c3a910187786b81354c95f194a98673d /fs | |
parent | 525bd65aa759ec320af1dc06e114ed69733e9e23 (diff) | |
download | linux-eea6a8322efd3982e59c41a5b61948a0b043ca58.tar.xz |
fuse: Convert to new uid/gid option parsing helpers
Convert to new uid/gid option parsing helpers
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Link: https://lore.kernel.org/r/4e1a4efa-4ca5-4358-acee-40efd07c3c44@redhat.com
Reviewed-by: Christian Brauner <brauner@kernel.org>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/fuse/inode.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 32fe6fa72f46..d8ab4e93916f 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -740,8 +740,8 @@ static const struct fs_parameter_spec fuse_fs_parameters[] = { fsparam_string ("source", OPT_SOURCE), fsparam_u32 ("fd", OPT_FD), fsparam_u32oct ("rootmode", OPT_ROOTMODE), - fsparam_u32 ("user_id", OPT_USER_ID), - fsparam_u32 ("group_id", OPT_GROUP_ID), + fsparam_uid ("user_id", OPT_USER_ID), + fsparam_gid ("group_id", OPT_GROUP_ID), fsparam_flag ("default_permissions", OPT_DEFAULT_PERMISSIONS), fsparam_flag ("allow_other", OPT_ALLOW_OTHER), fsparam_u32 ("max_read", OPT_MAX_READ), @@ -801,9 +801,7 @@ static int fuse_parse_param(struct fs_context *fsc, struct fs_parameter *param) break; case OPT_USER_ID: - kuid = make_kuid(fsc->user_ns, result.uint_32); - if (!uid_valid(kuid)) - return invalfc(fsc, "Invalid user_id"); + kuid = result.uid; /* * The requested uid must be representable in the * filesystem's idmapping. @@ -815,9 +813,7 @@ static int fuse_parse_param(struct fs_context *fsc, struct fs_parameter *param) break; case OPT_GROUP_ID: - kgid = make_kgid(fsc->user_ns, result.uint_32);; - if (!gid_valid(kgid)) - return invalfc(fsc, "Invalid group_id"); + kgid = result.gid; /* * The requested gid must be representable in the * filesystem's idmapping. |