According to the login.conf(5), the SHELL variable must contain the value from passwd file, regardless it may be overridden in the login class. The sshd currently missbehaves, it sets the SHELL to the program it actually executes. Fix: --- ssh/session.c.orig2 Sat Dec 7 07:48:46 2002 +++ ssh/session.c Sat Dec 7 07:57:16 2002 @@ -1325,11 +1325,19 @@ * legal, and means /bin/sh. */ shell = (pw->pw_shell[0] == '\0') ? _PATH_BSHELL : pw->pw_shell; + + /* Set up the environment for child */ + env = do_setup_env(s, shell); + + /* + * The shell specifed in login class overrides the shell in passwd, + * but, according to the login.conf(5), the SHELL env variable must + * contain the value from passwd, so we do this *after* setting up + * child's environment. + */ #ifdef HAVE_LOGIN_CAP shell = login_getcapstr(lc, "shell", (char *)shell, (char *)shell); #endif - - env = do_setup_env(s, shell); /* we have to stash the hostname before we close our socket. */ if (options.use_login)
Created attachment 184 [details] The patch got mangled in the original bug report, here is the correct version.
thanks, patch applied.
Mass change of RESOLVED bugs to CLOSED