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

Re: web500gw ( LDAP_OPT_ERROR_STRING )



Howard Chu wrote:
ld->ld_error can be retrieved directly using ldap_get_option() and
LDAP_OPT_ERROR_NUMBER.

Did you mean LDAP_OPT_ERROR_STRING?

But at any rate, LDAP_OPT_ERROR_STRING ( ie. ld->ld_error ) does not appear to be set on errors only LDAP_OPT_ERROR_NUMBER ( ld->ld_errno ).

To test, I am adding an object into the directory that already exists.
If I do...

ldap_get_option(ldap_server_connection, LDAP_OPT_ERROR_NUMBER, &err );
printf("ERROR: %d>%s\n", err, ldap_err2string(err));

I get what I expect... "ERROR: 68>Already exists" but...

ldap_get_option(ldap_server_connection, LDAP_OPT_ERROR_STRING, &error_string );

returns an empty string in error_string.

I used gdb to confirm that although the error number is set, ld_error was not set in the LDAP structure by the ldap_add_ext_s() function call when it failed.

--Kervin