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
host-kit: process lock fails under an owner-masking umask #4903
Found in the #4833 review. acquireProcessLock creates the lock directory with the process umask (packages/host-kit/src/internal/process-lock.ts:278). Under a umask that masks owner write, such as 0200, the directory loses owner write and the owner record cannot be written, so every caller of the shared lock fails.
Required behavior
The lock publisher sets exact owner permissions on each lock directory, owner record and guard file it creates (directories 0700, files 0600), independent of the umask.
A test takes and releases a lock under umask 0200.
This affects every process-lock user (runner cache, device claims, Swift cache, CLI session file), so it belongs in host-kit, not in one caller.
The report identifies existing incorrect behavior in acquireProcessLock: it honors the process umask, causing lock directory creation to fail under restrictive umask like 0200, and specifies a concrete fix with file mode requirements and a regression test.
From the #4833 review at c721659: the same fix covers a permissive umask. Under umask 000 the lock directory is created 0777 (process-lock.ts:278) and the owner record 0666 through atomic-publish.ts:29-34 with no mode, including the record restored on release (process-lock.ts:605-609). Create lock directories 0700 and owner records 0600 regardless of umask.
Fixed in #4833 at f4aada0: lock directories are created 0700 and owner records are written at exactly 0600 under any umask, with a test for umask 0200 and 000.
Closing: fixed by #4833, now on main (caa232e). acquireProcessLock creates lock directories as 0700 and writes owner records as exactly 0600 under any umask, with tests for umask 0200 and 000.
Activity
apex-sentinel-staging commentedon Nov 21, 2026
Apex Sentinel · Issue review
Suggested label:
bugThe report identifies existing incorrect behavior in acquireProcessLock: it honors the process umask, causing lock directory creation to fail under restrictive umask like 0200, and specifies a concrete fix with file mode requirements and a regression test.
Required sections
thymikee commentedon Nov 21, 2026
From the #4833 review at c721659: the same fix covers a permissive umask. Under umask
000the lock directory is created0777(process-lock.ts:278) and the owner record0666throughatomic-publish.ts:29-34with no mode, including the record restored on release (process-lock.ts:605-609). Create lock directories0700and owner records0600regardless of umask.thymikee commentedon Nov 21, 2026
Fixed in #4833 at f4aada0: lock directories are created 0700 and owner records are written at exactly 0600 under any umask, with a test for umask 0200 and 000.
thymikee commentedon Nov 21, 2026
Reopened until #4833 merges.
thymikee commentedon Nov 22, 2026
Closing: fixed by #4833, now on main (caa232e).
acquireProcessLockcreates lock directories as 0700 and writes owner records as exactly 0600 under any umask, with tests for umask 0200 and 000.