Add check of return value of chdir().

pull/267/head
John Safranek 2020-07-08 15:23:26 -07:00
parent fd0711d5c7
commit bd4ebe1a1d
No known key found for this signature in database
GPG Key ID: 8CE817DE0D3CCB4A
1 changed files with 4 additions and 1 deletions

View File

@ -459,7 +459,10 @@ static int shell_worker(thread_ctx_t* threadCtx)
setenv("HOME", p_passwd->pw_dir, 1);
setenv("LOGNAME", p_passwd->pw_name, 1);
chdir(p_passwd->pw_dir);
rc = chdir(p_passwd->pw_dir);
if (rc != 0) {
return WS_FATAL_ERROR;
}
execv("/bin/sh", (char **)args);
}