running commands as a uid with no password entry.
set_loginclass(sudo_user.pw);
/* Update initial shell now that runas is set. */
- if (ISSET(sudo_mode, MODE_LOGIN_SHELL))
+ if (ISSET(sudo_mode, MODE_LOGIN_SHELL)) {
+ if (runas_pw->pw_shell == NULL)
+ errorx(1, "no login shell for user %s!", runas_pw->pw_name);
NewArgv[0] = runas_pw->pw_shell;
+ }
/* This goes after sudoers is parsed since it may have timestamp options. */
if (sudo_mode == MODE_KILL || sudo_mode == MODE_INVALIDATE) {