Hi,
The code from courier 0.47 contains a broken auth_ldap_enumerate
function which would never work properly for more than one user (which
kinda defeats the purpose of the function...).
The attached patch fixes the code.
Regards,
Rob
--
rob holland - [ [EMAIL PROTECTED] ]
[ 5251 4FAC D684 8845 5604 E44F D65C 392F D91B 4729 ]
--- authldaplib.c 2004-06-26 16:09:29.000000000 +0100
+++ authldaplib.c 2004-11-19 14:19:39.735030120 +0000
@@ -1655,7 +1655,7 @@
LDAPMessage *result;
LDAPMessage *entry;
- int n, i, j;
+ int n, i, j, m;
struct timeval timeout;
if (ldapopen()) return;
@@ -1711,19 +1711,18 @@
for (i=0; i<n; i++)
{
char **names;
- int n;
- entry=i ? ldap_next_entry(my_ldap_fp, result):
+ entry=i?ldap_next_entry(my_ldap_fp, entry):
ldap_first_entry(my_ldap_fp, result);
if (entry == NULL)
break;
names=get_values(my_ldap_fp, entry, attributes[0]);
- n=ldap_count_values(names);
- for (i=0; i<n; i++)
+ m=ldap_count_values(names);
+ for (j=0; j<m; j++)
{
- const char *name=names[i];
+ const char *name=names[j];
char *uid_s=NULL;
char *gid_s=NULL;