diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-10-02 10:50:07 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-10-02 17:41:44 +0200 |
commit | 091e9efed3f417bdd8bdee814d8676757ffb19db (patch) | |
tree | c832839646871cea949b7286b4df915d29637246 /src/shared | |
parent | test: add test for DynamicUser= + StateDirectory= (diff) | |
download | systemd-091e9efed3f417bdd8bdee814d8676757ffb19db.tar.xz systemd-091e9efed3f417bdd8bdee814d8676757ffb19db.zip |
core: fix StateDirectory= (and friends) safety checks when decoding transient unit properties
Let's make sure relative directories such as "foo/bar" are accepted, by
using the same validation checks as in unit file parsing.
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/bus-unit-util.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c index d216df465f..a08f17d821 100644 --- a/src/shared/bus-unit-util.c +++ b/src/shared/bus-unit-util.c @@ -959,9 +959,10 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen _cleanup_free_ char *word = NULL; r = extract_first_word(&p, &word, NULL, EXTRACT_QUOTES); + if (r == -ENOMEM) + return log_oom(); if (r < 0) return log_error_errno(r, "Failed to parse %s value %s", field, eq); - if (r == 0) break; |