diff options
author | Bradley Farias <bradley.meck@gmail.com> | 2019-01-23 16:21:46 -0600 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2019-01-29 08:08:50 +0100 |
commit | 78982389ce9265f5f65cd9e8a192e05389506927 (patch) | |
tree | eb20a408615edbc768ed025470c30e6ef5927f4e /lib/internal/worker.js | |
parent | d4d76b6be07841e4416fc5ab1445b73638fcea6a (diff) | |
download | android-node-v8-78982389ce9265f5f65cd9e8a192e05389506927.tar.gz android-node-v8-78982389ce9265f5f65cd9e8a192e05389506927.tar.bz2 android-node-v8-78982389ce9265f5f65cd9e8a192e05389506927.zip |
policy: ensure workers do not read fs for policy
This prevents a main thread from rewriting the policy file and loading
a worker that has a different policy from the main thread.
PR-URL: https://github.com/nodejs/node/pull/25710
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'lib/internal/worker.js')
-rw-r--r-- | lib/internal/worker.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/internal/worker.js b/lib/internal/worker.js index e20a37af8a..1640a9dd88 100644 --- a/lib/internal/worker.js +++ b/lib/internal/worker.js @@ -12,6 +12,7 @@ const { ERR_INVALID_ARG_TYPE, } = require('internal/errors').codes; const { validateString } = require('internal/validators'); +const { getOptionValue } = require('internal/options'); const { drainMessagePort, @@ -112,6 +113,9 @@ class Worker extends EventEmitter { doEval: !!options.eval, workerData: options.workerData, publicPort: port2, + manifestSrc: getOptionValue('--experimental-policy') ? + require('internal/process/policy').src : + null, hasStdin: !!options.stdin }, [port2]); // Actually start the new thread now that everything is in place. |