src: whitelist new options for NODE_OPTIONS

Add --inspect-*, --napi-modules, --trace-event-categories

Remove --prof-process, like -p and -e, it causes node to do something
other than run node js scripts.

PR-URL: https://github.com/nodejs/node/pull/13002
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
This commit is contained in:
Sam Roberts 2017-05-12 12:39:11 -07:00
parent 6342988053
commit d6cd466a25
2 changed files with 14 additions and 6 deletions

View File

@ -411,14 +411,18 @@ Node options that are allowed are:
- `--enable-fips` - `--enable-fips`
- `--force-fips` - `--force-fips`
- `--icu-data-dir` - `--icu-data-dir`
- `--inspect-brk`
- `--inspect-port`
- `--inspect`
- `--napi-modules`
- `--no-deprecation` - `--no-deprecation`
- `--no-warnings` - `--no-warnings`
- `--openssl-config` - `--openssl-config`
- `--prof-process`
- `--redirect-warnings` - `--redirect-warnings`
- `--require`, `-r` - `--require`, `-r`
- `--throw-deprecation` - `--throw-deprecation`
- `--trace-deprecation` - `--trace-deprecation`
- `--trace-events-categories`
- `--trace-events-enabled` - `--trace-events-enabled`
- `--trace-sync-io` - `--trace-sync-io`
- `--trace-warnings` - `--trace-warnings`

View File

@ -3703,25 +3703,29 @@ static void CheckIfAllowedInEnv(const char* exe, bool is_env,
static const char* whitelist[] = { static const char* whitelist[] = {
// Node options // Node options
"-r", "--require", "--require", "-r",
"--inspect",
"--inspect-brk",
"--inspect-port",
"--no-deprecation", "--no-deprecation",
"--trace-deprecation",
"--throw-deprecation",
"--no-warnings", "--no-warnings",
"--napi-modules",
"--trace-warnings", "--trace-warnings",
"--redirect-warnings", "--redirect-warnings",
"--trace-deprecation",
"--trace-sync-io", "--trace-sync-io",
"--trace-events-enabled", "--trace-events-enabled",
"--trace-events-categories",
"--track-heap-objects", "--track-heap-objects",
"--throw-deprecation",
"--zero-fill-buffers", "--zero-fill-buffers",
"--v8-pool-size", "--v8-pool-size",
"--use-openssl-ca",
"--use-bundled-ca", "--use-bundled-ca",
"--use-openssl-ca",
"--enable-fips", "--enable-fips",
"--force-fips", "--force-fips",
"--openssl-config", "--openssl-config",
"--icu-data-dir", "--icu-data-dir",
"--napi-modules",
// V8 options // V8 options
"--max_old_space_size", "--max_old_space_size",