Thomas Walpuski:
fix search requests with sizelimit fix scan_ldapaddrequest
This commit is contained in:
@@ -63,12 +63,12 @@ unsigned int scan_ldapaddrequest(const char* src,const char* max,struct AddReque
|
||||
if (ilast) {
|
||||
struct AttributeDescriptionList* x;
|
||||
if (!(x=malloc(sizeof(struct AttributeDescriptionList)))) goto error;
|
||||
x->next=0;
|
||||
ilast->next=x;
|
||||
ilast = ilast->next;
|
||||
} else {
|
||||
ilast=&last->vals;
|
||||
}
|
||||
ilast->next=0;
|
||||
if (!(tmp=scan_ldapstring(src+res,max,&ilast->a)))
|
||||
goto error;
|
||||
res+=tmp;
|
||||
|
||||
@@ -1152,7 +1152,7 @@ found:
|
||||
uint32 j;
|
||||
uint32_unpack(map+indices_offset+4*i,&j);
|
||||
if (ldap_match_mapped(j,&sr)) {
|
||||
if (sr.sizeLimit && sr.sizeLimit>++returned)
|
||||
if (sr.sizeLimit && sr.sizeLimit<=++returned)
|
||||
break;
|
||||
answerwith(j,&sr,messageid,out);
|
||||
}
|
||||
@@ -1169,7 +1169,7 @@ found:
|
||||
uint32 j;
|
||||
uint32_unpack(x,&j);
|
||||
if (ldap_match_mapped(x-map,&sr)) {
|
||||
if (sr.sizeLimit && sr.sizeLimit>++returned)
|
||||
if (sr.sizeLimit && sr.sizeLimit<=++returned)
|
||||
break;
|
||||
answerwith(x-map,&sr,messageid,out);
|
||||
}
|
||||
@@ -1235,7 +1235,6 @@ found:
|
||||
// buffer_putsflush(buffer_2,"AddRequest!\n");
|
||||
if ((tmp=scan_ldapaddrequest(buf+res,buf+res+len,&ar))) {
|
||||
/* TODO: do something with the add request ;-) */
|
||||
free_ldapaddrequest(&ar);
|
||||
} else {
|
||||
buffer_putsflush(buffer_2,"couldn't parse add request!\n");
|
||||
exit(1);
|
||||
@@ -1256,6 +1255,8 @@ found:
|
||||
}
|
||||
}
|
||||
|
||||
free_ldapaddrequest(&ar);
|
||||
|
||||
{
|
||||
char outbuf[1024];
|
||||
int s=100;
|
||||
|
||||
Reference in New Issue
Block a user