execFile()
命令是否安全?
例子:
const process = await execFile(
'somecommand',
['--password', passwordFromUser, '--username', userName],
);
我知道这不使用 shell (
sh
) 来执行命令,而是在引擎盖下使用 execve(2)
。但是提供的密码可以在某种历史表或类似的东西中看到吗?我想避免的是其他人仍然可以以某种方式在 Linux 中看到该密码。
在可能的情况下通过
options.env
对象传递密码是否更安全?