Hi,
What i have done this,
char *ldap_username="xx"; char *ldap_password="xx";
if( ldap_set_option(ld, LDAP_OPT_REFERRALS, LDAP_OPT_ON) != 0) { log_error("LDAP set Optoin for referral"); } if( ldap_set_rebind_proc(ld, get_rebind, NULL) != 0) { log_error("LDAP set Optoin for rebind"); }
static int get_rebind( LDAP *ld, char **whop, char **credp,int *methodp, int freeit, void* arg ) { if ( !freeit ) { *whop = ldap_username; *credp = ldap_password; *methodp = LDAP_AUTH_SIMPLE; } return( LDAP_SUCCESS ); }
This cause be Segfault. I traced with gdb when it reaches this function get_rebind it gives like "credb" address is ox63 and methodp is 0x2. I dont understand why the low address has come up for these variables.
Then i added the following, static int LDAP_CALL LDAP_CALLBACK get_rebind ...
but it gives me the compilation error. What i am missing here. Can you find something odd here.
thanks a lot for your help, -"kalyan"