diff options
Diffstat (limited to 'libmount/src')
-rw-r--r-- | libmount/src/context.c | 11 | ||||
-rw-r--r-- | libmount/src/libmount.h.in | 2 | ||||
-rw-r--r-- | libmount/src/optmap.c | 11 |
3 files changed, 11 insertions, 13 deletions
diff --git a/libmount/src/context.c b/libmount/src/context.c index 87ccccfc6..44282c07b 100644 --- a/libmount/src/context.c +++ b/libmount/src/context.c @@ -1531,7 +1531,7 @@ int mnt_context_prepare_srcpath(struct libmnt_context *cxt) return 0; } -/* create a mountpoint if x-mount.mkdir[=<mode>] specified */ +/* create a mountpoint if X-mount.mkdir[=<mode>] specified */ static int mkdir_target(const char *tgt, struct libmnt_fs *fs) { char *mstr = NULL; @@ -1543,8 +1543,12 @@ static int mkdir_target(const char *tgt, struct libmnt_fs *fs) assert(tgt); assert(fs); - if (mnt_optstr_get_option(fs->user_optstr, "x-mount.mkdir", &mstr, &mstr_sz) != 0) + if (mnt_optstr_get_option(fs->user_optstr, "X-mount.mkdir", &mstr, &mstr_sz) != 0 && + mnt_optstr_get_option(fs->user_optstr, "x-mount.mkdir", &mstr, &mstr_sz) != 0) /* obsolete */ return 0; + + DBG(CXT, ul_debug("mkdir %s (%s) wanted", tgt, mstr)); + if (mnt_stat_mountpoint(tgt, &st) == 0) return 0; @@ -1591,7 +1595,8 @@ int mnt_context_prepare_target(struct libmnt_context *cxt) /* mkdir target */ if (cxt->action == MNT_ACT_MOUNT && !mnt_context_is_restricted(cxt) - && cxt->user_mountflags & MNT_MS_XCOMMENT) { + && (cxt->user_mountflags & MNT_MS_XCOMMENT || + cxt->user_mountflags & MNT_MS_XFSTABCOMM)) { rc = mkdir_target(tgt, cxt->fs); if (rc) diff --git a/libmount/src/libmount.h.in b/libmount/src/libmount.h.in index cbd4f000e..f191a52fe 100644 --- a/libmount/src/libmount.h.in +++ b/libmount/src/libmount.h.in @@ -774,7 +774,7 @@ extern int mnt_context_set_syscall_status(struct libmnt_context *cxt, int status #define MNT_MS_OFFSET (1 << 14) #define MNT_MS_SIZELIMIT (1 << 15) #define MNT_MS_ENCRYPTION (1 << 16) -#define MNT_MS_XPERSIST (1 << 17) +#define MNT_MS_XFSTABCOMM (1 << 17) /* * mount(2) MS_* masks (MNT_MAP_LINUX map) diff --git a/libmount/src/optmap.c b/libmount/src/optmap.c index 114eb994e..0aa285f93 100644 --- a/libmount/src/optmap.c +++ b/libmount/src/optmap.c @@ -160,15 +160,8 @@ static const struct libmnt_optmap userspace_opts_map[] = { "comment=", MNT_MS_COMMENT, MNT_NOHLPS | MNT_NOMTAB },/* fstab comment only */ - /* - * systemd assumes that x-systemd options namespace is available for umount, - * let's use the options as X-* - */ -#ifdef HAVE_SYSTEMD - { "x-systemd", MNT_MS_XPERSIST, MNT_NOHLPS | MNT_PREFIX }, /* like X-* */ -#endif - { "X-", MNT_MS_XPERSIST, MNT_NOHLPS | MNT_PREFIX }, /* X- persistent comments (utab) */ - { "x-", MNT_MS_XCOMMENT, MNT_NOHLPS | MNT_NOMTAB | MNT_PREFIX }, /* x- fstab only comments */ + { "x-", MNT_MS_XCOMMENT, MNT_NOHLPS | MNT_PREFIX }, /* persistent comments (utab) */ + { "X-", MNT_MS_XFSTABCOMM, MNT_NOHLPS | MNT_NOMTAB | MNT_PREFIX }, /* fstab only comments */ { "loop[=]", MNT_MS_LOOP, MNT_NOHLPS }, /* use the loop device */ { "offset=", MNT_MS_OFFSET, MNT_NOHLPS | MNT_NOMTAB }, /* loop device offset */ |