From: Luca Boccassi Date: Mon, 22 Feb 2021 21:31:44 +0000 (+0000) Subject: MountImages: parse unit specifiers after permissive hyphen X-Git-Tag: v248-rc1~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6c3f7ca036829825f344ffb364354faee5db174e;p=thirdparty%2Fsystemd.git MountImages: parse unit specifiers after permissive hyphen The permissive bit it not something a specifier might synthetise --- diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index b9fc450ac73..3e7081bf609 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,