News for hackers. Stuff that matters.
Re:Umask setting is ignored by npm for some directories by tyingq on Wednesday October 26, 2016 @12:31PM (#12797880)
This bit is interesting:

What I observed (even with newest npm 3.10.9) that it sometimes creates node_modules directories with permission 777. when doing the npm install multiple times the results vary, most of the time it results in 755 but sometimes in 777). This seems to have nothing to do with the source tarballs content (retrieved from registry.npmjs.org) but a more general issue. As mentioned, its not deterministic and the tarballs definitively don't contain any files/directories with such permissions.

If that's true, it may take a while to unearth the root cause.

Re:Umask setting is ignored by npm for some directories by varikin on Wednesday October 26, 2016 @12:37PM (#12797951)
I thought further up it mentioned that it starts with the permissions of the files in the tarball, then grabs process.umask (of the npm-tarball subprocess maybe?) and then overrides the execute bit. If that is correct, that is 2 layers of questionable permissions being applied leading to non-deterministicness.
Re:Umask setting is ignored by npm for some directories by tyingq on Wednesday October 26, 2016 @12:39PM (#12797975)
Perhaps, but the author of the comment I quoted seemed to be performing the install over and over, on the same machine. I assume neither the tarball permissions nor the umask would be changing, so it's odd.
Re:Umask setting is ignored by npm for some directories by varikin on Wednesday October 26, 2016 @12:40PM (#12797996)
Well that further complicates it.
Re:Umask setting is ignored by npm for some directories by jacquesm on Wednesday October 26, 2016 @04:32PM (#12800193)
Does it fork off any background processes? If so that would be the first place to look, the code executing in parallel with the main program.
Re:Umask setting is ignored by npm for some directories by kpcyrd on Wednesday October 26, 2016 @12:41PM (#12798017)
This bug was rediscovered 1 year later after a distro shipped a package with /usr/lib/node_modules/ being set to 777 in a deterministic build environment. This seems to be a race condition since it may or may not happen on multiple rebuilds.