]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
nspawn: Make a custom mount on root imply --read-only. 14420/head
authorDaan De Meyer <daan.de_meyer@otnsystems.com>
Tue, 24 Dec 2019 10:40:03 +0000 (11:40 +0100)
committerDaan De Meyer <daan.de_meyer@otnsystems.com>
Fri, 3 Jan 2020 13:06:38 +0000 (14:06 +0100)
src/nspawn/nspawn.c

index f0f9f6ecebabfaa376adf98c24f88b7c7d7763a2..791bdd35321a64f171603ed0f3d516ad213ef7b7 100644 (file)
@@ -1541,6 +1541,9 @@ static int verify_arguments(void) {
         if (arg_volatile_mode != VOLATILE_NO) /* Make sure all file systems contained in the image are mounted read-only if we are in volatile mode */
                 arg_read_only = true;
 
+        if (has_custom_root_mount(arg_custom_mounts, arg_n_custom_mounts))
+                arg_read_only = true;
+
         if (arg_keep_unit && arg_register && cg_pid_get_owner_uid(0, NULL) >= 0)
                 /* Save the user from accidentally registering either user-$SESSION.scope or user@.service.
                  * The latter is not technically a user session, but we don't need to labour the point. */