Documentation
¶
Overview ¶
Package archiveutil provides shared, path-traversal-safe archive extraction. It is used both by the modeld install flow (unpacking downloaded release bundles) and by node-side model receipt (unpacking a pushed OpenVINO IR bundle) — two independent callers writing untrusted archive content to disk, where a single reviewed implementation of the escape checks matters more than call-site convenience.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractTar ¶
ExtractTar unpacks a tar stream from r into dest, rejecting any entry that would escape dest (absolute paths, `..`, escaping sym/hardlinks). Regular file modes are preserved. Symlinks and hardlinks are supported but validated to stay within dest. r is a raw tar stream — callers wrap it in a gzip.Reader first for a .tar.gz archive.
func SafeJoin ¶
SafeJoin resolves an archive entry name (forward-slash separated) against dest and guarantees the result stays within dest. It rejects empty paths, absolute paths, and `..` traversal.
func SafeLinkTarget ¶
SafeLinkTarget validates a symlink: linkDir is the directory containing the link, linkname is the (possibly relative) target as stored in the archive. The resolved target must stay within dest, and absolute targets are rejected.
Types ¶
This section is empty.