os: convert uid and gid to 32-bit signed integers

Make `os.userInfo()` convert the `uid` and `gid` fields to 32-bit signed
integers on Windows.

PR-URL: https://github.com/nodejs/node/pull/42340
Refs: https://github.com/libuv/libuv/commit/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>
This commit is contained in:
Luigi Pinca authored and RafaelGSS committed 2022-11-10 09:45:35 -03:00
1 parent 9f3d2f6879
commit 2fcf851a91
1 file changed
+5
+5
View File
@@ -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;
}