=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/auth.c,v retrieving revision 1.6 retrieving revision 1.6.2.2 diff -u -r1.6 -r1.6.2.2 --- src/usr.bin/ssh/auth.c 2000/04/26 21:28:31 1.6 +++ src/usr.bin/ssh/auth.c 2000/09/01 18:23:17 1.6.2.2 @@ -5,7 +5,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth.c,v 1.6 2000/04/26 21:28:31 markus Exp $"); +RCSID("$OpenBSD: auth.c,v 1.6.2.2 2000/09/01 18:23:17 jason Exp $"); #include "xmalloc.h" #include "rsa.h" @@ -24,9 +24,7 @@ #include "ssh2.h" #include "auth.h" #include "session.h" -#include "dispatch.h" - /* import */ extern ServerOptions options; extern char *forced_command; @@ -45,14 +43,21 @@ { struct stat st; struct group *grp; + char *shell; int i; /* Shouldn't be called if pw is NULL, but better safe than sorry... */ if (!pw) return 0; + /* + * Get the shell from the password data. An empty shell field is + * legal, and means /bin/sh. + */ + shell = (pw->pw_shell[0] == '\0') ? _PATH_BSHELL : pw->pw_shell; + /* deny if shell does not exists or is not executable */ - if (stat(pw->pw_shell, &st) != 0) + if (stat(shell, &st) != 0) return 0; if (!((st.st_mode & S_IFREG) && (st.st_mode & (S_IXOTH|S_IXUSR|S_IXGRP)))) return 0;