]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: use unit_full_printf() at a couple of locations we used unit_name_printf()...
authorLennart Poettering <lennart@poettering.net>
Mon, 5 Dec 2016 18:25:44 +0000 (19:25 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 7 Dec 2016 17:47:32 +0000 (18:47 +0100)
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.

src/core/load-fragment.c

index c844ec25669874c7dc6cbef98e3fbee3dcb4f781..3ffb417f97b344293cc268fabbdff967dc7e2cac 100644 (file)
@@ -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);