Enforce permissions on kill(), homeDir() and execPath (#2723)

This commit is contained in:
Nayeem Rahman 2019-08-06 06:45:36 +01:00 committed by Ryan Dahl
parent 046cccfe17
commit 11c850af42
4 changed files with 24 additions and 3 deletions

View file

@ -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();