sysupdate: allow long metadata URLs

138829b784 moved Documentation=, AppStream=, and related URL parsing
into sysupdate-config.c, but kept NAME_MAX as the specifier expansion
limit. These settings are URLs, not filenames.

Reproducer: configure a feature Documentation= URL longer than
NAME_MAX and run systemd-sysupdate features FEATURE.

Before: the URL was ignored after ENAMETOOLONG during specifier
expansion.

After: features FEATURE prints the long Documentation URL.

Follow-up for: 138829b784
This commit is contained in:
dongshengyuan
2026-08-05 12:17:40 +08:00
parent 753b0a6e24
commit 215c438372

View File

@@ -34,7 +34,7 @@ int config_parse_url_specifiers(
}
_cleanup_free_ char *resolved = NULL;
r = specifier_printf(rvalue, NAME_MAX, system_and_tmp_specifier_table, root, NULL, &resolved);
r = specifier_printf(rvalue, SIZE_MAX, system_and_tmp_specifier_table, root, NULL, &resolved);
if (r < 0) {
log_syntax(unit, LOG_WARNING, filename, line, r,
"Failed to expand specifiers in %s=, ignoring: %s", lvalue, rvalue);
@@ -90,7 +90,7 @@ int config_parse_url_specifiers_many(
}
_cleanup_free_ char *resolved = NULL;
r = specifier_printf(rvalue, NAME_MAX, system_and_tmp_specifier_table, root, NULL, &resolved);
r = specifier_printf(rvalue, SIZE_MAX, system_and_tmp_specifier_table, root, NULL, &resolved);
if (r < 0) {
log_syntax(unit, LOG_WARNING, filename, line, r,
"Failed to expand specifiers in %s=, ignoring: %s", lvalue, rvalue);