]> git.sur5r.net Git - openldap/blobdiff - servers/slurpd/ldap_op.c
syncinfo_free must be able to free multiple syncinfos
[openldap] / servers / slurpd / ldap_op.c
index 2f5f870f03070fff844ae9c4f36505137b5f9c34..dc06b2d310e215eb600257e9e56855cbd35e418c 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2006 The OpenLDAP Foundation.
+ * Copyright 1998-2007 The OpenLDAP Foundation.
  * Portions Copyright 2003 Mark Benson.
  * All rights reserved.
  *
@@ -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 );
 }
@@ -669,7 +669,7 @@ do_bind(
 )
 {
     int                ldrc;
-    int                do_tls = ri->ri_tls;
+    int                do_tls;
 
     *lderr = 0;
 
@@ -678,6 +678,8 @@ do_bind(
        return( BIND_ERR_BADRI );
     }
 
+    do_tls = ri->ri_tls;
+
 retry:
     if ( ri->ri_ldp != NULL ) {
        ldrc = ldap_unbind( ri->ri_ldp );