]> git.sur5r.net Git - openldap/commitdiff
add LDAP_OPT_DIAGNOSTIC_MESSAGE; replace deprecated option names
authorPierangelo Masarati <ando@openldap.org>
Sat, 14 Oct 2006 17:04:17 +0000 (17:04 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 14 Oct 2006 17:04:17 +0000 (17:04 +0000)
12 files changed:
clients/tools/ldapdelete.c
clients/tools/ldapmodify.c
contrib/ldapc++/src/LDAPException.cpp
doc/man/man3/ldap_get_option.3
include/ldap.h
libraries/libldap/options.c
servers/slapd/back-meta/bind.c
servers/slapd/back-meta/compare.c
servers/slapd/back-meta/search.c
servers/slurpd/ldap_op.c
servers/slurpd/ri.c
tests/progs/slapd-common.c

index 518140fac4aabb7ca4b6eccff4c189197c4efebc..741c52dcdc0e26c14f2eb9fc255b80b34c0c219c 100644 (file)
@@ -332,7 +332,7 @@ static int deletechildren(
                        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;
@@ -407,7 +407,7 @@ static int deletechildren(
                        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;
index c88bb07768479f2181412190bdb436afec66a3fb..b33c93262e4afae9a81e5f8be15123c1be791af7 100644 (file)
@@ -363,7 +363,7 @@ main( int argc, char **argv )
                        }
 
                        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 );
@@ -1158,7 +1158,7 @@ static int process_response(
                }
 
                if ( rc == -1 ) {
-                       ldap_get_option( ld, LDAP_OPT_ERROR_NUMBER, &rc );
+                       ldap_get_option( ld, LDAP_OPT_RESULT_CODE, &rc );
                        return rc;
                }
 
index c7b0c5689ed17afb2b28794850cce450882e4171..5be910bfefcce95c3106e45bd5fa698c068c2d4c 100644 (file)
@@ -22,7 +22,7 @@ LDAPException::LDAPException(int res_code, const string& err_string){
 
 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);
@@ -30,7 +30,7 @@ LDAPException::LDAPException(const LDAPAsynConnection *lc){
         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 {
index 1820d9537c444af15d41933d84bac73d5a79ac51..567fb3459b67f98a221636cad579e010dbed5072 100644 (file)
@@ -237,7 +237,7 @@ the library duplicates the corresponding string.
 .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
@@ -245,8 +245,10 @@ 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 **" ,
index 9562b8c37f644a8cfe3cb8a813f31cdaa5d5aac2..b7603745370ec97599d76883227682ed3ce9856a 100644 (file)
@@ -95,16 +95,17 @@ LDAP_BEGIN_DECL
 #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 */
 
index eb13790b3064e795b7edfea869973fbc9d66f1c2..64525dca1cc221fb0d26027b1e29af92f6fa743a 100644 (file)
@@ -242,7 +242,7 @@ ldap_get_option(
 
                return LDAP_OPT_SUCCESS;
 
-       case LDAP_OPT_ERROR_NUMBER:
+       case LDAP_OPT_RESULT_CODE:
                if(ld == NULL) {
                        /* bad param */
                        break;
@@ -250,7 +250,7 @@ ldap_get_option(
                * (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;
@@ -578,7 +578,7 @@ ldap_set_option(
                        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) {
@@ -667,7 +667,7 @@ ldap_set_option(
        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 */
@@ -715,7 +715,7 @@ ldap_set_option(
                        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) {
index 888f1c0d03640384501f2f5faa96a228dda0b8ca..faf0526026e17e27e17dfc044e781d5014bfc01e 100644 (file)
@@ -402,7 +402,7 @@ retry:;
                        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 ),
@@ -982,7 +982,7 @@ retry:;
                                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;
 
@@ -1055,7 +1055,7 @@ retry:;
 
                        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
@@ -1064,7 +1064,7 @@ retry:;
                                 * 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;
index 05ea183e0bac81fc3242eb3d2173007e713d1962..be48b0a03abf000340c3688f6ee0a728af244e26 100644 (file)
@@ -207,7 +207,7 @@ meta_back_compare( Operation *op, SlapReply *rs )
                                /* 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;
@@ -263,7 +263,7 @@ meta_back_compare( Operation *op, SlapReply *rs )
                                                free( err );
                                        }
                                        ldap_get_option( msc->msc_ld,
-                                               LDAP_OPT_ERROR_STRING, &err );
+                                               LDAP_OPT_DIAGNOSTIC_MESSAGE, &err );
 
                                        if ( match != NULL ) {
                                                free( match );
index f09421c9346b790044eca7dd6c4ab96c7d7cc2b0..68ad9f00ca5a618402f5a5ecf7e3266979496d2a 100644 (file)
@@ -988,7 +988,7 @@ really_bad:;
                                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;
index 2f19e7939df907a644a0b5483abd661734dba502..cf77dd6a088ea56dfc33a6896a22ae6bc23c3bdc 100644 (file)
@@ -215,8 +215,8 @@ op_ldap_add(
                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 {
@@ -353,7 +353,7 @@ op_ldap_modify(
        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 );
@@ -379,7 +379,7 @@ op_ldap_delete(
     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 );
@@ -512,8 +512,8 @@ op_ldap_modrdn(
     /* 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 );
 }
index e4b2637424b169223f5a9770136013da8a820dca..ac50de02676aa40a650e3709b40431e6622a6dc7 100644 (file)
@@ -121,7 +121,7 @@ Ri_process(
                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 );
index e5f1d41a01521e1d1c2b4edd00718b5a773c3869..b68b3062280fd8d5fb1873b24a25c6a850a219b1 100644 (file)
@@ -235,7 +235,7 @@ tester_ldap_error( LDAP *ld, const char *fname, const char *msg )
 
        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",