[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);
                fflus (NULL);
                return (NO_USER_FILE);
        logError_tmp("rlm_ldap: waiting for bind result ...");

/* Fijamos el timeout en 2 segundos*/

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);

                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 conseguida.


*** 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
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.