[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 log shown is before the function 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("ldap: ldap_simple_bind()");
                ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ldap_errno);

                sprintf(buffer, "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("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("ldap: ldap_result()");
                ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ldap_errno);

                ldap_unbind_s(ld);
                fflush (NULL);
                return (NO_USER_FILE);
        }
 

The ldap server logs:

daemon: conn=2032 fd=7 connection from IP=127.0.0.1:53460 (IP=0.0.0.0:44045) accepted.
conn=2032 op=0 BIND dn="CN=MANAGER,O=ROOT" method=128
ber_flush: 14 bytes to sd 7
conn=2032 op=0 RESULT tag=97 err=0 text=
conn=2032 op=1 SRCH base="o=root" scope=2 filter="(uid=pepe@teleline3)"
ber_flush: 460 bytes to sd 7
ber_flush: 14 bytes to sd 7
conn=2032 op=1 SEARCH RESULT tag=101 err=0 text=
conn=2032 op=2 UNBIND
conn=-1 fd=7 closed
daemon: conn=2033 fd=7 connection from IP=127.0.0.1:53461 (IP=0.0.0.0:44045) accepted.
conn=2033 op=0 BIND dn="CN=MANAGER,O=ROOT" method=128
ber_flush: 14 bytes to sd 7
conn=2033 op=0 RESULT tag=97 err=0 text=
conn=2033 op=1 SRCH base="o=root" scope=2 filter="(uid=pepe@teleline3)"
ber_flush: 460 bytes to sd 7
ber_flush: 14 bytes to sd 7
conn=2033 op=1 SEARCH RESULT tag=101 err=0 text=
conn=2033 op=2 UNBIND
conn=-1 fd=7 closed
daemon: conn=2034 fd=7 connection from IP=127.0.0.1:53462 (IP=0.0.0.0:44045) accepted.
conn=2034 op=0 BIND dn="CN=MANAGER,O=ROOT" method=128
ber_flush: 14 bytes to sd 7
conn=2034 op=0 RESULT tag=97 err=0 text=
conn=-1 fd=7 closed
 

I have implemented error treatment, but it doesn't seem to work with this error. How could I capture this error? Or how could I avoid it?

Any sugestion will be welcome, have a nice day!
ALICIA