ww build: honor Go output permission modes

This commit is contained in:
2026-08-20 22:03:09 +09:00
parent 77168fd891
commit 84f5e68709
8 changed files with 513 additions and 9 deletions

View File

@@ -5896,8 +5896,10 @@ fn fileequal(a: *u8, b: *u8) bool = {
fn copyfilestage(src: *u8, dst: *u8) i32 = {
let in: i32 = os.open(pathstr(src), os.flag.RDONLY, 0i32);
if (in < 0) { return -1; };
// BuildInstallFunc gives non-link outputs base mode 0o666; the fresh
// publication stage applies the invoking process's umask at creation.
let out: i32 = os.open(pathstr(dst),
os.flag.WRONLY | os.flag.CREATE | os.flag.TRUNC, 420i32);
os.flag.WRONLY | os.flag.CREATE | os.flag.TRUNC, 438i32);
if (out < 0) { os.close(in); return -1; };
let buf: [65536]u8;
let bad: bool = false;