From: Lennart Poettering Date: Mon, 5 Dec 2016 18:25:44 +0000 (+0100) Subject: core: use unit_full_printf() at a couple of locations we used unit_name_printf()... X-Git-Tag: v233~339^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=18913df9a2aa5ee53a1dfb6f3cf8cdddcc7f11a3;p=thirdparty%2Fsystemd.git core: use unit_full_printf() at a couple of locations we used unit_name_printf() before For settings that are not taking unit names there's no reason to use unit_name_printf(). Use unit_full_printf() instead, as the names are validated anyway in one form or another after expansion. --- diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index c844ec25669..3ffb417f97b 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -1336,7 +1336,7 @@ int config_parse_exec_selinux_context( } else ignore = false; - r = unit_name_printf(u, rvalue, &k); + r = unit_full_printf(u, rvalue, &k); if (r < 0) { log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve specifiers, ignoring: %m"); return 0; @@ -1384,7 +1384,7 @@ int config_parse_exec_apparmor_profile( } else ignore = false; - r = unit_name_printf(u, rvalue, &k); + r = unit_full_printf(u, rvalue, &k); if (r < 0) { log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve specifiers, ignoring: %m"); return 0; @@ -1432,7 +1432,7 @@ int config_parse_exec_smack_process_label( } else ignore = false; - r = unit_name_printf(u, rvalue, &k); + r = unit_full_printf(u, rvalue, &k); if (r < 0) { log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve specifiers, ignoring: %m"); return 0; @@ -1699,7 +1699,7 @@ int config_parse_fdname( return 0; } - r = unit_name_printf(UNIT(s), rvalue, &p); + r = unit_full_printf(UNIT(s), rvalue, &p); if (r < 0) { log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve specifiers, ignoring: %s", rvalue); return 0; @@ -3720,7 +3720,7 @@ int config_parse_runtime_directory( return 0; } - r = unit_name_printf(u, word, &k); + r = unit_full_printf(u, word, &k); if (r < 0) { log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve specifiers in \"%s\", ignoring: %m", word);