Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuigi Pinca <luigipinca@gmail.com>2022-03-16 11:46:47 +0300
committerLuigi Pinca <luigipinca@gmail.com>2022-11-05 21:52:50 +0300
commit58431c0e6bb1829b6ccafc5cf6340226c15da790 (patch)
tree2e6a8cd784b1ebba682dfdc77a50c24abd8b51dd
parent3a81b47bd5ab962ff8ded8cdeb0c63bd71aa40c4 (diff)
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>
-rw-r--r--lib/os.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/os.js b/lib/os.js
index 860348a472f..bff7b275810 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;
}