mirror of https://github.com/nodejs/node.git
lib: don't check for `/` on windows
This commit is contained in:
parent
da71410bbb
commit
4d24405f45
|
@ -44,6 +44,8 @@ const {
|
|||
},
|
||||
} = require('internal/v8/startup_snapshot');
|
||||
|
||||
const isWindows = process.platform === 'win32';
|
||||
|
||||
function prepareMainThreadExecution(expandArgv1 = false, initializeModules = true) {
|
||||
return prepareExecution({
|
||||
expandArgv1,
|
||||
|
@ -555,14 +557,14 @@ function initializePermission() {
|
|||
}
|
||||
}
|
||||
const fsReadValue = getOptionValue('--allow-fs-read');
|
||||
if (fsReadValue.length === 1 && (fsReadValue[0] === '*' || fsReadValue[0] === '/')) {
|
||||
if (fsReadValue.length === 1 && (fsReadValue[0] === '*' || (!isWindows && fsReadValue[0] === '/'))) {
|
||||
process.emitWarning(
|
||||
'Granting all to --allow-fs-read leaks all sensitive info on the host machine.',
|
||||
'SecurityWarning'
|
||||
);
|
||||
}
|
||||
const fsWriteValue = getOptionValue('--allow-fs-write');
|
||||
if (fsWriteValue.length === 1 && (fsWriteValue[0] === '*' || fsWriteValue[0] === '/')) {
|
||||
if (fsWriteValue.length === 1 && (fsWriteValue[0] === '*' || (!isWindows && fsWriteValue[0] === '/'))) {
|
||||
process.emitWarning(
|
||||
'Granting all to --allow-fs-write will invalidate the permission model. ' +
|
||||
'Documentation can be found at ' +
|
||||
|
|
Loading…
Reference in New Issue