1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-25 23:21:33 +03:00

MountImages: parse unit specifiers after permissive hyphen

The permissive bit it not something a specifier might synthetise
This commit is contained in:
Luca Boccassi 2021-02-22 21:31:44 +00:00 committed by Zbigniew Jędrzejewski-Szmek
parent 267294e08d
commit 6c3f7ca036

View File

@ -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,