1 $DragonFly: src/secure/usr.sbin/sshd/Attic/auth2.c.patch,v 1.1 2004/07/31 20:05:00 geekgod Exp $
2 --- auth2.c.orig 2004-07-23 14:26:51.000000000 +0200
3 +++ auth2.c 2004-07-23 14:20:00.000000000 +0200
6 RCSID("$OpenBSD: auth2.c,v 1.104 2003/11/04 08:54:09 djm Exp $");
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);