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
F14407248: D15721.diff
Tue, Dec 24, 2:33 AM
Unknown Object (File)
Sat, Dec 14, 9:26 AM
Unknown Object (File)
Fri, Dec 6, 4:57 AM
Unknown Object (File)
Wed, Dec 4, 8:33 AM
Unknown Object (File)
Nov 21 2024, 1:35 AM
Unknown Object (File)
Nov 18 2024, 1:35 PM
Unknown Object (File)
Nov 7 2024, 7:45 PM
Unknown Object (File)
Oct 24 2024, 11:24 PM
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.