From 6ed206616dae58d01848ba74420f32fe5f4c4a7f Mon Sep 17 00:00:00 2001 From: leitner Date: Mon, 13 Jun 2005 01:10:44 +0000 Subject: [PATCH] fix stupid bug in ldapclient that caused entries to be printed twice --- ldapclient.c | 9 +++++---- scan_ldapsearchfilterstring.c | 1 + tinyldap.c | 17 +++++++++++++---- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/ldapclient.c b/ldapclient.c index 543456e..cb0ba77 100644 --- a/ldapclient.c +++ b/ldapclient.c @@ -161,8 +161,10 @@ nextmessage: } buffer_putsflush(buffer_1,"\n"); free_ldapsearchresultentry(&sre); - } else + } else { + buffer_putsflush(buffer_2,"goto\n"); goto copypartialandcontinue; + } } else if (op==SearchResultDone) { if (!matches) buffer_putsflush(buffer_2,"no matches.\n"); @@ -174,15 +176,14 @@ nextmessage: if (maxava.value.s=s; s+=(*f)->ava.value.l=str_chr(s,')'); } diff --git a/tinyldap.c b/tinyldap.c index 1ce574b..062ea54 100644 --- a/tinyldap.c +++ b/tinyldap.c @@ -193,6 +193,8 @@ static int indexable(struct Filter* f) { if (f->substrings->substrtype!=prefix) return 0; /* fall through */ case EQUAL: + case LESSEQUAL: + case GREATEQUAL: { uint32 ofs; for (ofs=indices_offset+record_count*4; ofs<(unsigned long)filelen;) { @@ -510,16 +512,18 @@ static void answerwith(uint32 ofs,struct SearchRequest* sr,long messageid,int ou if (!adl) { /* did not ask for any attributes. send 'em all. */ /* to do that, construct a list of all attributes */ + + /* FIXME! This adl appears to create a segfault later on */ uint32 i; char* x=map+5*4+size_of_string_table+4; - adl=alloca((attribute_count-1)*sizeof(struct AttributeDescriptionList)); + adl=alloca((attribute_count)*sizeof(struct AttributeDescriptionList)); for (i=0; irecord_count) ni=record_count; + for (; i