summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-05-25 17:25:40 +0200
committerLuca Boccassi <luca.boccassi@gmail.com>2021-05-26 00:19:50 +0200
commit108144adea838b281fe1f60dfa75542fe4c82d4b (patch)
treeb4cd4b0052fc7ca977f44786236f4b829b94b55f /src
parentMerge pull request #19322 from poettering/dep-split (diff)
downloadsystemd-108144adea838b281fe1f60dfa75542fe4c82d4b.tar.xz
systemd-108144adea838b281fe1f60dfa75542fe4c82d4b.zip
load-fragment: validate paths properly
The comment suggests we validate paths here, but we actually didn't, we only validated filenames. Let' fix that. (Note this still lets any kind of paths through, including those with ".." and stuff, this is not a normalization check after all)
Diffstat (limited to 'src')
-rw-r--r--src/core/load-fragment.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index 72378a4082..ff6eaf32ef 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -789,7 +789,7 @@ int config_parse_exec(
return ignore ? 0 : -ENOEXEC;
}
- if (!path_is_absolute(path) && !filename_is_valid(path)) {
+ if (!(path_is_absolute(path) ? path_is_valid(path) : filename_is_valid(path))) {
log_syntax(unit, ignore ? LOG_WARNING : LOG_ERR, filename, line, 0,
"Neither a valid executable name nor an absolute path%s: %s",
ignore ? ", ignoring" : "", path);