version 1.77, 2007/08/23 02:55:51 |
version 1.78, 2007/09/21 08:15:29 |
|
|
getpwnamallow(const char *user) |
getpwnamallow(const char *user) |
{ |
{ |
extern login_cap_t *lc; |
extern login_cap_t *lc; |
#ifdef BSD_AUTH |
|
auth_session_t *as; |
auth_session_t *as; |
#endif |
|
struct passwd *pw; |
struct passwd *pw; |
|
|
parse_server_match_config(&options, user, |
parse_server_match_config(&options, user, |
|
|
debug("unable to get login class: %s", user); |
debug("unable to get login class: %s", user); |
return (NULL); |
return (NULL); |
} |
} |
#ifdef BSD_AUTH |
|
if ((as = auth_open()) == NULL || auth_setpwd(as, pw) != 0 || |
if ((as = auth_open()) == NULL || auth_setpwd(as, pw) != 0 || |
auth_approval(as, lc, pw->pw_name, "ssh") <= 0) { |
auth_approval(as, lc, pw->pw_name, "ssh") <= 0) { |
debug("Approval failure for %s", user); |
debug("Approval failure for %s", user); |
|
|
} |
} |
if (as != NULL) |
if (as != NULL) |
auth_close(as); |
auth_close(as); |
#endif |
|
if (pw != NULL) |
if (pw != NULL) |
return (pwcopy(pw)); |
return (pwcopy(pw)); |
return (NULL); |
return (NULL); |