mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
bd7443ad0a
PR-URL: https://github.com/nodejs-private/node-private/pull/438 Fixes: https://github.com/nodejs-private/node-private/issues/422 CVE-ID: CVE-2023-32558
27 lines
691 B
JavaScript
27 lines
691 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
common.skipIfWorker();
|
|
|
|
if (!common.hasCrypto) {
|
|
common.skip('no crypto');
|
|
}
|
|
|
|
const { spawnSync } = require('child_process');
|
|
const assert = require('assert');
|
|
const fixtures = require('../common/fixtures');
|
|
const file = fixtures.path('permission', 'processbinding.js');
|
|
|
|
// Due to linting rules-utils.js:isBinding check, process.binding() should
|
|
// not be called when --experimental-permission is enabled.
|
|
// Always spawn a child process
|
|
{
|
|
const { status, stderr } = spawnSync(
|
|
process.execPath,
|
|
[
|
|
'--experimental-permission', '--allow-fs-read=*', file,
|
|
],
|
|
);
|
|
assert.strictEqual(status, 0, stderr.toString());
|
|
}
|