in reply to Re: Extending a perl program with Scheme, Lua, or JS
in thread Extending a perl program with Scheme, Lua, or JS
Another possible option that comes to my mind is to shell out to the bc Unix or Linux utility. bc can be used in non-interactive mode in various ways, including piping (echo "42/7" | bc), shell redirections, and Un*x heredocs.
How to make things even worse. I smell shell injection: "Dear script, please evaluate 1 + $(rm -rf /) or 1 + ";rm -rf /;echo " for me." (echo "1 + $(rm -rf /)" | bc resp. echo "1 + ";rm -rf /;echo "" | bc) Shelling out ain't that easy if you want to do it right: The problem of "the" default shell
And even if you shell out safely, the program you feed the input into may have security issues. See Morris_worm for a really old example, or CVE-2012-1165 for a younger one.
Alexander
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Extending a perl program with Scheme, Lua, or JS
by Laurent_R (Canon) on Feb 08, 2019 at 08:35 UTC | |
|
Re^3: Extending a perl program with Scheme, Lua, or JS
by bcrowell2 (Friar) on Feb 09, 2019 at 20:17 UTC | |
by hippo (Archbishop) on Feb 10, 2019 at 11:57 UTC | |
by bcrowell2 (Friar) on Feb 10, 2019 at 20:44 UTC | |
by haukex (Archbishop) on Feb 10, 2019 at 22:03 UTC | |
by Anonymous Monk on Feb 10, 2019 at 13:25 UTC |