From a3839ade4ea27ca7a8c5c5a02d10b74dc9e54d96 Mon Sep 17 00:00:00 2001 From: dongshengyuan <545258830@qq.com> Date: Wed, 5 Aug 2026 12:18:03 +0800 Subject: [PATCH] sysupdate: allow long CurrentSymlink= paths CurrentSymlink= accepts a symlink path, but the parser used NAME_MAX for specifier expansion. Absolute and target-relative paths can be longer than one filename component while still staying below PATH_MAX. Reproducer: configure CurrentSymlink= to a path longer than NAME_MAX and run systemd-sysupdate list with debug logging. Before: sysupdate logged that CurrentSymlink= specifier expansion failed and ignored the setting. After: the transfer parses cleanly and list emits no CurrentSymlink= specifier expansion warning. Follow-up for: 43cc7a3ef4f6a89946e7ffd6a3112a0c1740b1ef --- src/sysupdate/sysupdate-transfer.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/sysupdate/sysupdate-transfer.c b/src/sysupdate/sysupdate-transfer.c index a03bbbb63f..226dbd93ae 100644 --- a/src/sysupdate/sysupdate-transfer.c +++ b/src/sysupdate/sysupdate-transfer.c @@ -238,7 +238,12 @@ static int config_parse_current_symlink( assert(rvalue); - r = specifier_printf(rvalue, NAME_MAX, system_and_tmp_specifier_table, t->context->root, NULL, &resolved); + if (isempty(rvalue)) { + *current_symlink = mfree(*current_symlink); + return 0; + } + + r = specifier_printf(rvalue, PATH_MAX-1, system_and_tmp_specifier_table, t->context->root, NULL, &resolved); if (r < 0) { log_syntax(unit, LOG_WARNING, filename, line, r, "Failed to expand specifiers in CurrentSymlink=, ignoring: %s", rvalue);