ldap_set_rebind_proc()--Set Rebind Procedure


  Syntax
 #include <ldap.h>

 void ldap_set_rebind_proc(
                LDAP           *ld,
                LDAPRebindProc  rebindproc )

  Default Public Authority: *USE

  Library Name/Service Program: QSYS/QGLDCLNT

  Threadsafe: Yes

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.


Authorities and Locks

No IBM® i authority is required.


Parameters

ld
(Input) Specifies the LDAP pointer returned by a previous call to ldap_init(), ldap_ssl_init(), or ldap_open().
rebindproc
(Input) Specifies the entry-point of a routine that will be called to obtain bind credentials used when a new server is contacted during the following of an LDAP referral.

Return Value

None.


Error Conditions

The ldap_set_rebind_proc() API does not return an error code.


Error Messages

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.


Related Information



API introduced: V4R3

[ Back to top | LDAP APIs | APIs by category ]