Harden archive directory permissions#32112
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughCompute and reuse permission modes for non-Windows directory creation and lockfile temp files instead of defaulting to 0o777; add tests to ensure tar-extracted directories preserve their entry-specified modes. ChangesPermission preservation in tar extraction and lockfile creation
Possibly related PRs:
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
cb4647e to
17691e9
Compare
Summary
This hardens archive and install filesystem permission handling:
0o777Why
The fallback path for directory extraction retried
mkdiratwith0o777after creating missing parent directories. That could make an extracted directory more permissive than the mode declared in the archive. The streaming installer had the same fallback behavior.The lockfile writer also created temporary lockfiles with
0o777and only normalized permissions afterward. Creating them with the final mode avoids that unnecessary permission window.Test Plan
git diff --checkbun,cargo, or the Bun build toolchain available inPATH.