diff options
author | Karel Zak | 2018-06-01 14:07:53 +0200 |
---|---|---|
committer | Karel Zak | 2018-06-01 14:07:53 +0200 |
commit | 6691d53797ccc2e5ac840c5b1680fceaa23122db (patch) | |
tree | dba87a0303ecaeeb78d59e4f39ec1ad7ae73a22b /sys-utils/mount.c | |
parent | libmount: don't use MS_MGC_VAL magic in mount(2) syscall (diff) | |
download | kernel-qcow2-util-linux-6691d53797ccc2e5ac840c5b1680fceaa23122db.tar.gz kernel-qcow2-util-linux-6691d53797ccc2e5ac840c5b1680fceaa23122db.tar.xz kernel-qcow2-util-linux-6691d53797ccc2e5ac840c5b1680fceaa23122db.zip |
mount: keep MS_MOVE as flag
The previous commit 4ebea84bb1ca6b0fa817588aba13de26c8d5e5a0 replaced
all operations by strings, but it does not work for MS_MOVE as this
operation is not supported in fstab by libmount.
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/mount.c')
-rw-r--r-- | sys-utils/mount.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys-utils/mount.c b/sys-utils/mount.c index 22672c40b..040a84a57 100644 --- a/sys-utils/mount.c +++ b/sys-utils/mount.c @@ -517,7 +517,7 @@ int main(int argc, char **argv) struct libmnt_table *fstab = NULL; char *srcbuf = NULL; char *types = NULL; - int oper = 0; + int oper = 0, is_move = 0; int propa = 0; int optmode = 0, optmode_mode = 0, optmode_src = 0; @@ -684,7 +684,7 @@ int main(int argc, char **argv) break; case 'M': oper = 1; - append_option(cxt, "move"); + is_move = 1; break; case 'R': oper = 1; @@ -870,6 +870,10 @@ int main(int argc, char **argv) if (mnt_context_is_restricted(cxt)) sanitize_paths(cxt); + if (is_move) + /* "move" as option string is not supported by libmount */ + mnt_context_set_mflags(cxt, MS_MOVE); + if ((oper && !has_remount_flag(cxt)) || propa) /* For --make-* or --bind is fstab/mtab unnecessary */ mnt_context_set_optsmode(cxt, MNT_OMODE_NOTAB); |