}
{
- const tmpPath = path.resolve('/tmp/');
+ const tmpPath = path.resolve('./tmp/');
const { status, stdout } = spawnSync(
process.execPath,
[
`console.log(process.permission.has("fs"));
console.log(process.permission.has("fs.read"));
console.log(process.permission.has("fs.write"));
- console.log(process.permission.has("fs.write", "/tmp/"));`,
+ console.log(process.permission.has("fs.write", "./tmp/"));`,
]
);
const [fs, fsIn, fsOut, fsOutAllowed] = stdout.toString().split('\n');
if (firstPath.startsWith('/etc')) {
common.skip('/etc as firstPath');
}
+ if (firstPath.startsWith('/tmp')) {
+ common.skip('/tmp as firstPath');
+ }
const file = fixtures.path('permission', 'loader', 'index.js');
const { status, stderr } = spawnSync(
process.execPath,
const path = require('path');
{
- const tmpPath = path.resolve('/tmp/');
- const otherPath = path.resolve('/other-path/');
+ const tmpPath = path.resolve('./tmp/');
+ const otherPath = path.resolve('./other-path/');
const { status, stdout } = spawnSync(
process.execPath,
[
`console.log(process.permission.has("fs"));
console.log(process.permission.has("fs.read"));
console.log(process.permission.has("fs.write"));
- console.log(process.permission.has("fs.write", "/tmp/"));
- console.log(process.permission.has("fs.write", "/other-path/"));`,
+ console.log(process.permission.has("fs.write", "./tmp/"));
+ console.log(process.permission.has("fs.write", "./other-path/"));`,
]
);
const [fs, fsIn, fsOut, fsOutAllowed1, fsOutAllowed2] = stdout.toString().split('\n');
}
{
- const tmpPath = path.resolve('/tmp/');
- const pathWithComma = path.resolve('/other,path/');
+ const tmpPath = path.resolve('./tmp/');
+ const pathWithComma = path.resolve('./other,path/');
const { status, stdout } = spawnSync(
process.execPath,
[
`console.log(process.permission.has("fs"));
console.log(process.permission.has("fs.read"));
console.log(process.permission.has("fs.write"));
- console.log(process.permission.has("fs.write", "/tmp/"));
- console.log(process.permission.has("fs.write", "/other,path/"));`,
+ console.log(process.permission.has("fs.write", "./tmp/"));
+ console.log(process.permission.has("fs.write", "./other,path/"));`,
]
);
const [fs, fsIn, fsOut, fsOutAllowed1, fsOutAllowed2] = stdout.toString().split('\n');
}
{
- const filePath = path.resolve('/tmp/file,with,comma.txt');
+ const filePath = path.resolve('./tmp/file,with,comma.txt');
const { status, stdout, stderr } = spawnSync(
process.execPath,
[
`console.log(process.permission.has("fs"));
console.log(process.permission.has("fs.read"));
console.log(process.permission.has("fs.write"));
- console.log(process.permission.has("fs.write", "/tmp/file,with,comma.txt"));`,
+ console.log(process.permission.has("fs.write", "./tmp/file,with,comma.txt"));`,
]
);
const [fs, fsIn, fsOut, fsOutAllowed] = stdout.toString().split('\n');