Skip to content

chore: scrub-archive hostile-fs tests no-op-pass under root (add uid skip-guard) #178

Description

@edheltzel

From RedTeam pass 4 on PR #176 (#157), filed as a non-blocking follow-up.

The two hostile-filesystem tests in tests/commands/scrub-archive.test.ts (mode-444 unwritable surface; unwritable-backup-dir / ENOTDIR) rely on POSIX permission bits to force EACCES/ENOTDIR. Root ignores mode bits, so under a root UID these tests would silently no-op-pass (false green) instead of exercising the write-failure guard.

Today this is covered: CI runs the full suite non-root on macos-latest, so the permission bits are honored and the tests are meaningful. The risk is latent — if the full bun test is ever added to a root-container Ubuntu leg, these would false-green.

Harden: add a process.getuid?.() === 0 skip-guard (skip + log when root) or an fs.access precondition assertion that fails loudly if the hostile precondition isn't actually in force. Low priority.

Metadata

Metadata

Assignees

No one assigned

    Labels

    risk:lowwork that is non-ambiguous, no human judgement as `agent:ready`type:choremisc things, like cleanup

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions