From c274551db67a3002f12afa127c32509ae194e3e5 Mon Sep 17 00:00:00 2001 From: Tiago Cunha Date: Thu, 3 Sep 2009 20:54:39 +0000 Subject: - Make it compile on operating systems other than BSD due to OpenBSD patchset 308. - While there, remove some duplicate code from the compat header file. --- server-fn.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'server-fn.c') diff --git a/server-fn.c b/server-fn.c index b0ea65ae..2390236b 100644 --- a/server-fn.c +++ b/server-fn.c @@ -1,4 +1,4 @@ -/* $Id: server-fn.c,v 1.84 2009-09-03 20:44:38 tcunha Exp $ */ +/* $Id: server-fn.c,v 1.85 2009-09-03 20:54:39 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -18,7 +18,6 @@ #include -#include #include #include #include @@ -199,7 +198,9 @@ int server_unlock(const char *s) { struct client *c; +#ifdef HAVE_LOGIN_CAP login_cap_t *lc; +#endif u_int i; char *out; u_int failures, tries, backoff; @@ -250,6 +251,7 @@ wrong: * Start slowing down after "login-backoff" attempts and reset every * "login-tries" attempts. */ +#ifdef HAVE_LOGIN_CAP lc = login_getclass(server_locked_pw->pw_class); if (lc != NULL) { tries = login_getcapnum(lc, (char *) "login-tries", 10, 10); @@ -258,6 +260,10 @@ wrong: tries = 10; backoff = 3; } +#else + tries = 10; + backoff = 3; +#endif failures = password_failures % tries; if (failures > backoff) { password_backoff += ((failures - backoff) * tries / 2); -- cgit