]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
nspawn: copy BindUser= setting from settings only if set
authorLennart Poettering <lennart@poettering.net>
Tue, 9 Nov 2021 17:25:42 +0000 (18:25 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 9 Nov 2021 17:32:20 +0000 (18:32 +0100)
Let's only pick this up from the settings if actually set.

As in the previous commit this makes sure that an empty settings file in
--settings=override mode is really a NOP.

src/nspawn/nspawn.c

index 25075d2b46aa138b372ba37af13d49fca453a916..3209b50417b1e286904e116b77840181bcb48c74 100644 (file)
@@ -4452,7 +4452,8 @@ static int merge_settings(Settings *settings, const char *path) {
                 }
         }
 
-        if ((arg_settings_mask & SETTING_BIND_USER) == 0)
+        if ((arg_settings_mask & SETTING_BIND_USER) == 0 &&
+            !strv_isempty(settings->bind_user))
                 strv_free_and_replace(arg_bind_user, settings->bind_user);
 
         if ((arg_settings_mask & SETTING_NOTIFY_READY) == 0 &&