From ee1a3f832a55e1f7ad4dd0f779df5aa29c345c64 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 27 Nov 2024 14:10:36 +0100 Subject: [PATCH] mount: use ul_optstr_is_valid() Remove verification in mount(8) and instead use validation based on parser. Signed-off-by: Karel Zak --- sys-utils/mount.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys-utils/mount.c b/sys-utils/mount.c index 4ec9b50d1..af33b2109 100644 --- a/sys-utils/mount.c +++ b/sys-utils/mount.c @@ -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)) -- 2.47.3