mirror of
https://github.com/nodejs/node.git
synced 2025-04-29 06:19:07 +00:00

The `execve` syscall does exist on IBM i but it has caveats that make it not usable in Node.js context. These changes disable building with `execve` like Windows does. PR-URL: https://github.com/nodejs/node/pull/57883 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it>
22 lines
689 B
JavaScript
22 lines
689 B
JavaScript
// Flags: --permission --allow-fs-read=*
|
|
|
|
'use strict';
|
|
|
|
const { mustCall, skip, isWindows, isIBMi } = require('../common');
|
|
const { fail, throws } = require('assert');
|
|
const { isMainThread } = require('worker_threads');
|
|
|
|
if (!isMainThread) {
|
|
skip('process.execve is not available in Workers');
|
|
} else if (isWindows || isIBMi) {
|
|
skip('process.execve is not available in Windows or IBM i');
|
|
}
|
|
|
|
if (process.argv[2] === 'replaced') {
|
|
fail('process.execve should not have been allowed.');
|
|
} else {
|
|
throws(mustCall(() => {
|
|
process.execve(process.execPath, [process.execPath, __filename, 'replaced'], process.env);
|
|
}), { code: 'ERR_ACCESS_DENIED', permission: 'ChildProcess' });
|
|
}
|