diff options
Diffstat (limited to 'auth.c')
-rw-r--r-- | auth.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | RCSID("$OpenBSD: auth.c,v 1.19 2001/03/02 18:54:31 deraadt Exp $"); | 26 | RCSID("$OpenBSD: auth.c,v 1.20 2001/03/17 17:27:59 markus Exp $"); |
27 | 27 | ||
28 | #ifdef HAVE_LOGIN_H | 28 | #ifdef HAVE_LOGIN_H |
29 | #include <login.h> | 29 | #include <login.h> |
@@ -57,7 +57,7 @@ int | |||
57 | allowed_user(struct passwd * pw) | 57 | allowed_user(struct passwd * pw) |
58 | { | 58 | { |
59 | struct stat st; | 59 | struct stat st; |
60 | char *shell; | 60 | char *shell, *cp; |
61 | int i; | 61 | int i; |
62 | #ifdef WITH_AIXAUTHENTICATE | 62 | #ifdef WITH_AIXAUTHENTICATE |
63 | char *loginmsg; | 63 | char *loginmsg; |
@@ -95,6 +95,15 @@ allowed_user(struct passwd * pw) | |||
95 | */ | 95 | */ |
96 | shell = (pw->pw_shell[0] == '\0') ? _PATH_BSHELL : pw->pw_shell; | 96 | shell = (pw->pw_shell[0] == '\0') ? _PATH_BSHELL : pw->pw_shell; |
97 | 97 | ||
98 | /* disallow anyone who does not have a standard shell */ | ||
99 | setusershell(); | ||
100 | while ((cp = getusershell()) != NULL) | ||
101 | if (strcmp(cp, shell) == 0) | ||
102 | break; | ||
103 | endusershell(); | ||
104 | if (cp == NULL) | ||
105 | return 0; | ||
106 | |||
98 | /* deny if shell does not exists or is not executable */ | 107 | /* deny if shell does not exists or is not executable */ |
99 | if (stat(shell, &st) != 0) | 108 | if (stat(shell, &st) != 0) |
100 | return 0; | 109 | return 0; |