mount-util: beef up bind_remount_recursive() to be able to toggle more than MS_RDONLY

The function is otherwise generic enough to toggle other bind mount
flags beyond MS_RDONLY (for example: MS_NOSUID or MS_NODEV), hence let's
beef it up slightly to support that too.
This commit is contained in:
Lennart Poettering
2019-03-25 19:33:55 +01:00
parent f0a95a2c6d
commit 64e82c1976
6 changed files with 21 additions and 16 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ static int make_volatile(const char *path) {
if (r < 0)
goto finish_umount;
r = bind_remount_recursive("/run/systemd/volatile-sysroot/usr", true, NULL);
r = bind_remount_recursive("/run/systemd/volatile-sysroot/usr", MS_RDONLY, MS_RDONLY, NULL);
if (r < 0) {
log_error_errno(r, "Failed to remount /usr read-only: %m");
goto finish_umount;