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 RafaelGSS committed Nov 10, 2022
1 parent 9f3d2f6 commit 2fcf851
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 2fcf851

Please sign in to comment.