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.
This commit is contained in:
Lennart Poettering
2017-10-02 17:41:44 +02:00
parent 8adb3d63e6
commit 091e9efed3
3 changed files with 7 additions and 7 deletions
+2 -1
View File
@@ -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;