diff options
author | Tiago Cunha <tcunha@gmx.com> | 2009-09-03 20:54:39 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2009-09-03 20:54:39 +0000 |
commit | c274551db67a3002f12afa127c32509ae194e3e5 (patch) | |
tree | 30c706b4b15bcc46c057cd44129c7416a9c2a8c4 /server-fn.c | |
parent | f796336a12e2d3c487a53854fdf28c096481a34a (diff) | |
download | rtmux-c274551db67a3002f12afa127c32509ae194e3e5.tar.gz rtmux-c274551db67a3002f12afa127c32509ae194e3e5.tar.bz2 rtmux-c274551db67a3002f12afa127c32509ae194e3e5.zip |
- 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.
Diffstat (limited to 'server-fn.c')
-rw-r--r-- | server-fn.c | 10 |
1 files changed, 8 insertions, 2 deletions
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 <nicm@users.sourceforge.net> @@ -18,7 +18,6 @@ #include <sys/types.h> -#include <login_cap.h> #include <pwd.h> #include <string.h> #include <time.h> @@ -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); |