/* $ gcc -o frob-cldap-search -Wall -lldap -llber frob-cldap-search.c */ #include #include int main (void) { LDAP *ldap; int rc; int id; /* Yes, this doesn't actually do anything, just demonstrates access * of uninitialized memory. */ rc = ldap_initialize (&ldap, "cldap://localhost"); assert (rc == LDAP_SUCCESS); rc = ldap_search_ext (ldap, "", LDAP_SCOPE_BASE, "(objectClass=*)", NULL, 0, NULL, NULL, NULL, -1, &id); assert (rc == LDAP_SUCCESS); ldap_unbind_ext (ldap, NULL, NULL); return 0; }