Skip to content

Commit

Permalink
explicitly specify pathname to "env" and "echo" for very
Browse files Browse the repository at this point in the history
primative shell with no PATH set
  • Loading branch information
Moe Jette committed Dec 21, 2007
1 parent 74dcb73 commit ecfc804
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/env.c
Expand Up @@ -1315,7 +1315,7 @@ char **env_array_user_default(const char *username, int timeout, int mode)
close(2);
open("/dev/null", O_WRONLY);
snprintf(cmdstr, sizeof(cmdstr),
"echo; echo; echo; echo %s; env; echo %s",
"/bin/echo; /bin/echo; /bin/echo; /bin/echo %s; /bin/env; /bin/echo %s",
starttoken, stoptoken);
if (mode == 1)
execl("/bin/su", "su", username, "-c", cmdstr, NULL);
Expand Down

0 comments on commit ecfc804

Please sign in to comment.