#include <ldap.h> void ldap_set_rebind_proc( LDAP *ld, LDAPRebindProc rebindproc )
The ldap_set_rebind_proc() function is used to set the entry-point of a routine that will be called back to obtain bind credentials for use when a new server is contacted during the following of an LDAP referral. Note that this function is only useful when the LDAP_OPT_REFERRALS option is set (this is the default). If ldap_set_rebind_proc() is never called, or if it is called with a NULL rebindproc parameter, an unauthenticated simple LDAP bind will always be done when chasing referrals.
rebindproc should be a function that is declared like this:
int rebindproc( LDAP *ld, char **whop, char **credp, int *methodp, int freeit );
The LDAP library will first call the rebindproc to obtain the referral bind credentials, and the freeit parameter will be zero. The function must set whop, credp, and methodp as appropriate. If the rebindproc returns LDAP_SUCCESS, referral processing continues, and the rebindproc will be called a second time with freeit non-zero to give your application a chance to free any memory allocated in the previous call.
If anything but LDAP_SUCCESS is returned by the first call to the rebindproc, referral processing is stopped and that error code is returned for the original LDAP operation.
No IBM® i authority is required.
None.
The ldap_set_rebind_proc() API does not return an error code.
The following message may be sent from this function.
Message ID | Error Message Text |
---|---|
CPF3CF2 E | Error(s) occurred during running of ldap_set_rebind_proc API. |
[ Back to top | LDAP APIs | APIs by category ]