char *dn = ldap_get_dn( ld, e );
if( dn == NULL ) {
- ldap_get_option( ld, LDAP_OPT_ERROR_NUMBER, &rc );
+ ldap_get_option( ld, LDAP_OPT_RESULT_CODE, &rc );
tool_perror( "ldap_prune", rc, NULL, NULL, NULL, NULL );
ber_memfree( dn );
return rc;
char *dn = ldap_get_dn( ld, e );
if( dn == NULL ) {
- ldap_get_option( ld, LDAP_OPT_ERROR_NUMBER, &rc );
+ ldap_get_option( ld, LDAP_OPT_RESULT_CODE, &rc );
tool_perror( "ldap_prune", rc, NULL, NULL, NULL, NULL );
ber_memfree( dn );
return rc;
}
error_msg = NULL;
- ldap_get_option(ld, LDAP_OPT_ERROR_STRING, &error_msg);
+ ldap_get_option(ld, LDAP_OPT_DIAGNOSTIC_MESSAGE, &error_msg);
if ( error_msg != NULL ) {
if ( *error_msg != '\0' ) {
fprintf( rejfp, _(", additional info: %s"), error_msg );
}
if ( rc == -1 ) {
- ldap_get_option( ld, LDAP_OPT_ERROR_NUMBER, &rc );
+ ldap_get_option( ld, LDAP_OPT_RESULT_CODE, &rc );
return rc;
}
LDAPException::LDAPException(const LDAPAsynConnection *lc){
LDAP *l = lc->getSessionHandle();
- ldap_get_option(l,LDAP_OPT_ERROR_NUMBER,&m_res_code);
+ ldap_get_option(l,LDAP_OPT_RESULT_CODE,&m_res_code);
const char *res_cstring = ldap_err2string(m_res_code);
if ( res_cstring ) {
m_res_string = string(res_cstring);
m_res_string = "";
}
const char* err_string;
- ldap_get_option(l,LDAP_OPT_ERROR_STRING,&err_string);
+ ldap_get_option(l,LDAP_OPT_DIAGNOSTIC_MESSAGE,&err_string);
if ( err_string ) {
m_res_string = string(err_string);
} else {
.B LDAP_OPT_RESULT_CODE
Sets/gets the LDAP result code associated to the handle.
This option was formerly known as
-.BR LDAP_OPT_ERROR_NUMBER.
+.BR LDAP_OPT_ERROR_NUMBER .
Both
.BR outvalue
and
must be a
.BR "int *" .
.TP
-.B LDAP_OPT_ERROR_STRING
+.B LDAP_OPT_DIAGNOSTIC_MESSAGE
Sets/gets a string containing the error string associated to the LDAP handle.
+This option was formerly known as
+.BR LDAP_OPT_ERROR_STRING .
.BR outvalue
must be a
.BR "char **" ,
#define LDAP_OPT_REFERRALS 0x0008
#define LDAP_OPT_RESTART 0x0009
/* 0x0a - 0x10 not defined */
-#define LDAP_OPT_PROTOCOL_VERSION 0x0011
-#define LDAP_OPT_SERVER_CONTROLS 0x0012
-#define LDAP_OPT_CLIENT_CONTROLS 0x0013
+#define LDAP_OPT_PROTOCOL_VERSION 0x0011
+#define LDAP_OPT_SERVER_CONTROLS 0x0012
+#define LDAP_OPT_CLIENT_CONTROLS 0x0013
/* 0x14 not defined */
-#define LDAP_OPT_API_FEATURE_INFO 0x0015
+#define LDAP_OPT_API_FEATURE_INFO 0x0015
/* 0x16 - 0x2f not defined */
#define LDAP_OPT_HOST_NAME 0x0030
-#define LDAP_OPT_RESULT_CODE 0x0031
-#define LDAP_OPT_ERROR_NUMBER LDAP_OPT_RESULT_CODE
-#define LDAP_OPT_ERROR_STRING 0x0032
+#define LDAP_OPT_RESULT_CODE 0x0031
+#define LDAP_OPT_ERROR_NUMBER LDAP_OPT_RESULT_CODE
+#define LDAP_OPT_DIAGNOSTIC_MESSAGE 0x0032
+#define LDAP_OPT_ERROR_STRING LDAP_OPT_DIAGNOSTIC_MESSAGE
#define LDAP_OPT_MATCHED_DN 0x0033
/* 0x0034 - 0x3fff not defined */
return LDAP_OPT_SUCCESS;
- case LDAP_OPT_ERROR_NUMBER:
+ case LDAP_OPT_RESULT_CODE:
if(ld == NULL) {
/* bad param */
break;
* (int *) outvalue = ld->ld_errno;
return LDAP_OPT_SUCCESS;
- case LDAP_OPT_ERROR_STRING:
+ case LDAP_OPT_DIAGNOSTIC_MESSAGE:
if(ld == NULL) {
/* bad param */
break;
lo->ldo_defbase = defbase;
} return LDAP_OPT_SUCCESS;
- case LDAP_OPT_ERROR_STRING: {
+ case LDAP_OPT_DIAGNOSTIC_MESSAGE: {
const char *err = (const char *) invalue;
if(ld == NULL) {
case LDAP_OPT_SIZELIMIT:
case LDAP_OPT_TIMELIMIT:
case LDAP_OPT_PROTOCOL_VERSION:
- case LDAP_OPT_ERROR_NUMBER:
+ case LDAP_OPT_RESULT_CODE:
case LDAP_OPT_DEBUG_LEVEL:
if(invalue == NULL) {
/* no place to set from */
lo->ldo_version = vers;
} return LDAP_OPT_SUCCESS;
- case LDAP_OPT_ERROR_NUMBER: {
+ case LDAP_OPT_RESULT_CODE: {
int err = * (const int *) invalue;
if(ld == NULL) {
break;
case -1:
- ldap_get_option( msc->msc_ld, LDAP_OPT_ERROR_NUMBER,
+ ldap_get_option( msc->msc_ld, LDAP_OPT_RESULT_CODE,
&rs->sr_err );
snprintf( buf, sizeof( buf ),
goto retry;
case -1:
- ldap_get_option( msc->msc_ld, LDAP_OPT_ERROR_NUMBER,
+ ldap_get_option( msc->msc_ld, LDAP_OPT_RESULT_CODE,
&rs->sr_err );
break;
rs->sr_err = LDAP_SUCCESS;
- ldap_get_option( msc->msc_ld, LDAP_OPT_ERROR_NUMBER, &rs->sr_err );
+ ldap_get_option( msc->msc_ld, LDAP_OPT_RESULT_CODE, &rs->sr_err );
if ( rs->sr_err != LDAP_SUCCESS ) {
/*
* better check the type of error. In some cases
* positive result ...
*/
ldap_get_option( msc->msc_ld,
- LDAP_OPT_ERROR_STRING, &xtext );
+ LDAP_OPT_DIAGNOSTIC_MESSAGE, &xtext );
if ( xtext != NULL && xtext [ 0 ] == '\0' ) {
ldap_memfree( xtext );
xtext = NULL;
/* we do not retry in this case;
* only for unique operations... */
ldap_get_option( msc->msc_ld,
- LDAP_OPT_ERROR_NUMBER, &rs->sr_err );
+ LDAP_OPT_RESULT_CODE, &rs->sr_err );
rres = slap_map_api2result( rs );
rres = rc;
rc = -1;
free( err );
}
ldap_get_option( msc->msc_ld,
- LDAP_OPT_ERROR_STRING, &err );
+ LDAP_OPT_DIAGNOSTIC_MESSAGE, &err );
if ( match != NULL ) {
free( match );
res = NULL;
if ( rs->sr_err != LDAP_SUCCESS ) {
ldap_get_option( msc->msc_ld,
- LDAP_OPT_ERROR_NUMBER,
+ LDAP_OPT_RESULT_CODE,
&rs->sr_err );
sres = slap_map_api2result( rs );
candidates[ i ].sr_type = REP_RESULT;
ri->ri_hostname, ri->ri_port, re->re_dn );
rc = ldap_add_s( ri->ri_ldp, re->re_dn, ldmarr );
- ldap_get_option( ri->ri_ldp, LDAP_OPT_ERROR_NUMBER, &lderr);
- ldap_get_option( ri->ri_ldp, LDAP_OPT_ERROR_STRING, errmsg);
+ ldap_get_option( ri->ri_ldp, LDAP_OPT_RESULT_CODE, &lderr);
+ ldap_get_option( ri->ri_ldp, LDAP_OPT_DIAGNOSTIC_MESSAGE, errmsg);
*errfree = 1;
} else {
Debug( LDAP_DEBUG_ARGS, "replica %s:%d - modify dn \"%s\"\n",
ri->ri_hostname, ri->ri_port, re->re_dn );
rc = ldap_modify_s( ri->ri_ldp, re->re_dn, ldmarr );
- ldap_get_option( ri->ri_ldp, LDAP_OPT_ERROR_STRING, errmsg);
+ ldap_get_option( ri->ri_ldp, LDAP_OPT_DIAGNOSTIC_MESSAGE, errmsg);
*errfree = 1;
}
free_ldmarr( ldmarr );
Debug( LDAP_DEBUG_ARGS, "replica %s:%d - delete dn \"%s\"\n",
ri->ri_hostname, ri->ri_port, re->re_dn );
rc = ldap_delete_s( ri->ri_ldp, re->re_dn );
- ldap_get_option( ri->ri_ldp, LDAP_OPT_ERROR_STRING, errmsg);
+ ldap_get_option( ri->ri_ldp, LDAP_OPT_DIAGNOSTIC_MESSAGE, errmsg);
*errfree = 1;
return( rc );
/* Do the modrdn */
rc = ldap_rename2_s( ri->ri_ldp, re->re_dn, newrdn, newsup, drdnflag );
- ldap_get_option( ri->ri_ldp, LDAP_OPT_ERROR_NUMBER, &lderr);
- ldap_get_option( ri->ri_ldp, LDAP_OPT_ERROR_STRING, errmsg);
+ ldap_get_option( ri->ri_ldp, LDAP_OPT_RESULT_CODE, &lderr);
+ ldap_get_option( ri->ri_ldp, LDAP_OPT_DIAGNOSTIC_MESSAGE, errmsg);
*errfree = 1;
return( lderr );
}
case DO_LDAP_ERR_FATAL: {
/* Non-retryable error. Write rejection log. */
int ld_errno = 0;
- ldap_get_option(ri->ri_ldp, LDAP_OPT_ERROR_NUMBER, &ld_errno);
+ ldap_get_option(ri->ri_ldp, LDAP_OPT_RESULT_CODE, &ld_errno);
write_reject( ri, re, ld_errno, errmsg );
/* Update status ... */
(void) sglob->st->st_update( sglob->st, ri->ri_stel, re );
ldap_get_option( ld, LDAP_OPT_RESULT_CODE, (void *)&err );
if ( err != LDAP_SUCCESS ) {
- ldap_get_option( ld, LDAP_OPT_ERROR_STRING, (void *)&text );
+ ldap_get_option( ld, LDAP_OPT_DIAGNOSTIC_MESSAGE, (void *)&text );
}
fprintf( stderr, "%s: %s: %s (%d) %s %s\n",