diff options
author | ddomingo <ddomingo@redhat.com> | 2008-10-20 16:30:48 +1000 |
---|---|---|
committer | ddomingo <ddomingo@redhat.com> | 2008-10-20 16:30:48 +1000 |
commit | aacc3f504dc5e52a8c5a30a469e2c8b9bb9986bd (patch) | |
tree | 4c4eafedafff8d56532a22af46c266157f171164 /runtime/staprun | |
parent | 3cb837a1af0ccad4ba335ee6b21e906a3021d198 (diff) | |
parent | b0ff684d5ac5b0ade97a4e508a92a7f743068221 (diff) | |
download | systemtap-steved-aacc3f504dc5e52a8c5a30a469e2c8b9bb9986bd.tar.gz systemtap-steved-aacc3f504dc5e52a8c5a30a469e2c8b9bb9986bd.tar.xz systemtap-steved-aacc3f504dc5e52a8c5a30a469e2c8b9bb9986bd.zip |
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
Diffstat (limited to 'runtime/staprun')
-rw-r--r-- | runtime/staprun/ChangeLog | 4 | ||||
-rw-r--r-- | runtime/staprun/mainloop.c | 12 |
2 files changed, 13 insertions, 3 deletions
diff --git a/runtime/staprun/ChangeLog b/runtime/staprun/ChangeLog index c6d75106..6e8a49f6 100644 --- a/runtime/staprun/ChangeLog +++ b/runtime/staprun/ChangeLog @@ -1,3 +1,7 @@ +2008-10-15 Frank Ch. Eigler <fche@elastic.org> + + * mainloop.c (start_cmd): Fix wordexp error handling. + 2008-09-18 David Smith <dsmith@redhat.com> PR 6903. diff --git a/runtime/staprun/mainloop.c b/runtime/staprun/mainloop.c index 6fc061ae..8db42d7d 100644 --- a/runtime/staprun/mainloop.c +++ b/runtime/staprun/mainloop.c @@ -126,9 +126,15 @@ void start_cmd(void) work well if target_cmd is a shell builtin. We really want to probe a new child process, not a mishmash of shell-interpreted stuff. */ - rc = wordexp (target_cmd, & words, WRDE_NOCMD); - if (rc != 0) { _perr ("wordexp parsing error"); _exit (1); } - if (words.we_wordc < 1) { _perr ("empty target_cmd"); _exit (1); } + rc = wordexp (target_cmd, & words, WRDE_NOCMD|WRDE_UNDEF); + switch (rc) + { + case 0: break; + case WRDE_BADCHAR: _err ("wordexp: invalid shell meta-character in -c COMMAND\n"); _exit(1); + case WRDE_SYNTAX: _err ("wordexp: syntax error (unmatched quotes?) in -c COMMAND\n"); _exit(1); + default: _err ("wordexp: parsing error (%d)\n", rc); _exit (1); + } + if (words.we_wordc < 1) { _err ("empty -c COMMAND"); _exit (1); } rc = ptrace (PTRACE_TRACEME, 0, 0, 0); if (rc < 0) perror ("ptrace me"); |