From bc5140383c8d05ee1c48222f189368783d436858 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Wed, 16 Mar 2022 09:46:47 +0100 Subject: [PATCH] os: convert uid and gid to 32-bit signed integers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Juan José Arboleda Reviewed-By: Yagiz Nizipli Reviewed-By: Darshan Sen Reviewed-By: Antoine du Hamel --- lib/os.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/os.js b/lib/os.js index 860348a472f325..bff7b275810a4a 100644 --- a/lib/os.js +++ b/lib/os.js @@ -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; }