mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 04:39:10 +00:00
Enforce permissions on kill(), homeDir() and execPath (#2723)
This commit is contained in:
parent
046cccfe17
commit
11c850af42
4 changed files with 24 additions and 3 deletions
6
js/os.ts
6
js/os.ts
|
@ -13,7 +13,9 @@ export let pid: number;
|
|||
/** Reflects the NO_COLOR environment variable: https://no-color.org/ */
|
||||
export let noColor: boolean;
|
||||
|
||||
/** Path to the current deno process's executable file. */
|
||||
/** Path to the current deno process's executable file.
|
||||
* Requires the `--allow-env` flag, otherwise it'll be set to an empty `string`.
|
||||
*/
|
||||
export let execPath: string;
|
||||
|
||||
function setGlobals(pid_: number, noColor_: boolean, execPath_: string): void {
|
||||
|
@ -145,7 +147,7 @@ export function start(
|
|||
|
||||
/**
|
||||
* Returns the current user's home directory.
|
||||
* Does not require elevated privileges.
|
||||
* Requires the `--allow-env` flag.
|
||||
*/
|
||||
export function homeDir(): string {
|
||||
const builder = flatbuffers.createBuilder();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue