Skip to content

Commit

Permalink
uncomment child_setup_environment
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyf committed Sep 29, 2013
1 parent 227755f commit 1914364
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions wshd.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ char **child_setup_environment(struct passwd *pw) {

envp = env__add(envp, "HOME", pw->pw_dir);
envp = env__add(envp, "USER", pw->pw_name);
envp = env__add(envp, "TERM", "xterm");

if (pw->pw_uid == 0) {
envp = env__add(envp, "PATH", "/sbin:/bin:/usr/sbin:/usr/bin");
Expand Down Expand Up @@ -301,12 +302,11 @@ int child_fork(msg_request_t *req, int in, int out, int err) {
goto error;
}

envp = child_setup_environment(pw);
assert(envp != NULL);

//envp = child_setup_environment(pw);
//assert(envp != NULL);

//execvpe(argv[0], argv, envp);
execvp(argv[0], argv);
execvpe(argv[0], argv, envp);
//execvp(argv[0], argv);
perror("execvpe");

error:
Expand Down

0 comments on commit 1914364

Please sign in to comment.