You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Permission-class semantics disagree: owner-only in three places, no-world in the one that runs #559
The outlier is the line that actually runs. isPrivateMode is the gate deciding whether applyMode enforces at
all, and the doc comment sitting directly above that enforcement claims the other rule.
It already diverges the platforms
Take 0o640:
Unix — group can read. The mode says so and the kernel obeys.
Windows — isPrivateMode(0o640) is true, so applyMode fires and writes a protected DACL granting owner,
SYSTEM and Administrators. There is no group entry. The group's read is silently dropped.
So the same call means owner + group on one platform and owner only on the other. Not a security hole —
Windows lands stricter — but a caller who asked for a group grant does not get one, and is not told.
The ruling
Which rule does enforcement mean?
No world access (0o007, today's code) — group grants are honored on Unix and cannot be honored on
Windows, so any mode with group bits stays divergent.
Owner-only (0o077, today's doc and everything else) — 0o640 falls outside the enforced set entirely
and inherits its parent DACL on Windows, so the enforced set becomes exactly the set both platforms can
honor identically.
2 looks right: it makes enforcement mean the same thing everywhere, and it costs only the enforcement of modes
that were never faithfully enforced anyway.
Why the literals caused this
Go supplies no symbol for the permission classes — fs.ModePerm is all nine bits, and syscall's S_IRWXU / S_IRWXG / S_IRWXO are unix-only and unusable in cross-platform code. As octal, 0o007 and 0o077 differ by
one character and read as a typo of each other.
fsroot.PermOwner, PermGroup and PermOther landed alongside #435 to remove that. Migrating the four call
sites onto them is this issue's work, and doing so forces the ruling: the constant cannot be written without
saying which classes are excluded.
Blocks sops being able to set owner-only on decrypted plaintext, which needs the word to mean one thing.
Activity
David-Noble-at-work commentedon Nov 9, 2026
star github triage sweep added this issue to Triage: devlore, for the rule it breaks:
no-evidence: no Evidence of completion section