From ae6c3cc009a21df4b51851fb8fe3fde0b7d6d8f0 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 12 Dec 2014 02:32:33 +0100 Subject: util: when using basename() for creating temporary files, verify the resulting name is actually valid Also, rename filename_is_safe() to filename_is_valid(), since it actually does a full validation for what the kernel will accept as file name, it's not just a heuristic. --- src/core/load-fragment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index 259323bd5c..3fbe680cf0 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -3066,7 +3066,7 @@ int config_parse_runtime_directory( if (!n) return log_oom(); - if (!filename_is_safe(n)) { + if (!filename_is_valid(n)) { log_syntax(unit, LOG_ERR, filename, line, EINVAL, "Runtime directory is not valid, ignoring assignment: %s", rvalue); continue; -- cgit v1.2.3-54-g00ecf