1 $DragonFly: src/secure/usr.sbin/sshd/Attic/auth2.c.patch,v 1.2 2006/09/28 18:42:50 corecode Exp $
2 --- auth2.c 2006-08-05 04:39:39.000000000 +0200
3 +++ auth2.c 2006-09-28 19:53:14.000000000 +0200
14 char *user, *service, *method, *style = NULL;
15 int authenticated = 0;
16 +#ifdef HAVE_LOGIN_CAP
18 + const char *from_host, *from_ip;
20 + from_host = get_canonical_hostname(options.use_dns);
21 + from_ip = get_remote_ipaddr();
25 fatal("input_userauth_request: no authctxt");
28 authctxt->user, authctxt->service, user, service);
31 +#ifdef HAVE_LOGIN_CAP
32 + if (authctxt->pw != NULL) {
33 + lc = login_getpwclass(authctxt->pw);
35 + lc = login_getclassbyname(NULL, authctxt->pw);
36 + if (!auth_hostok(lc, from_host, from_ip)) {
37 + logit("Denied connection for %.200s from %.200s [%.200s].",
38 + authctxt->pw->pw_name, from_host, from_ip);
39 + packet_disconnect("Sorry, you are not allowed to connect.");
41 + if (!auth_timeok(lc, time(NULL))) {
42 + logit("LOGIN %.200s REFUSED (TIME) FROM %.200s",
43 + authctxt->pw->pw_name, from_host);
44 + packet_disconnect("Logins not available right now.");
49 +#endif /* HAVE_LOGIN_CAP */
52 auth2_challenge_stop(authctxt);