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

Passing a valid result to ldap_first_entry? (ITS#984)

I write mod_ldap, an LDAP authentication module for ProFTPD
(www.proftpd.net). I received a report from a user a few days ago; he had
filed ITS #984 and Kurt responded that it's not proper to call
ldap_first_entry() with a NULL second argument, a result which should be
returned by the previous call to ldap_search*().

Anyway, here's my code:

LDAP *ld;
LDAPMessage *result, *e;

if (ldap_search_st(ld, prefix, ldap_search_scope, filter, ldap_attrs, 0,
                   &ldap_querytimeout_tp, &result) == -1) {
    /* Handle a failed search */

if ((e = ldap_first_entry(ld, result)) == NULL) {
    /* Handle a failed ldap_first_entry() */

I've gone through the man pages a bunch of times, but I'm left scratching my
head as to how to get a valid result to pass to ldap_first_entry() if I'm
using synchronous search calls. Could someone give me a hand here?

John Morrissey          _o            /\         ----  __o
jwm@horde.net        _-< \_          /  \       ----  <  \,
www.horde.net/    __(_)/_(_)________/    \_______(_) /_(_)__