assert(cxt->fs);
assert((cxt->flags & MNT_FL_MOUNTFLAGS_MERGED));
- DBG(CXT, ul_debugobj(cxt, "preparing source path"));
+ DBG(CXT, ul_debugobj(cxt, "--> preparing source path"));
src = mnt_fs_get_source(cxt->fs);
"X-mount.subdir", &dir, &sz) != 0)
return 0;
- cxt->subdir = strndup(dir, sz);
- if (!cxt->subdir)
- *rc = -ENOMEM;
+ if (dir && *dir == '"')
+ dir++, sz-=2;
+
+ if (!dir || sz < 1) {
+ DBG(CXT, ul_debug("failed to parse X-mount.subdir '%s'", dir));
+ *rc = -MNT_ERR_MOUNTOPT;
+ } else {
+ cxt->subdir = strndup(dir, sz);
+ if (!cxt->subdir)
+ *rc = -ENOMEM;
+
+ DBG(CXT, ul_debug("subdir %s wanted", dir));
+ }
return *rc == 0;
}
if (mstr && mstr_sz) {
char *end = NULL;
+ if (*mstr == '"')
+ mstr++, mstr_sz-=2;
+
errno = 0;
*mode = strtol(mstr, &end, 8);
assert(cxt->fs);
assert((cxt->flags & MNT_FL_MOUNTFLAGS_MERGED));
- DBG(CXT, ul_debugobj(cxt, "preparing target path"));
+ DBG(CXT, ul_debugobj(cxt, "--> preparing target path"));
tgt = mnt_fs_get_target(cxt->fs);
if (!tgt)
assert(cxt->fs);
assert((cxt->flags & MNT_FL_MOUNTFLAGS_MERGED));
- DBG(CXT, ul_debugobj(cxt, "preparing fstype"));
+ DBG(CXT, ul_debugobj(cxt, "--> preparing fstype"));
if ((cxt->mountflags & (MS_BIND | MS_MOVE))
|| mnt_context_propagation_only(cxt))
assert(cxt->action);
assert((cxt->flags & MNT_FL_MOUNTFLAGS_MERGED));
- DBG(CXT, ul_debugobj(cxt, "prepare update"));
+ DBG(CXT, ul_debugobj(cxt, "--> prepare update"));
if (mnt_context_propagation_only(cxt)) {
DBG(CXT, ul_debugobj(cxt, "skip update: only MS_PROPAGATION"));