Commit dcffad38 authored by Eric Sandeen's avatar Eric Sandeen Committed by Christian Brauner

efivarfs: Convert to new uid/gid option parsing helpers

Convert to new uid/gid option parsing helpers
Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
Link: https://lore.kernel.org/r/ff7c415c-43d4-4a1e-a987-246c781f8850@redhat.comSigned-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 49abee59
......@@ -275,8 +275,8 @@ enum {
};
static const struct fs_parameter_spec efivarfs_parameters[] = {
fsparam_u32("uid", Opt_uid),
fsparam_u32("gid", Opt_gid),
fsparam_uid("uid", Opt_uid),
fsparam_gid("gid", Opt_gid),
{},
};
......@@ -293,14 +293,10 @@ static int efivarfs_parse_param(struct fs_context *fc, struct fs_parameter *para
switch (opt) {
case Opt_uid:
opts->uid = make_kuid(current_user_ns(), result.uint_32);
if (!uid_valid(opts->uid))
return -EINVAL;
opts->uid = result.uid;
break;
case Opt_gid:
opts->gid = make_kgid(current_user_ns(), result.uint_32);
if (!gid_valid(opts->gid))
return -EINVAL;
opts->gid = result.gid;
break;
default:
return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment