/* Ignore VFS flags, userspace and external options */
continue;
+ if (!value && mnt_opt_is_sepnodata(opt))
+ value = ""; /* force use the value as string */
+
rc = fsconfig_set_value(cxt, hs, fd, name, value);
if (rc != 0)
goto done;
extern int mnt_opt_set_u64value(struct libmnt_opt *opt, uint64_t num);
extern int mnt_opt_set_quoted_value(struct libmnt_opt *opt, const char *str);
extern int mnt_opt_is_external(struct libmnt_opt *opt);
+extern int mnt_opt_is_sepnodata(struct libmnt_opt *opt);
/* fs.c */
extern int mnt_fs_follow_optlist(struct libmnt_fs *fs, struct libmnt_optlist *ol);
unsigned int external : 1, /* visible for external helpers only */
recursive : 1, /* recursive flag */
+ sepnodata : 1, /* value separator, but without data ("name=") */
is_linux : 1, /* defined in ls->linux_map (VFS attr) */
quoted : 1; /* name="value" */
};
opt->value = strndup(value, valsz);
if (!opt->value)
goto fail;
+
+ } else if (value) {
+ /* separator specified, but empty value ("name=") */
+ opt->sepnodata = 1;
}
if (namesz) {
opt->name = strndup(name, namesz);
continue;
rc = mnt_buffer_append_option(&buf,
opt->name, strlen(opt->name),
- opt->value,
+ opt->value ? opt->value :
+ opt->sepnodata ? "" : NULL,
opt->value ? strlen(opt->value) : 0,
opt->quoted);
if (rc)
no->src = opt->src;
no->external = opt->external;
no->quoted = opt->quoted;
+ no->sepnodata = opt->sepnodata;
}
}
return opt && opt->external ? 1 : 0;
}
+int mnt_opt_is_sepnodata(struct libmnt_opt *opt)
+{
+ return opt->sepnodata;
+}
+
#ifdef TEST_PROGRAM