]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libmount: accept another flags on MS_REMOUNT|MS_BIND
authorKarel Zak <kzak@redhat.com>
Mon, 28 May 2018 13:46:28 +0000 (15:46 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 28 May 2018 14:15:30 +0000 (16:15 +0200)
commite82b77e9696a6dada96a7f3ea3ec20a63e8e7b9e
tree26ca04f758a4b66aca2dac4602394966bf87dd3b
parent8d69fd437ac2c4c0e193c52bbb65f515d2f6f363
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 <kzak@redhat.com>
libmount/src/context_mount.c
libmount/src/mountP.h
sys-utils/mount.8