sysupdate: use path_is_safe()

path_is_safe(...) is an alias of path_is_valid_full(..., false).
This commit is contained in:
Yu Watanabe
2025-06-22 14:44:04 +09:00
parent b53c3af3fe
commit 04fd0b9ff0

View File

@@ -1130,7 +1130,7 @@ int transfer_acquire_instance(Transfer *t, Instance *i, TransferProgress cb, voi
if (RESOURCE_IS_FILESYSTEM(t->target.type)) {
if (!path_is_valid_full(formatted_pattern, /* accept_dot_dot = */ false))
if (!path_is_safe(formatted_pattern))
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Formatted pattern is not suitable as file name, refusing: %s", formatted_pattern);
t->final_path = path_join(t->target.path, formatted_pattern);