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 <i@bitbili.net>
PR-URL: #51528
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
bekcpear authored and targos committed May 21, 2024
1 parent 6d8589e commit bb844de
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 bb844de

Please sign in to comment.