summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@microsoft.com>2021-02-22 21:31:44 +0000
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-02-23 01:11:05 +0100
commit6c3f7ca036829825f344ffb364354faee5db174e (patch)
tree99a8a71d9c1f0e3087546e4a7ea1a8aa2f8d345e
parent267294e08db00903f80e4c17616a3ed5ee59e7c1 (diff)
downloadsystemd-6c3f7ca036829825f344ffb364354faee5db174e.tar.gz
MountImages: parse unit specifiers after permissive hyphen
The permissive bit it not something a specifier might synthetise
-rw-r--r--src/core/load-fragment.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index b9fc450ac7..3e7081bf60 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -5022,20 +5022,20 @@ int config_parse_mount_images(
if (r == 0)
continue;
- r = unit_full_printf(u, first, &sresolved);
- if (r < 0) {
- log_syntax(unit, LOG_WARNING, filename, line, r,
- "Failed to resolve unit specifiers in \"%s\", ignoring: %m", first);
- continue;
- }
-
- s = sresolved;
+ s = first;
if (s[0] == '-') {
permissive = true;
s++;
}
- r = path_simplify_and_warn(s, PATH_CHECK_ABSOLUTE, unit, filename, line, lvalue);
+ r = unit_full_printf(u, s, &sresolved);
+ if (r < 0) {
+ log_syntax(unit, LOG_WARNING, filename, line, r,
+ "Failed to resolve unit specifiers in \"%s\", ignoring: %m", s);
+ continue;
+ }
+
+ r = path_simplify_and_warn(sresolved, PATH_CHECK_ABSOLUTE, unit, filename, line, lvalue);
if (r < 0)
continue;
@@ -5113,7 +5113,7 @@ int config_parse_mount_images(
r = mount_image_add(&c->mount_images, &c->n_mount_images,
&(MountImage) {
- .source = s,
+ .source = sresolved,
.destination = dresolved,
.mount_options = options,
.ignore_enoent = permissive,