mirror of https://github.com/lukechilds/node.git
Browse Source
`FChown` and `Chown` test that the `uid` and `gid` parameters they receive are unsigned integers, but `Stat()` and `FStat()` would return the corresponding fields of `uv_stat_t` as signed integers. Applications which pass those these values directly to `Chown` may fail (e.g. for `nobody` on OS X, who has an `uid` of `-2`, see e.g. https://github.com/nodejs/node-v0.x-archive/issues/5890). This patch changes the `Integer::New()` call for `uid` and `gid` to `Integer::NewFromUnsigned()`. All other fields are kept as they are, for performance, but strictly speaking the respective sizes of those fields aren’t specified, either. Ref: https://github.com/npm/npm/issues/13918 PR-URL: https://github.com/nodejs/node/pull/8515 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> undo accidental change to other fields of uv_fs_statv6.x
committed by
Jeremiah Senkpiel
1 changed files with 20 additions and 10 deletions
Loading…
Reference in new issue