Fix a crash introduced in 1.9.4 when running "sudo -i" as an unknown user.
This commit is contained in:
@@ -669,7 +669,7 @@ sudoers_to_eventlog(struct eventlog *evlog, char * const argv[],
|
||||
}
|
||||
if (def_runcwd && strcmp(def_runcwd, "*") != 0) {
|
||||
evlog->runcwd = def_runcwd;
|
||||
} else if (ISSET(sudo_mode, MODE_LOGIN_SHELL)) {
|
||||
} else if (ISSET(sudo_mode, MODE_LOGIN_SHELL) && runas_pw != NULL) {
|
||||
evlog->runcwd = runas_pw->pw_dir;
|
||||
} else {
|
||||
evlog->runcwd = user_cwd;
|
||||
|
Reference in New Issue
Block a user