]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sysupdate: use path_is_safe()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 22 Jun 2025 05:44:04 +0000 (14:44 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 23 Jun 2025 15:49:04 +0000 (00:49 +0900)
path_is_safe(...) is an alias of path_is_valid_full(..., false).

src/sysupdate/sysupdate-transfer.c

index 0916aacab281695940849109817529e905334951..104da0a68df64deaa59d92bc99f3fcab285b35c6 100644 (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);