diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-09-14 16:54:32 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-09-14 16:54:32 +0200 |
commit | f478a555312750ee848b23625144eb8ac84db2d4 (patch) | |
tree | 6a68580b5a4fe119d60825c44da1f93a0b43160b /src/shared/conf-parser.c | |
parent | b40e4e606d3002188014f43b9eeb937baf41820e (diff) |
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.
Diffstat (limited to 'src/shared/conf-parser.c')
-rw-r--r-- | src/shared/conf-parser.c | 12 |
1 files changed, 8 insertions, 4 deletions
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; |