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);
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()) {
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);