mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00

This commit automatically includes in the allow-fs-read list all the app's entrypoints. `--require` and user entry point Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com> PR-URL: https://github.com/nodejs/node/pull/58579 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
15 lines
No EOL
448 B
JavaScript
15 lines
No EOL
448 B
JavaScript
const fs = require('node:fs')
|
|
const path = require('node:path')
|
|
const assert = require('node:assert');
|
|
|
|
{
|
|
fs.readFileSync(__filename);
|
|
console.log('Read its own contents') // Should not throw
|
|
}
|
|
{
|
|
const simpleLoaderPath = path.join(__dirname, 'simple-loader.js');
|
|
fs.readFile(simpleLoaderPath, (err) => {
|
|
assert.ok(err.code, 'ERR_ACCESS_DENIED');
|
|
assert.ok(err.permission, 'FileSystemRead');
|
|
}); // Should throw ERR_ACCESS_DENIED
|
|
} |