Currently, Filesystem::createDirectory('...') will create a directory with (rather open) 0777 permissions (regardless of the return value of umask()). In particular, the .git/arc directory (or similar directory for another VCS) will have 0777 permissions.
Details
Details
- Reviewers
epriestley - Group Reviewers
Blessed Reviewers - Commits
- rPHU0027e97cd6cb: Don't create directories as `0777` by default.
Removed the .git/arc directory and ran arc lint. Verified that the .git/arc directory had more restrictive permissions than 0777.
Diff Detail
Diff Detail
- Repository
- rPHU libphutil
- Branch
- chmod
- Lint
Lint Errors Severity Location Code Message Error src/filesystem/Filesystem.php:403 XHP31 Use Of PHP 5.3 Features Error src/filesystem/Filesystem.php:559 XHP31 Use Of PHP 5.3 Features - Unit
Tests Passed - Build Status
Buildable 1167 Build 1167: [Placeholder Plan] Wait for 30 Seconds
Event Timeline
Comment Actions
I don't think we should trust the system umask. This will lead to inexplicable failure if the umask is set incorrectly.
How about defaulting to mode 0755 (equivalent to umask 0022) instead?
Comment Actions
(Or, is there any reason that a system might reasonably have a different umask and want it preserved?)
I think supporting null to mean "trust system umask" is also reasonable, but that this shouldn't be the default.