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
@@ -3323,7 +3323,7 @@ static int outer_child(
return r;
if (arg_read_only && arg_volatile_mode == VOLATILE_NO) {
r = bind_remount_recursive(directory, true, NULL);
r = bind_remount_recursive(directory, MS_RDONLY, MS_RDONLY, NULL);
if (r < 0)
return log_error_errno(r, "Failed to make tree read-only: %m");
}