diff options
author | Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> | 2024-07-05 11:32:51 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-05 18:32:51 +0000 |
commit | d4d3a3c54f5e26dec0cc79e273dc488f8a47f2b3 (patch) | |
tree | e6ff88b550211257ea7a7997e221d10fdf22e242 /ext/node/polyfills/process.ts | |
parent | 28d2ff7bdc023a3b7aff47503aa03a8dd65fe87f (diff) |
fix(node): Implement `fs.lchown` (and `process.getegid`) (#24418)
Closes https://github.com/denoland/deno/issues/21260.
Part of https://github.com/denoland/deno/issues/18218.
Implements `node:fs.lchown`, and enables the node_compat test for it.
The test uses `process.getegid`, which we didn't have implemented, so I
went ahead and implemented that as well to get the test working.
Diffstat (limited to 'ext/node/polyfills/process.ts')
-rw-r--r-- | ext/node/polyfills/process.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/node/polyfills/process.ts b/ext/node/polyfills/process.ts index 02837f827..de48fea3e 100644 --- a/ext/node/polyfills/process.ts +++ b/ext/node/polyfills/process.ts @@ -7,6 +7,7 @@ import { core, internals } from "ext:core/mod.js"; import { initializeDebugEnv } from "ext:deno_node/internal/util/debuglog.ts"; import { + op_getegid, op_geteuid, op_node_process_kill, op_process_abort, @@ -309,15 +310,16 @@ export function kill(pid: number, sig: string | number = "SIGTERM") { return true; } -let getgid, getuid, geteuid; +let getgid, getuid, getegid, geteuid; if (!isWindows) { getgid = () => Deno.gid(); getuid = () => Deno.uid(); + getegid = () => op_getegid(); geteuid = () => op_geteuid(); } -export { geteuid, getgid, getuid }; +export { getegid, geteuid, getgid, getuid }; const ALLOWED_FLAGS = buildAllowedFlags(); @@ -686,6 +688,9 @@ Process.prototype.getgid = getgid; Process.prototype.getuid = getuid; /** This method is removed on Windows */ +Process.prototype.getegid = getegid; + +/** This method is removed on Windows */ Process.prototype.geteuid = geteuid; // TODO(kt3k): Implement this when we added -e option to node compat mode @@ -726,6 +731,7 @@ Process.prototype.noDeprecation = false; if (isWindows) { delete Process.prototype.getgid; delete Process.prototype.getuid; + delete Process.prototype.getegid; delete Process.prototype.geteuid; } |