From f45346d608f67b224b1396e98b21c4fd8eca6f17 Mon Sep 17 00:00:00 2001 From: leitner Date: Sun, 9 Sep 2018 10:42:43 +0000 Subject: [PATCH] remove debug printf from acl add return value comment to ldap.h actually double-check index "maybe" hits in lookupdn --- ldap.h | 1 + tinyldap.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ldap.h b/ldap.h index 17c3852..96fc5c0 100644 --- a/ldap.h +++ b/ldap.h @@ -5,6 +5,7 @@ #include #include "asn1.h" +/* return zero if same, otherwise nonzero */ int matchstring(struct string* s,const char* c); int matchcasestring(struct string* s,const char* c); int matchprefix(struct string* s,const char* c); diff --git a/tinyldap.c b/tinyldap.c index e77174c..c0b91cf 100644 --- a/tinyldap.c +++ b/tinyldap.c @@ -1431,8 +1431,14 @@ static int lookupdn(struct string* dn,size_t* index, struct hashnode** hn) { } for (; i<=result.last; ++i) { if (isset(&result,i)) { - *index=i; - return 1; + uint32 j; + uint32_unpack(map+indices_offset+4*i,&j); + uint32 k; + uint32_unpack(map+j+8,&k); + if (!matchstring(dn,map+k)) { + *index=i; + return 1; + } } } }