From: Lennart Poettering Date: Thu, 14 Sep 2017 14:54:32 +0000 (+0200) Subject: conf-parser: when the empty string assigned to Personality= reset it X-Git-Tag: v235~105^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F6826%2Fhead;p=thirdparty%2Fsystemd.git conf-parser: when the empty string assigned to Personality= reset it Let's support assigning the empty string to reset things in one more place. --- diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index c0afe455777..a84b61243e0 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -916,10 +916,14 @@ int config_parse_personality( assert(rvalue); assert(personality); - p = personality_from_string(rvalue); - if (p == PERSONALITY_INVALID) { - log_syntax(unit, LOG_ERR, filename, line, 0, "Failed to parse personality, ignoring: %s", rvalue); - return 0; + if (isempty(rvalue)) + p = PERSONALITY_INVALID; + else { + p = personality_from_string(rvalue); + if (p == PERSONALITY_INVALID) { + log_syntax(unit, LOG_ERR, filename, line, 0, "Failed to parse personality, ignoring: %s", rvalue); + return 0; + } } *personality = p;