projects
/
mmh
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2433122
)
Don't do a shell `exec' on mhshow-show-* contents to make `foo; bar' possible.
author
markus schnalke
<meillo@marmaro.de>
Sat, 14 Apr 2012 15:52:51 +0000
(17:52 +0200)
committer
markus schnalke
<meillo@marmaro.de>
Sat, 14 Apr 2012 15:52:51 +0000
(17:52 +0200)
uip/mhshowsbr.c
patch
|
blob
|
history
diff --git
a/uip/mhshowsbr.c
b/uip/mhshowsbr.c
index
fe3afc4
..
e2cde4d
100644
(file)
--- a/
uip/mhshowsbr.c
+++ b/
uip/mhshowsbr.c
@@
-468,7
+468,6
@@
show_content_aux2(CT ct, int alternate, char *cracked,
char *buffer, int fd, int xlist, int xstdin, int xtty)
{
pid_t child_id;
char *buffer, int fd, int xlist, int xstdin, int xtty)
{
pid_t child_id;
- char *vec[4], exec[BUFSIZ + sizeof "exec "];
if (debugsw || cracked) {
fflush(stdout);
if (debugsw || cracked) {
fflush(stdout);
@@
-498,13
+497,6
@@
show_content_aux2(CT ct, int alternate, char *cracked,
list_switch(ct, -1, 1, 0, 0);
}
list_switch(ct, -1, 1, 0, 0);
}
- snprintf(exec, sizeof(exec), "exec %s", buffer);
-
- vec[0] = "/bin/sh";
- vec[1] = "-c";
- vec[2] = exec;
- vec[3] = NULL;
-
fflush(stdout);
switch (child_id = fork()) {
fflush(stdout);
switch (child_id = fork()) {
@@
-519,7
+511,7
@@
show_content_aux2(CT ct, int alternate, char *cracked,
if (!xstdin)
dup2(fd, 0);
close(fd);
if (!xstdin)
dup2(fd, 0);
close(fd);
- execvp("/bin/sh", vec);
+ execlp("/bin/sh", "/bin/sh", "-c", buffer, NULL);
fprintf(stderr, "unable to exec ");
perror("/bin/sh");
_exit(-1);
fprintf(stderr, "unable to exec ");
perror("/bin/sh");
_exit(-1);