[patch] enhance quoting for command string
Martin Hunt
hunt@redhat.com
Mon Aug 20 19:50:00 GMT 2007
On Thu, 2007-08-16 at 11:48 -0400, Frank Ch. Eigler wrote:
I have committed the patch.
> Let's put it this way. It is important to pass this data verbatim (or
> at worst, reject questionable inputs). How about a testsuite addition
> that confirms this from end to end?
Checked in. See systemtap.base/cmd_parse.exp.
> I would be happier if there were stress tests, and if there were fewer
> calls to system(). I'm happy to see that staprun already uses execl
> to run the commands passed from the tapset system() function.
I guess we are not talking about the same thing? I thought when you
objected to using system() instead of exec() you meant running the
commands directly instead of in a shell, like system() does. Commands
run from the tapset system function are handled in the same way as
commands sent with "-c". Both use
Here's one
if (execl("/bin/sh", "sh", "-c", target_cmd, NULL) < 0)
and the other
if (execl("/bin/sh", "sh", "-c", cmd, NULL) < 0)
Internally this is exactly what system() does. However we could never
use system() because system() waits for the process to complete before
returning.
Martin
More information about the Systemtap
mailing list