Skip to content

fix(container): add git safe.directory to setup.sh#80

Merged
AnExiledDev merged 2 commits intostagingfrom
fix/git-safe-directory
Apr 29, 2026
Merged

fix(container): add git safe.directory to setup.sh#80
AnExiledDev merged 2 commits intostagingfrom
fix/git-safe-directory

Conversation

@AnExiledDev
Copy link
Copy Markdown
Owner

Summary

  • Adds git config --global safe.directory to setup.sh, running on every container start before setup stages
  • Fixes "dubious ownership" errors (CVE-2022-24765) caused by uid mismatch between container user and bind-mounted /workspaces
  • Uses ${WORKSPACE_ROOT:-/workspaces} for consistency with existing setup.sh patterns

Test plan

  • Rebuild the container
  • Run git config --global --get-all safe.directory — should output /workspaces
  • cd into any project under /workspaces and run git status — no "dubious ownership" error

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 29, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 79b45d0b-0044-41e7-b545-f32b05332b38

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/git-safe-directory

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Bind-mounted /workspaces may have a different uid than the container
user, causing Git to refuse all operations with "dubious ownership"
errors (CVE-2022-24765). Runs on every container start before any
setup stages.
git config fails with exit code 5 when safe.directory already has
multiple values. Using --add prevents this, and the error handler
logs a warning consistent with the chown pattern above.
@AnExiledDev AnExiledDev force-pushed the fix/git-safe-directory branch from f283d05 to 0fc0fae Compare April 29, 2026 21:03
@AnExiledDev
Copy link
Copy Markdown
Owner Author

Fix applied: Changed git config --global safe.directory to git config --global --add safe.directory with error handling.

@AnExiledDev AnExiledDev merged commit 047d832 into staging Apr 29, 2026
7 of 8 checks passed
@AnExiledDev AnExiledDev deleted the fix/git-safe-directory branch April 29, 2026 21:03
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.

1 participant