]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
mount: use ul_optstr_is_valid()
authorKarel Zak <kzak@redhat.com>
Wed, 27 Nov 2024 13:10:36 +0000 (14:10 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 27 Nov 2024 13:10:36 +0000 (14:10 +0100)
Remove verification in mount(8) and instead use validation based on
parser.

Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/mount.c

index 4ec9b50d1e2884068f5b5a00b164f9fc60be37a7..af33b210967626b19e36bee9cde12c59a39802a5 100644 (file)
@@ -447,10 +447,10 @@ static void append_option(struct libmnt_context *cxt, const char *opt, const cha
 {
        char *o = NULL;
 
-       if (opt && (*opt == '=' || *opt == '\'' || *opt == '\"' || isblank(*opt)))
+       if (opt && !ul_optstr_is_valid(opt))
                errx(MNT_EX_USAGE, _("unsupported option format: %s"), opt);
 
-       if (arg && *arg)
+       if (opt && arg && *arg)
                xasprintf(&o, "%s=\"%s\"", opt, arg);
 
        if (mnt_context_append_options(cxt, o ? : opt))