nspawn: Don't mount read-only if we have a custom mount on root.

This commit is contained in:
Daan De Meyer
2020-01-03 14:06:38 +01:00
parent 12da859a3f
commit bbd407ea2b
3 changed files with 16 additions and 1 deletions
+2 -1
View File
@@ -3438,7 +3438,8 @@ static int outer_child(
if (r < 0)
return r;
if (arg_read_only && arg_volatile_mode == VOLATILE_NO) {
if (arg_read_only && arg_volatile_mode == VOLATILE_NO &&
!has_custom_root_mount(arg_custom_mounts, arg_n_custom_mounts)) {
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");