fix(shared): validate tar hard-link targets during preflight

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-04-04 01:16:37 +09:00
parent 553a961338
commit ccbd646a29
3 changed files with 20 additions and 11 deletions
+3 -3
View File
@@ -78,15 +78,15 @@ function parseTarEntry(line: string): ArchiveEntry | null {
}
const [, rawType, rawEntryPath] = match
if (rawType === "l") {
if (rawType === "l" || rawType === "h") {
const arrowIndex = rawEntryPath.lastIndexOf(" -> ")
if (arrowIndex === -1) {
return { path: rawEntryPath, type: "symlink" }
return { path: rawEntryPath, type: rawType === "l" ? "symlink" : "hardlink" }
}
return {
path: rawEntryPath.slice(0, arrowIndex),
type: "symlink",
type: rawType === "l" ? "symlink" : "hardlink",
linkPath: rawEntryPath.slice(arrowIndex + 4),
}
}