mirror of
https://github.com/falcosecurity/falco.git
synced 2025-07-13 06:24:29 +00:00
Merge pull request #111 from draios/update-nodejs-example
Don't run the spawned program in a shell.
This commit is contained in:
commit
03e6c1b3d9
@ -14,8 +14,8 @@ router.get('/', function(req, res) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
router.get('/exec/:cmd', function(req, res) {
|
router.get('/exec/:cmd', function(req, res) {
|
||||||
var output = child_process.execSync(req.params.cmd);
|
var ret = child_process.spawnSync(req.params.cmd);
|
||||||
res.send(output);
|
res.send(ret.stdout);
|
||||||
});
|
});
|
||||||
|
|
||||||
app.use('/api', router);
|
app.use('/api', router);
|
||||||
|
Loading…
Reference in New Issue
Block a user