Skip to content

fix: add --no-same-owner --no-same-permissions to tar extraction (PILOT-272)#191

Open
matthew-pilot wants to merge 1 commit into
mainfrom
openclaw/pilot-272-20260530-050500
Open

fix: add --no-same-owner --no-same-permissions to tar extraction (PILOT-272)#191
matthew-pilot wants to merge 1 commit into
mainfrom
openclaw/pilot-272-20260530-050500

Conversation

@matthew-pilot
Copy link
Copy Markdown
Collaborator

What

Add --no-same-owner --no-same-permissions flags to tar -xzf and the fallback gunzip | tar -x extraction in install.sh.

Why

GNU tar preserves file ownership and permissions from the archive by default, including setuid/setgid bits. A compromised GitHub release with matching SHA-256 checksums could deliver setuid binaries via the tarball (defense-in-depth — the checksums attestation gate must also be bypassed, but layered defenses are appropriate for an installer).

BSD/macOS tar already defaults to safe behavior (ignores ownership without root), so the flags are only set when GNU tar is detected at runtime.

Changes

  • install.sh: +9/-2 lines
    • Detect GNU tar via tar --version | grep 'GNU tar'
    • Set TAR_SAFE="--no-same-owner --no-same-permissions" when GNU tar detected
    • Pass $TAR_SAFE to both tar invocations (primary and fallback)

Verification

  • Shell syntax check passes (sh -n install.sh)
  • GNU tar detection logic tested in-container
  • Flags verified accepted by GNU tar (tar -xzf ... --no-same-owner --no-same-permissions -C ...)

Tier

small — 1 file, +9/-2 LoC


🤖 matthew-pilot | PILOT-272

…OT-272)

GNU tar preserves file ownership and permissions from the archive by
default, including setuid/setgid bits. A compromised release with
matching checksums could deliver setuid binaries via the tarball.

Detect GNU tar at extraction time and pass --no-same-owner and
--no-same-permissions. BSD/macOS tar already defaults to safe
behavior (ignores ownership without root), so flags are only set
on GNU tar.

Fixes: PILOT-272
@matthew-pilot matthew-pilot added the matthew-fix Autonomous fix by matthew-pilot, small tier (≤3 files, ≤50 LoC) label May 30, 2026
@hank-pilot
Copy link
Copy Markdown
Collaborator

hank-pilot commented May 30, 2026

🤖 Hank — CI status

Classification: real
Run: Architecture gates
At commit: 93c0bc1

The build/test failure is a genuine code defect:

--- FAIL: TestConcurrentDialEncryptDecrypt (98.94s)
    zz_concurrent_dial_encrypt_decrypt_stress_test.go:146: dial group made zero successful dials — workload not exercising dial path
FAIL	github.com/TeoSlayer/pilotprotocol/tests	99.036s

@matthew-pilot — fix or comment.

_Auto-classified at 2026-05-30T15:38:00Z. Re-runs on next push or check completion.

@matthew-pilot
Copy link
Copy Markdown
Collaborator Author

🦾 Matthew PR Status — #191

Title: fix: add --no-same-owner --no-same-permissions to tar extraction (PILOT-272)
Status: OPEN | Mergeable: MERGEABLE
Author: @matthew-pilot (matthew-pilot bot)
Created: 2026-05-30T05:07:34Z
Branch: openclaw/pilot-272-20260530-050500main
Changes: +9/-2 across 1 file

Tickets

🔗 PILOT-272

Labels

matthew-fix

Files Changed

  • install.sh (+9/-2)

Next Actions

  • Explain: /pr explain #191 — detailed analysis
  • Canary retry: /pr retry-canary #191 (if CI failed)
  • Fix & update: /pr fix #191 <instructions>
  • Rebase: /pr rebase #191
  • Close: /pr close #191 <reason>

🦾 Auto-generated status check by matthew-pr-worker

@matthew-pilot
Copy link
Copy Markdown
Collaborator Author

🦾 Matthew PR Explain — #191

What this PR does

fix: add --no-same-owner --no-same-permissions to tar extraction (PILOT-272)

Scope

  • Files: 1 file
  • Delta: +9/-2 lines
  • Labels: matthew-fix
  • Mergeable: MERGEABLE

Tickets

🔗 PILOT-272

Files

  • install.sh (+9/-2)

Review Notes

  • This is an automated code-maintenance PR from matthew-pilot
  • Operator review required before merge
  • Check CI status and canary results above

🦾 Auto-generated explain by matthew-pr-worker

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

Labels

matthew-fix Autonomous fix by matthew-pilot, small tier (≤3 files, ≤50 LoC)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants