fix(install): verify legacy postimages with owned descriptors

Preserve contributor history and current-main behavior while resolving the exact reviewed follow-up.

Source-PR: https://github.com/affaan-m/ECC/pull/3008
Source-Parent: c492920468
Review-Manifest-SHA256: 4f71a8f8d4d3aedcfb03f41d37274c28c6b83b39250d2f466e7f8243325ae09a
This commit is contained in:
affaan-m
2026-09-28 02:14:19 -04:00
parent c492920468
commit be9fe61ef7
4 changed files with 126 additions and 14 deletions
@@ -109,7 +109,8 @@ function inspectLegacyOpencodeState(location) {
function hashFileNoFollow(filePath, fileSystem = fs) {
// The filesystem seam supplies operations, never the read-only access policy.
const flags = fs.constants.O_RDONLY | (fs.constants.O_NOFOLLOW || 0);
const descriptor = fileSystem.openSync(filePath, flags);
// Read-only opens ignore mode; adapters still receive an owner-only default.
const descriptor = fileSystem.openSync(filePath, flags, 0o600);
try {
const before = fileSystem.fstatSync(descriptor, { bigint: true });
if (!before.isFile()) {