From b334cb4909cc026b4f0945f951180f226bf0c87d Mon Sep 17 00:00:00 2001 From: Snider Date: Tue, 17 Mar 2026 16:23:35 +0000 Subject: [PATCH] fix(bundle): document why os.OpenFile is used instead of coreio in extractTarball MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The coreio abstraction hardcodes file permissions (0644) and has no OpenFile equivalent. os.OpenFile is needed here to preserve tar header mode bits — executable binaries require 0755. Co-Authored-By: Virgil --- node/bundle.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/node/bundle.go b/node/bundle.go index 386bb8f..e9bdaca 100644 --- a/node/bundle.go +++ b/node/bundle.go @@ -309,6 +309,9 @@ func extractTarball(tarData []byte, destDir string) (string, error) { return "", err } + // os.OpenFile is used deliberately here instead of coreio.Local.Create/Write + // because coreio hardcodes file permissions (0644) and we need to preserve + // the tar header's mode bits — executable binaries require 0755. f, err := os.OpenFile(fullPath, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, os.FileMode(hdr.Mode)) if err != nil { return "", err