1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-26 14:04:03 +03:00

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.
This commit is contained in:
Lennart Poettering 2017-09-14 16:54:32 +02:00
parent 8249bb728d
commit 40fdd636ad

View File

@ -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;