diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2023-10-30 17:50:11 +0100 |
---|---|---|
committer | Frantisek Sumsal <frantisek@sumsal.cz> | 2023-10-31 17:34:37 +0100 |
commit | 6f93eb159a708b7161188ae4c75be388cdfedabc (patch) | |
tree | 7d4924f88708433a610c45c28ab2ed7be462db22 /src/core | |
parent | Merge pull request #29763 from yuwata/vconsole-conf (diff) | |
download | systemd-6f93eb159a708b7161188ae4c75be388cdfedabc.tar.xz systemd-6f93eb159a708b7161188ae4c75be388cdfedabc.zip |
core: check if we got a valid personality during deserialization
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/execute-serialize.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/execute-serialize.c b/src/core/execute-serialize.c index 18033fe9c3..342883994a 100644 --- a/src/core/execute-serialize.c +++ b/src/core/execute-serialize.c @@ -3395,9 +3395,11 @@ static int exec_context_deserialize(ExecContext *c, FILE *f) { r = free_and_strdup(&c->smack_process_label, val); if (r < 0) return r; - } else if ((val = startswith(l, "exec-context-personality="))) + } else if ((val = startswith(l, "exec-context-personality="))) { c->personality = personality_from_string(val); - else if ((val = startswith(l, "exec-context-lock-personality="))) { + if (c->personality == PERSONALITY_INVALID) + return -EINVAL; + } else if ((val = startswith(l, "exec-context-lock-personality="))) { r = parse_boolean(val); if (r < 0) return r; |