open_quote ^= 1; /* reverse the status */
if (open_quote)
continue; /* still in quoted block */
- if (!sep && *p == '=')
+ if (!sep && p > start && *p == '=')
sep = p; /* name and value separator */
if (*p == ',')
stop = p; /* terminate the option item */
if (user)
*user = NULL;
- while(!mnt_optstr_next_option(&str, &name, &namesz, &val, &valsz)) {
+ while (!mnt_optstr_next_option(&str, &name, &namesz, &val, &valsz)) {
int rc = 0;
const struct libmnt_optmap *ent = NULL;
const struct libmnt_optmap *m =
static void append_option(struct libmnt_context *cxt, const char *opt)
{
+ if (opt && (*opt == '=' || *opt == '\'' || *opt == '\"' || isblank(*opt)))
+ errx(MOUNT_EX_USAGE, _("unsupported option format: %s"), opt);
if (mnt_context_append_options(cxt, opt))
err(MOUNT_EX_SYSERR, _("failed to append option '%s'"), opt);
}