summaryrefslogtreecommitdiff
path: root/auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'auth.c')
-rw-r--r--auth.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/auth.c b/auth.c
index efa7ee28b..eae6a7bdf 100644
--- a/auth.c
+++ b/auth.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: auth.c,v 1.32 2002/01/29 14:32:03 markus Exp $"); 26RCSID("$OpenBSD: auth.c,v 1.33 2002/02/28 19:36:28 stevesk Exp $");
27 27
28#ifdef HAVE_LOGIN_H 28#ifdef HAVE_LOGIN_H
29#include <login.h> 29#include <login.h>
@@ -65,7 +65,6 @@ int
65allowed_user(struct passwd * pw) 65allowed_user(struct passwd * pw)
66{ 66{
67 struct stat st; 67 struct stat st;
68 const char *hostname = NULL, *ipaddr = NULL;
69 char *shell; 68 char *shell;
70 int i; 69 int i;
71#ifdef WITH_AIXAUTHENTICATE 70#ifdef WITH_AIXAUTHENTICATE
@@ -110,22 +109,17 @@ allowed_user(struct passwd * pw)
110 if (!((st.st_mode & S_IFREG) && (st.st_mode & (S_IXOTH|S_IXUSR|S_IXGRP)))) 109 if (!((st.st_mode & S_IFREG) && (st.st_mode & (S_IXOTH|S_IXUSR|S_IXGRP))))
111 return 0; 110 return 0;
112 111
113 if (options.num_deny_users > 0 || options.num_allow_users > 0) {
114 hostname = get_canonical_hostname(options.verify_reverse_mapping);
115 ipaddr = get_remote_ipaddr();
116 }
117
118 /* Return false if user is listed in DenyUsers */ 112 /* Return false if user is listed in DenyUsers */
119 if (options.num_deny_users > 0) { 113 if (options.num_deny_users > 0) {
120 for (i = 0; i < options.num_deny_users; i++) 114 for (i = 0; i < options.num_deny_users; i++)
121 if (match_user(pw->pw_name, hostname, ipaddr, 115 if (match_user(pw->pw_name, options.verify_reverse_mapping,
122 options.deny_users[i])) 116 options.deny_users[i]))
123 return 0; 117 return 0;
124 } 118 }
125 /* Return false if AllowUsers isn't empty and user isn't listed there */ 119 /* Return false if AllowUsers isn't empty and user isn't listed there */
126 if (options.num_allow_users > 0) { 120 if (options.num_allow_users > 0) {
127 for (i = 0; i < options.num_allow_users; i++) 121 for (i = 0; i < options.num_allow_users; i++)
128 if (match_user(pw->pw_name, hostname, ipaddr, 122 if (match_user(pw->pw_name, options.verify_reverse_mapping,
129 options.allow_users[i])) 123 options.allow_users[i]))
130 break; 124 break;
131 /* i < options.num_allow_users iff we break for loop */ 125 /* i < options.num_allow_users iff we break for loop */