From 6b89f27cc4bc02ebcd21cb0e31fdd285f71cbd91 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 27 Nov 2024 10:20:21 +0100 Subject: [PATCH] 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. (cherry picked from commit 62f3e2f84aa3413081fc1c1e1c3074fc9aeedbc9) (cherry picked from commit 7a307c5939b0787727b144197090a0ae34cbd813) (cherry picked from commit 4b384a35349624547b07ab4a33d8100306e79b01) (cherry picked from commit 39f5e423a2251a19c8f37df053d911c6d4f0c973) (cherry picked from commit 460b17eb91e09d342af3525dae0195dce32b7a79) --- src/nspawn/nspawn-settings.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nspawn/nspawn-settings.c b/src/nspawn/nspawn-settings.c index 08f22be1d8..5a2adac903 100644 --- a/src/nspawn/nspawn-settings.c +++ b/src/nspawn/nspawn-settings.c @@ -878,7 +878,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,