[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
problems with ldap_simple_bind
Hello everybody,
I'm developing an application in which a radius server reads the users
information from an ldap server.
I'have built a dinamic library which reads the users information. Most
of the times it seems to work well, but when I test the radius server
with more calls per second, the radius server dies. I dont get any core
file or relevant log. The last thing executed is ldap_simple_bind.
This is how I implemented part of my dinamic library:
logError ("\n*** LDAP FUNCTION : ldap_simple_bind\n\n");
msgid = ldap_simple_bind(ld, radiusMgrDn, radiusMgrPw);
if (msgid == -1) {
logError_tmp("rlm_ldap: ldap_simple_bind()");
ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ldap_errno);
sprintf(buffer, "rlm_ldap: %s bind failed: %s",
radiusMgrDn, ldap_err2string(ldap_errno));
logError_tmp (buffer);
ldap_unbind_s(ld);
fflus (NULL);
return (NO_USER_FILE);
}
logError_tmp("rlm_ldap: waiting for bind result ...");
/* Fijamos el timeout en 2 segundos*/
timeout.tv_usec=0;
timeout.tv_sec=1;
rc = ldap_result(ld, msgid, 1, &timeout, &resul);
if(rc < 1) {
logError_tmp("rlm_ldap: ldap_result()");
ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ldap_errno);
ldap_unbind_s(ld);
fflush (NULL);
return (NO_USER_FILE);
}
And this is the last log I get:
*******************************************************************
* FUNCION UsuExt : Para leer datos de servidor LDAP *
*******************************************************************
El directorio de configuracion es: /opt/radius5.04/raddb_ldap
Leido el fichero de Configuracion
Se rellenan los arrays con los atributos RADIUS y LDAP
Abriendo el archivo de conversion de Atributos RADIUS-LDAP
Rellenados los Arrays con los Atrbutos de Radius y los Atributos LDAP
*** LDAP FUNCTION : ldap_init
Conexion a 127.0.0.1:3500 conseguida.
*** PWD PAQUETE RECUPERADA : pepe
*** LDAP FUNCTION : ldap_simple_bind
On the other hand I have studied the sockets situation with netstat,
when the server dies there are a lot of sockets in state TIME_WAIT.
Could it supose a problem??
Does anybody have a clue about what could be happening or how to aviod
it?
Or could someone give me an explanation on where should I try to find
the bug? In the radius server or the ldap library?
Thank you very much in advantage and have a nice day.
ALICIA