]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
isofs: Convert to new uid/gid option parsing helpers
authorEric Sandeen <sandeen@redhat.com>
Fri, 28 Jun 2024 00:36:14 +0000 (19:36 -0500)
committerChristian Brauner <brauner@kernel.org>
Tue, 2 Jul 2024 04:21:19 +0000 (06:21 +0200)
Convert to new uid/gid option parsing helpers

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Link: https://lore.kernel.org/r/3e57caa1-33e0-4456-8e07-60922439e479@redhat.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/isofs/inode.c

index 93b1077a380a8544dbb5809ec236fc2559a62c1e..ed548efdd9bbc8f8cf3131ea70bb79f22abb192e 100644 (file)
@@ -326,8 +326,8 @@ static const struct fs_parameter_spec isofs_param_spec[] = {
        fsparam_u32     ("session",             Opt_session),
        fsparam_u32     ("sbsector",            Opt_sb),
        fsparam_enum    ("check",               Opt_check, isofs_param_check),
-       fsparam_u32     ("uid",                 Opt_uid),
-       fsparam_u32     ("gid",                 Opt_gid),
+       fsparam_uid     ("uid",                 Opt_uid),
+       fsparam_gid     ("gid",                 Opt_gid),
        /* Note: mode/dmode historically accepted %u not strictly %o */
        fsparam_u32     ("mode",                Opt_mode),
        fsparam_u32     ("dmode",               Opt_dmode),
@@ -344,8 +344,6 @@ static int isofs_parse_param(struct fs_context *fc,
        struct isofs_options *popt = fc->fs_private;
        struct fs_parse_result result;
        int opt;
-       kuid_t uid;
-       kgid_t gid;
        unsigned int n;
 
        /* There are no remountable options */
@@ -409,17 +407,11 @@ static int isofs_parse_param(struct fs_context *fc,
        case Opt_ignore:
                break;
        case Opt_uid:
-               uid = make_kuid(current_user_ns(), result.uint_32);
-               if (!uid_valid(uid))
-                       return -EINVAL;
-               popt->uid = uid;
+               popt->uid = result.uid;
                popt->uid_set = 1;
                break;
        case Opt_gid:
-               gid = make_kgid(current_user_ns(), result.uint_32);
-               if (!gid_valid(gid))
-                       return -EINVAL;
-               popt->gid = gid;
+               popt->gid = result.gid;
                popt->gid_set = 1;
                break;
        case Opt_mode: