]> git.ipfire.org Git - thirdparty/bird.git/blob - nest/password.c
Bugfix in simple authentification.
[thirdparty/bird.git] / nest / password.c
1 /*
2 * BIRD -- Password handling
3 *
4 * (c) 1999 Pavel Machek <pavel@ucw.cz>
5 * (c) 2004 Ondrej Filip <feela@network.cz>
6 *
7 * Can be freely distributed and used under the terms of the GNU GPL.
8 */
9
10 #include "nest/bird.h"
11 #include "nest/password.h"
12 #include "lib/string.h"
13
14 struct password_item *last_password_item = NULL;
15
16 struct password_item *
17 password_find(list *l)
18 {
19 struct password_item *pi;
20
21 if (l)
22 {
23 WALK_LIST(pi, *l)
24 {
25 if ((pi->genfrom < now) && (pi->gento > now))
26 return pi;
27 }
28 }
29 return NULL;
30 }
31
32 void password_cpy(char *dst, char *src, int size)
33 {
34 bzero(dst, size);
35 memcpy(dst, src, (strlen(src) < (unsigned) size ? strlen(src) : (unsigned) size));
36 }
37