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

ldap search issue



I am trying to use the ldap_sasl_bind_s function and I am not having luck. I get the following message back:

ldap_sasl_bind: SASL bind in progress

here is the code:


char *mech = "GSSAPI"; struct berval cred; struct berval *servcred; // char *query = "(&(objectclass=user)(objectcategory=person))"; char *query = "(&(objectclass=computer)(objectcategory=computer))"; int sizelimit = 300000; int version = LDAP_VERSION3;

   ld=ldap_init(ldap_host,ldap_port);
   ldap_set_option( ld, LDAP_OPT_SIZELIMIT , (void *)&sizelimit);
   ldap_set_option( ld, LDAP_OPT_REFERRALS , LDAP_OPT_OFF);
   ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &version );
//    ldap_simple_bind_s(ld, user, pass);

if(ldap_sasl_bind_s(ld, user , mech , NULL , NULL, NULL, &servcred)!=LDAP_SUCCESS)
{
ldap_perror( ld, "ldap_sasl_bind" );


   }

   ldap_search_s(ld, searchDN,LDAP_SCOPE_SUBTREE, query, NULL, 0, &res);
   numfound = ldap_count_entries(ld, res);
   ldap_msgfree(res);
   ldap_unbind(ld);

Any help is appreciated.

Thanks

Mark

--
Mark Campbell
Systems Analyst, Advanced Information Technologies
Information Technology Services
The Pennsylvania State University
mcc171@psu.edu, 814-865-4774