Skip to content

Commit

Permalink
benchmark: fix api restriction for the permission category
Browse files Browse the repository at this point in the history
give appropriate permissions to the following scripts:

* permission-processhas-fs-read.js: 'ChildProcess' permission
* permission-startup.js: 'FileSystemRead' permission
  > Paths delimited by comma (,) are no longer allowed.

Refs: https://github.com/nodejs/node/blob/main/doc/api/cli.md#--allow-fs-read
Signed-off-by: Ryan Qian <[email protected]>
PR-URL: #51528
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
  • Loading branch information
bekcpear authored and marco-ippolito committed Jul 19, 2024
1 parent d74bda4 commit 65308b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions benchmark/permission/permission-processhas-fs-read.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const options = {
flags: [
'--experimental-permission',
`--allow-fs-read=${rootPath}`,
'--allow-child-process',
],
};

Expand Down
4 changes: 2 additions & 2 deletions benchmark/permission/permission-startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ function spawnProcess(script, bench, state) {

function main({ count, script, nFiles, prefixPath }) {
script = path.resolve(__dirname, '../../', `${script}.js`);
const files = mockFiles(nFiles, prefixPath).join(',');
const optionsWithScript = [
'--experimental-permission',
`--allow-fs-read=${files},${script}`,
`--allow-fs-read=${script}`,
...mockFiles(nFiles, prefixPath).map((file) => '--allow-fs-read=' + file),
script,
];
const warmup = 3;
Expand Down

0 comments on commit 65308b6

Please sign in to comment.