Commit Graph
3 Commits
Author SHA1 Message Date
viyatb-oai ac9b5b8380 Ignore ripgrep configuration when expanding sandbox deny globs (#51527)
## Why

User ripgrep configuration can suppress the file list used to construct Linux sandbox deny masks. For example, `--quiet` in `RIPGREP_CONFIG_PATH` can leave files matching deny globs unmasked.

## What changed

Pass `--no-config` to the ripgrep invocation that expands denied-file globs.

## Testing

Extend the multiple-denied-files regression test with a ripgrep configuration containing `--quiet`, checking that denied files remain unreadable and unwritable while allowed files remain accessible. Skip the ripgrep-specific case when no protected `rg` executable is available.

GitOrigin-RevId: 06a6e27e0edec92e79e99af5144b57f86079953f
2026-10-07 00:51:24 +00:00
viyatb-oai ccde2fc8b7 Protect ripgrep lookup during Linux sandbox construction (#51407)
## Why

Deny-read glob expansion runs before sandbox confinement. Resolving `rg` directly from `PATH` could execute a writable workspace binary at that stage.

## What changed

Use the existing protected executable lookup to select a canonical `rg` path under the filesystem policy. Fall back to the native glob walker when no suitable executable is found, preserving masks for matching denied paths.

## Testing

Extend denied-file integration tests to verify that a writable workspace `rg` never runs, a protected `rg` is used when available, and denied files remain blocked with the native fallback.

GitOrigin-RevId: f06674f3535c8a72a4656871762e45fa13c732f2
2026-10-06 16:30:34 +00:00
Yuzhu Shen ae7aad586e Fix Linux sandbox startup with multiple denied files (#50059)
## Why

Bubblewrap consumes and closes the file descriptor for each `--ro-bind-data` mount. Reusing one descriptor across multiple file masks prevents the sandbox from starting.

## What changed

Open and preserve a separate `/dev/null` descriptor for each empty-file mask.

## Testing

Extend unit tests to verify distinct descriptors for multiple denied files and missing-path masks. Add integration coverage for exact-path and glob deny rules, checking that the sandbox starts, denied files remain unreadable and unwritable, and allowed files remain accessible.

GitOrigin-RevId: 85158c83699afd36bb7aca453b2652d777cf65e4
2026-10-01 18:05:33 +00:00