summaryrefslogtreecommitdiff
path: root/nest/password.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2015-02-21 11:39:45 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2015-02-21 11:39:45 +0100
commit7730553b7eeb33d21e5597f110334ca584ad532d (patch)
treec80bf6d48fc91bafd7f0aefc859a033d3b472c89 /nest/password.c
parent0da562a7cb25ed2b8724248ad6f841b1831a09c3 (diff)
parentec2194fa7a20a2768ca0027b5f3c024f0a251866 (diff)
Merge remote-tracking branch 'origin/soft-int'
Diffstat (limited to 'nest/password.c')
-rw-r--r--nest/password.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/nest/password.c b/nest/password.c
index 179939e2..21e42e0e 100644
--- a/nest/password.c
+++ b/nest/password.c
@@ -36,9 +36,18 @@ password_find(list *l, int first_fit)
return pf;
}
-void password_cpy(char *dst, char *src, int size)
+struct password_item *
+password_find_by_id(list *l, int id)
{
- bzero(dst, size);
- memcpy(dst, src, (strlen(src) < (unsigned) size ? strlen(src) : (unsigned) size));
+ struct password_item *pi;
+
+ if (!l)
+ return NULL;
+
+ WALK_LIST(pi, *l)
+ if ((pi->id == id) && (pi->accfrom <= now_real) && (now_real < pi->accto))
+ return pi;
+
+ return NULL;
}