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://review.tizen.org/git/?a=commitdiff_plain;h=40fdd636ad8eb7cd8dbf18db8ad724ff4ac2ba33;p=platform%2Fupstream%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 c0afe45..a84b612 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;