Skip to content

host-kit: process lock fails under an owner-masking umask #4903

Closed

Description

@thymikee

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.

Activity

  1. added
    bug
    on Nov 21, 2026
  2. apex-sentinel-staging commented on Nov 21, 2026

    @apex-sentinel-staging

    Apex Sentinel · Issue review

    Suggested label: bug

    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.

    Required sections

    • Steps to reproduce (missing)
    • Expected and actual behavior (missing)
    • Version or environment (missing)
  3. thymikee commented on Nov 21, 2026

    @thymikee
    MemberAuthor

    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.

  4. thymikee commented on Nov 21, 2026

    @thymikee
    MemberAuthor

    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.

  5. thymikee commented on Nov 21, 2026

    @thymikee
    MemberAuthor

    Reopened until #4833 merges.

  6. thymikee commented on Nov 22, 2026

    @thymikee
    MemberAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions