Skip to content

Sync fork with ultraworkers/claw-code:main - #7

Merged
niStee merged 5 commits into
mainfrom
sync/upstream-20260806-225820
Aug 6, 2026
Merged

Sync fork with ultraworkers/claw-code:main#7
niStee merged 5 commits into
mainfrom
sync/upstream-20260806-225820

Conversation

@fork-sync-approver

Copy link
Copy Markdown

Automated pull-based sync from ultraworkers/claw-code.

Uses GitHub App installation token for short-lived, repo-scoped approval (actions/create-github-app-token@v2).

procaffe121 and others added 5 commits July 31, 2026 17:08
No behavior change. Move the inline probe out of
unshare_user_namespace_works into a reusable unshare_probe helper and a
cached working_unshare_mapping() that picks the first working candidate
from UNSHARE_MAPPING_CANDIDATES, so the launcher and the capability probe
share one code path.
…icted

Plain `unshare --user --map-root-user` fails on kernels and containers
that block unprivileged writes to /proc/self/uid_map (e.g. GitHub Actions,
restricted AppArmor profiles). On those systems util-linux delegates to the
setuid newuidmap/newgidmap helpers when --map-auto is also present.

Add the combined form as a fallback candidate and build the launcher args
from the probed mapping, so systems without newuidmap/newgidmap or a
/etc/subuid range keep using the plain form.
… fallback

The fallback candidate relies on the setuid newuidmap/newgidmap helpers
(uidmap package) plus a subuid/subgid range for the current user. Note in
the candidate docs that the startup probe rejects the candidate when those
are missing, so the plain --map-root-user form is used instead.
The startup probe validated only the mapping flags against the trivial
program `true`, but the real launcher always adds
--mount --ipc --pid --uts --fork. On environments where the user
namespace is created but mount propagation inside it is restricted
(e.g. AppArmor-restricted CI runners), the fallback mapping passed the
probe and the sandbox activated, yet every sandboxed command died with
"cannot change root filesystem propagation: Permission denied",
silently returning empty tool output and breaking the mock parity
suite.

The candidates now define the complete static launcher shape (mapping
flags + namespace flags), so probe success implies launch success; the
launcher reuses the candidate instead of re-appending the namespace
flags, keeping probe and launch as one source of truth. The
order-guarding test asserts the namespace flags are present in every
candidate.

Co-authored-by: linkst <2024023709@m.scnu.edu.cn>
…ap-auto-fallback

fix(sandbox): fall back to --map-auto when root-user mapping is restricted
@niStee
niStee merged commit 6646a7d into main Aug 6, 2026
7 checks passed
@niStee
niStee deleted the sync/upstream-20260806-225820 branch August 6, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants