From: Lennart Poettering Date: Tue, 9 Nov 2021 17:25:42 +0000 (+0100) Subject: nspawn: copy BindUser= setting from settings only if set X-Git-Tag: v250-rc1~321^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0cc3c9f997d0ea39f0309e74117a033635b2291f;p=thirdparty%2Fsystemd.git nspawn: copy BindUser= setting from settings only if set 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. --- diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 25075d2b46a..3209b50417b 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -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 &&