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
+13
View File
@@ -989,6 +989,19 @@ int mount_custom(
return 0;
}
bool has_custom_root_mount(const CustomMount *mounts, size_t n) {
size_t i;
for (i = 0; i < n; i++) {
const CustomMount *m = mounts + i;
if (path_equal(m->destination, "/"))
return true;
}
return false;
}
static int setup_volatile_state(const char *directory, uid_t uid_shift, const char *selinux_apifs_context) {
_cleanup_free_ char *buf = NULL;