[Date Prev][Date Next] [Chronological] [Thread] [Top]

[no subject]



I am writing a small client using OpenLDAP's libraries. It's basically a
modified ldapsearch.c. The search I am doing programatically doesn't
succeed, even though it does with other clients like GQ.


Here's the code:

test_msgid = ldap_search(ld, "dc=devonitnet,dc=com",
LDAP_SCOPE_SUBTREE, test, NULL, 0); while ((rc = ldap_result( ld, test_msgid, 1,
NULL, &res )) > 0 )
{
if( sortattr ) {
(void) ldap_sort_entries( ld, &res,
( *sortattr == '\0' ) ? NULL : sortattr,
strcasecmp );
} for ( msg = ldap_first_message( ld, res ); msg != NULL;
msg = ldap_next_message( ld, msg ) )


.... and so on just like in the ldapsearch.c. This results in the following log entries:


Apr 24 15:41:50 ldap slapd[22711]: conn=4330 op=0 BIND
dn="CN=ADMIN,DC=DEVONITNET,DC=COM" method=128
Apr 24 15:41:50 ldap slapd[22711]: conn=4330 op=0 RESULT err=0 tag=97
nentries=0
Apr 24 15:41:50 ldap slapd[22712]: conn=4330 op=1 SRCH
base="DC=DEVONITNET,DC=COM" scope=2 filter="(objectclass=QMAILUSER)"
Apr 24 15:41:50 ldap slapd[22712]: conn=4330 op=1 RESULT err=0 tag=101
nentries=0
Apr 24 15:41:50 ldap slapd[22713]: conn=4330 op=2 UNBIND
Apr 24 15:41:50 ldap slapd[22713]: conn=4330 op=2 fd=46 closed errno=0



This would usually result if an object would not be found, however it's
there, as shown by the following log entries for the search performed with GQ client:


Apr 24 15:44:13 ldap slapd[390]: conn=4331 fd=46 connection from
tux.docisp.com (10.0.1.101) accepted.
Apr 24 15:44:13 ldap slapd[22714]: conn=4331 op=0 BIND
dn="CN=ADMIN,DC=DEVONITNET,DC=COM" method=128
Apr 24 15:44:13 ldap slapd[22714]: conn=4331 op=0 RESULT err=0 tag=97
nentries=0
Apr 24 15:44:13 ldap slapd[22715]: conn=4331 op=1 SRCH
base="DC=DEVONITNET,DC=COM" scope=2 filter="(objectclass=QMAILUSER)"
Apr 24 15:44:14 ldap slapd[22715]: conn=4331 op=1 RESULT err=0 tag=101
nentries=127
Apr 24 15:44:14 ldap slapd[22716]: conn=4331 op=2 UNBIND
Apr 24 15:44:14 ldap slapd[22716]: conn=4331 op=2 fd=46 closed errno=0
What am I doing wrong, if anything? This is Linux and OpenLDAP 2.0.7 for the client libraries with 1.3.11 as the
server.
--
Dan