bus-unit-util: generate proper log message when we fail to parse properties

This commit is contained in:
Lennart Poettering
2021-02-25 13:38:20 +01:00
parent 2a7865cc43
commit de4abc3f46
+6 -6
View File
@@ -1679,14 +1679,14 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con
r = extract_first_word(&p, &tuple, NULL, EXTRACT_UNQUOTE|EXTRACT_RETAIN_ESCAPE);
if (r < 0)
return r;
return log_error_errno(r, "Failed to parse MountImages= property: %s", eq);
if (r == 0)
break;
q = tuple;
r = extract_many_words(&q, ":", EXTRACT_CUNESCAPE|EXTRACT_UNESCAPE_SEPARATORS, &first, &second, NULL);
if (r < 0)
return r;
return log_error_errno(r, "Failed to parse MountImages= property: %s", eq);
if (r == 0)
continue;
@@ -1718,7 +1718,7 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con
r = extract_many_words(&q, ":", EXTRACT_CUNESCAPE|EXTRACT_UNESCAPE_SEPARATORS, &partition, &mount_options, NULL);
if (r < 0)
return r;
return log_error_errno(r, "Failed to parse MountImages= property: %s", eq);
if (r == 0)
break;
/* Single set of options, applying to the root partition/single filesystem */
@@ -1785,14 +1785,14 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con
r = extract_first_word(&p, &tuple, NULL, EXTRACT_UNQUOTE|EXTRACT_RETAIN_ESCAPE);
if (r < 0)
return r;
return log_error_errno(r, "Failed to parse ExtensionImages= property: %s", eq);
if (r == 0)
break;
q = tuple;
r = extract_first_word(&q, &source, ":", EXTRACT_CUNESCAPE|EXTRACT_UNESCAPE_SEPARATORS);
if (r < 0)
return r;
return log_error_errno(r, "Failed to parse ExtensionImages= property: %s", eq);
if (r == 0)
continue;
@@ -1819,7 +1819,7 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con
r = extract_many_words(&q, ":", EXTRACT_CUNESCAPE|EXTRACT_UNESCAPE_SEPARATORS, &partition, &mount_options, NULL);
if (r < 0)
return r;
return log_error_errno(r, "Failed to parse ExtensionImages= property: %s", eq);
if (r == 0)
break;
/* Single set of options, applying to the root partition/single filesystem */