Skip to content

Commit

Permalink
os: convert uid and gid to 32-bit signed integers
Browse files Browse the repository at this point in the history
Make `os.userInfo()` convert the `uid` and `gid` fields to 32-bit signed
integers on Windows.

PR-URL: #42340
Refs: libuv/libuv@f3e0bffcb14
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
lpinca authored and danielleadams committed Jan 3, 2023
1 parent 8616e9b commit bc51403
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/os.js
Expand Up @@ -354,6 +354,11 @@ function userInfo(options) {
if (user === undefined)
throw new ERR_SYSTEM_ERROR(ctx);

if (isWindows) {
user.uid |= 0;
user.gid |= 0;
}

return user;
}

Expand Down

0 comments on commit bc51403

Please sign in to comment.