diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index 2eb3ed4cf4..60e7c2f50d 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -3593,10 +3593,13 @@ int config_parse_namespace_flags( /* Boolean parameter ignores the previous settings */ r = parse_boolean(rvalue); if (r > 0) { - *flags = 0; + /* RestrictNamespaces= value gets stored into a field with reverse semantics (the namespaces + * which are retained), so RestrictNamespaces=true means we retain no access to any + * namespaces and vice-versa. */ + *flags = streq(lvalue, "RestrictNamespaces") ? 0 : all; return 0; } else if (r == 0) { - *flags = all; + *flags = streq(lvalue, "RestrictNamespaces") ? all : 0; return 0; }