=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/auth.c,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -r1.6 -r1.6.2.1 --- src/usr.bin/ssh/auth.c 2000/04/26 21:28:31 1.6 +++ src/usr.bin/ssh/auth.c 2000/06/12 02:37:31 1.6.2.1 @@ -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.1 2000/06/12 02:37:31 jason Exp $"); #include "xmalloc.h" #include "rsa.h" @@ -45,14 +45,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;