summaryrefslogtreecommitdiffstats
path: root/crypto/openssh/auth.c
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2000-06-03 09:52:37 +0000
committerkris <kris@FreeBSD.org>2000-06-03 09:52:37 +0000
commit3639dd9acea182e29b2d59915fbb97029217d9b2 (patch)
tree2b0a0dae36e62d807780aa047b690ffacb266b19 /crypto/openssh/auth.c
parent585dc667de870922b14ce5a99c088c1a68de7934 (diff)
downloadFreeBSD-src-3639dd9acea182e29b2d59915fbb97029217d9b2.zip
FreeBSD-src-3639dd9acea182e29b2d59915fbb97029217d9b2.tar.gz
Initial import of OpenSSH snapshot from 2000/05/30
Obtained from: OpenBSD
Diffstat (limited to 'crypto/openssh/auth.c')
-rw-r--r--crypto/openssh/auth.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/crypto/openssh/auth.c b/crypto/openssh/auth.c
index d3425a2..20e9760 100644
--- a/crypto/openssh/auth.c
+++ b/crypto/openssh/auth.c
@@ -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.7 2000/05/17 21:37:24 deraadt Exp $");
#include "xmalloc.h"
#include "rsa.h"
@@ -45,14 +45,21 @@ allowed_user(struct passwd * pw)
{
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;
OpenPOWER on IntegriCloud