From: Lennart Poettering Date: Wed, 27 Nov 2024 09:20:21 +0000 (+0100) Subject: nspawn: make sure --private-users-ownership=no and =off work the same way X-Git-Tag: v257-rc3~6 X-Git-Url: http://git-history.diyao.me/?a=commitdiff_plain;h=62f3e2f84aa3413081fc1c1e1c3074fc9aeedbc9;p=systemd%2F.git nspawn: make sure --private-users-ownership=no and =off work the same way We usually want to use "extended booleans" for cases like this, i.e. that "off", "no" and "0" can be used interchangably for turning something off. --- diff --git a/src/nspawn/nspawn-settings.c b/src/nspawn/nspawn-settings.c index 587da92cb2..7842d93c34 100644 --- a/src/nspawn/nspawn-settings.c +++ b/src/nspawn/nspawn-settings.c @@ -936,7 +936,8 @@ static const char *const user_namespace_ownership_table[_USER_NAMESPACE_OWNERSHI [USER_NAMESPACE_OWNERSHIP_AUTO] = "auto", }; -DEFINE_STRING_TABLE_LOOKUP(user_namespace_ownership, UserNamespaceOwnership); +/* Note: while "yes" maps to "auto" here, we don't really document that, in order to make things clearer and less confusing to users. */ +DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(user_namespace_ownership, UserNamespaceOwnership, USER_NAMESPACE_OWNERSHIP_AUTO); int config_parse_userns_chown( const char *unit,