version 1.34, 2002/02/28 20:56:00 |
version 1.35, 2002/03/01 13:12:10 |
|
|
allowed_user(struct passwd * pw) |
allowed_user(struct passwd * pw) |
{ |
{ |
struct stat st; |
struct stat st; |
|
const char *hostname = NULL, *ipaddr = NULL; |
char *shell; |
char *shell; |
int i; |
int i; |
|
|
|
|
return 0; |
return 0; |
} |
} |
|
|
|
if (options.num_deny_users > 0 || options.num_allow_users > 0) { |
|
hostname = get_canonical_hostname(options.verify_reverse_mapping); |
|
ipaddr = get_remote_ipaddr(); |
|
} |
|
|
/* Return false if user is listed in DenyUsers */ |
/* Return false if user is listed in DenyUsers */ |
if (options.num_deny_users > 0) { |
if (options.num_deny_users > 0) { |
for (i = 0; i < options.num_deny_users; i++) |
for (i = 0; i < options.num_deny_users; i++) |
if (match_user(pw->pw_name, options.verify_reverse_mapping, |
if (match_user(pw->pw_name, hostname, ipaddr, |
options.deny_users[i])) { |
options.deny_users[i])) { |
log("User %.100s not allowed because listed in DenyUsers", |
log("User %.100s not allowed because listed in DenyUsers", |
pw->pw_name); |
pw->pw_name); |
|
|
/* Return false if AllowUsers isn't empty and user isn't listed there */ |
/* Return false if AllowUsers isn't empty and user isn't listed there */ |
if (options.num_allow_users > 0) { |
if (options.num_allow_users > 0) { |
for (i = 0; i < options.num_allow_users; i++) |
for (i = 0; i < options.num_allow_users; i++) |
if (match_user(pw->pw_name, options.verify_reverse_mapping, |
if (match_user(pw->pw_name, hostname, ipaddr, |
options.allow_users[i])) |
options.allow_users[i])) |
break; |
break; |
/* i < options.num_allow_users iff we break for loop */ |
/* i < options.num_allow_users iff we break for loop */ |