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-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=f478a555312750ee848b23625144eb8ac84db2d4;p=elogind.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 b213b0fa5..ef295ea57 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -922,10 +922,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;