npm / fstream

Advanced FS Streaming for Node
ISC License
208 stars 43 forks source link

Writer fails on chown #36

Closed silkentrance closed 9 years ago

silkentrance commented 9 years ago

In lib/writer.js it reads

195 function endChown (me, want, current, path, cb) {
196   // Don't even try it unless root.  Too easy to EPERM.
197   if (process.platform === "win32") return cb()
198   if (!process.getuid || !process.getuid() == 0) return cb()

Here, the expression

198   if (!process.getuid || !process.getuid() == 0) return cb()

fails due to !process.getuid() === 0 being the wrong statement, it should read (process.getuid() !== 0) instead.

silkentrance commented 9 years ago

See also https://github.com/npm/npm/issues/7120#issuecomment-69822522

edef1c commented 9 years ago

Still pending an npm publish from @othiym23 or @isaacs for this to be actually fixed in the published version.

silkentrance commented 9 years ago

npm includes fstream in a rather old version and does not depend on it package wise. It should be updated there, too.

silkentrance commented 9 years ago

@isaacs @othiym23 how about making this available to the public... and please do include this new version in npm, too.

othiym23 commented 9 years ago

This is published as part of fstream@1.0.4 and I'm currently testing fstream@1.0.4 in npm, so it will probably be there shortly.

silkentrance commented 9 years ago

@othiym23 Great, thanks.