yeoman/yo — pull request #159 by SBoudrias (2014-04-19 05:32:48+00:00)
Title: Try to use safe uid before throwing sudo error

Relate to issue #101

But it could also prevent some issues people face when facing NPM/Unix installation/permissions issues.

This allow the yo executable from being only executable by a super user. Then, once yo is loaded and running, we change user to the default one (id 501). This mean file will probably stay writable, and it should limit the number of issues we got about people having weird permissions on their laptop.

I saw this trick used often in Node.js when the process must bind on port 80 (requiring elevated permissions). The user sudo the script so it bind correctly to the port, and afterwards, the node process change it's UID to the machine default so it limit security risks.

I'm not sure it'll fix issues for the people on Docker, but I feel it is a step in the right directions (and it'll fix issues for lots of people).