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 <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
  • Loading branch information
lpinca authored and danielleadams committed Dec 28, 2022
1 parent 437fc8e commit f2d7505
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/os.js
Original file line number Diff line number Diff line change
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 f2d7505

Please sign in to comment.