From e82b77e9696a6dada96a7f3ea3ec20a63e8e7b9e Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 28 May 2018 15:46:28 +0200 Subject: libmount: accept another flags on MS_REMOUNT|MS_BIND The current libmount MS_REMOUNT|MS_BIND support is restricted to MS_RDONLY (read-only bind mount). This is too restrictive as Linux kernel supports bind-remount for arbitrary VFS flags. After this update you can use # mount /dev/sdc1 /mnt/A # mount --bind -onosuid,noexec /mnt/A /mnt/B # findmnt /dev/sdc1 -oTARGET,SOURCE,FS-OPTIONS,VFS-OPTIONS TARGET SOURCE FS-OPTIONS VFS-OPTIONS /mnt/A /dev/sdc1 rw,stripe=512,data=ordered rw,relatime /mnt/B /dev/sdc1 rw,stripe=512,data=ordered rw,nosuid,noexec,relatime The "mount --bind" is composed from two syscalls of course (1st is bind, 2nd is bind,remount,nosuid,noexec). Addresses: https://github.com/karelzak/util-linux/issues/637 Signed-off-by: Karel Zak --- sys-utils/mount.8 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys-utils/mount.8') diff --git a/sys-utils/mount.8 b/sys-utils/mount.8 index e6afaa3dd..b20a5c8b7 100644 --- a/sys-utils/mount.8 +++ b/sys-utils/mount.8 @@ -417,8 +417,9 @@ will be writable, but the will be read-only. It's also possible to change nosuid, nodev, noexec, noatime, nodiratime and -relatime VFS entry flags by "remount,bind" operation. It's impossible to change -mount options recursively (for example with \fB-o rbind,ro\fR). +relatime VFS entry flags by "remount,bind" operation. The another (for example +filesystem specific flags) are silently ignored. It's impossible to change mount +options recursively (for example with \fB-o rbind,ro\fR). .BR mount (8) since v2.31 ignores the \fBbind\fR flag from -- cgit v1.2.3-55-g7522