Page MenuHomePhabricator

Reset umask to 022 for all Phabricator processes
ClosedPublic

Authored by epriestley on Apr 15 2016, 4:43 PM.
Tags
None
Referenced Files
F13091130: D15721.diff
Thu, Apr 25, 2:45 AM
Unknown Object (File)
Fri, Apr 12, 1:41 PM
Unknown Object (File)
Thu, Apr 11, 10:01 AM
Unknown Object (File)
Mar 8 2024, 1:53 PM
Unknown Object (File)
Mar 8 2024, 1:52 PM
Unknown Object (File)
Feb 18 2024, 5:58 PM
Unknown Object (File)
Feb 18 2024, 3:38 PM
Unknown Object (File)
Feb 15 2024, 3:45 AM
Subscribers
None

Details

Summary

Fixes T7475. If you do something like:

$ umask 123
$ ./bin/phd start

...the daemons might inherit the weird umask, do a git fetch with the weird umask, and end up creating files with weird permissions in repositories.

Instead, just normalize the umask to 022 in all cases. This is overwhelmingly the most common setting, and the one we assume things are configured with.

(When we want to force permissions to a certain setting, we do so explicitly.)

Test Plan
  • Added var_dump(umask()) to observe umask.
  • Ran bin/phd, saw proper umask (18, which is decimal of 022 octal).
  • Set umask 123, then ran bin/phd, saw it correct properly again.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Reset umask to 022 for all Phabricator processes.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
chad edited edge metadata.
This revision is now accepted and ready to land.Apr 15 2016, 4:45 PM

Possibly we should also set this in libphutil somewhere, or even in __phutil_init_script__(), but that seems a little aggressive and no one on T7475 appears to have a use case other than "some ops thing runs bin/phd with a weird umask" after some time.

This revision was automatically updated to reflect the committed changes.