]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-meta/bind.c
Do not return pointers into BerElement we do not own
[openldap] / servers / slapd / back-meta / bind.c
index 272ecb901a11133392ffea90d19c5dd441e00fe4..4c1c9bec780612946b88de6645b3c491996cf71a 100644 (file)
@@ -249,8 +249,9 @@ meta_back_do_single_bind(
                int                     candidate
 )
 {
-       struct berval mdn = { 0, NULL };
-       int rc;
+       struct berval   mdn = { 0, NULL };
+       int             rc;
+       ber_int_t       msgid;
        
        /*
         * Rewrite the bind dn if needed
@@ -287,7 +288,8 @@ meta_back_do_single_bind(
                }
        }
        
-       rc = ldap_bind_s( lc->conns[ candidate ].ld, mdn.bv_val, cred->bv_val, method );
+       rc = ldap_sasl_bind(lc->conns[ candidate ].ld, mdn.bv_val,
+                       LDAP_SASL_SIMPLE, cred, op->o_ctrls, NULL, &msgid);
        if ( rc != LDAP_SUCCESS ) {
                rc = ldap_back_map_result( rc );
        } else {
@@ -383,17 +385,15 @@ meta_back_dobind( struct metaconn *lc, Operation *op )
 #ifdef NEW_LOGGING
                        LDAP_LOG( BACK_META, WARNING,
                                        "meta_back_dobind: (anonymous)"
-                                       " bind as \"%s\" failed"
-                                       " with error \"%s\"\n",
-                                       lsc->bound_dn.bv_val,
-                                       ldap_err2string( rc ), 0 );
+                                       " bind failed"
+                                       " with error %d (%s)\n",
+                                       rc, ldap_err2string( rc ), 0 );
 #else /* !NEW_LOGGING */
                        Debug( LDAP_DEBUG_ANY,
                                        "==>meta_back_dobind: (anonymous)"
-                                       " bind as \"%s\" failed"
-                                       " with error \"%s\"\n%s",
-                                       lsc->bound_dn.bv_val,
-                                       ldap_err2string( rc ), "" );
+                                       " bind failed"
+                                       " with error %d (%s)\n",
+                                       rc, ldap_err2string( rc ), 0 );
 #endif /* !NEW_LOGGING */
 
                        /*
@@ -451,7 +451,8 @@ meta_back_rebind( LDAP *ld, LDAP_CONST char *url, ber_tag_t request,
 {
        struct metasingleconn *lc = params;
 
-       return ldap_bind_s( ld, lc->bound_dn.bv_val, lc->cred.bv_val, LDAP_AUTH_SIMPLE );
+       return ldap_bind_s( ld, lc->bound_dn.bv_val, lc->cred.bv_val,
+                       LDAP_AUTH_SIMPLE );
 }
 
 /*