version 1.116, 2016/08/13 17:47:41 |
version 1.117, 2016/11/06 05:46:37 |
|
|
struct ssh *ssh = active_state; /* XXX */ |
struct ssh *ssh = active_state; /* XXX */ |
struct stat st; |
struct stat st; |
const char *hostname = NULL, *ipaddr = NULL; |
const char *hostname = NULL, *ipaddr = NULL; |
|
int r; |
u_int i; |
u_int i; |
|
|
/* Shouldn't be called if pw is NULL, but better safe than sorry... */ |
/* Shouldn't be called if pw is NULL, but better safe than sorry... */ |
|
|
/* 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, hostname, ipaddr, |
r = match_user(pw->pw_name, hostname, ipaddr, |
options.deny_users[i])) { |
options.deny_users[i]); |
|
if (r < 0) { |
|
fatal("Invalid DenyUsers pattern \"%.100s\"", |
|
options.deny_users[i]); |
|
} else if (r != 1) { |
logit("User %.100s from %.100s not allowed " |
logit("User %.100s from %.100s not allowed " |
"because listed in DenyUsers", |
"because listed in DenyUsers", |
pw->pw_name, hostname); |
pw->pw_name, hostname); |
|
|
} |
} |
/* 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, hostname, ipaddr, |
r = match_user(pw->pw_name, hostname, ipaddr, |
options.allow_users[i])) |
options.allow_users[i]); |
|
if (r < 0) { |
|
fatal("Invalid AllowUsers pattern \"%.100s\"", |
|
options.allow_users[i]); |
|
} else if (r == 1) |
break; |
break; |
|
} |
/* i < options.num_allow_users iff we break for loop */ |
/* i < options.num_allow_users iff we break for loop */ |
if (i >= options.num_allow_users) { |
if (i >= options.num_allow_users) { |
logit("User %.100s from %.100s not allowed because " |
logit("User %.100s from %.100s not allowed because " |