X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslurpd%2Fldap_op.c;h=dc06b2d310e215eb600257e9e56855cbd35e418c;hb=a6e232e7c1c6815b214e5f920459cd63ceeb54e7;hp=b33a74a49a7dce79310d88a7ab29a08e4d14a8c4;hpb=e404a15082d4a1c0219095c56191e5a26de234c8;p=openldap diff --git a/servers/slurpd/ldap_op.c b/servers/slurpd/ldap_op.c index b33a74a49a..dc06b2d310 100644 --- a/servers/slurpd/ldap_op.c +++ b/servers/slurpd/ldap_op.c @@ -1,7 +1,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2005 The OpenLDAP Foundation. + * Copyright 1998-2007 The OpenLDAP Foundation. * Portions Copyright 2003 Mark Benson. * All rights reserved. * @@ -61,7 +61,9 @@ static LDAPMod *alloc_ldapmod LDAP_P(( void )); static void free_ldapmod LDAP_P(( LDAPMod * )); static void free_ldmarr LDAP_P(( LDAPMod ** )); static int getmodtype LDAP_P(( char * )); +#ifdef SLAPD_UNUSED static void dump_ldm_array LDAP_P(( LDAPMod ** )); +#endif static int do_bind LDAP_P(( Ri *, int * )); static int do_unbind LDAP_P(( Ri * )); @@ -213,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 { @@ -351,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 ); @@ -377,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 ); @@ -510,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 ); } @@ -667,7 +669,7 @@ do_bind( ) { int ldrc; - int do_tls = ri->ri_tls; + int do_tls; *lderr = 0; @@ -676,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 ); @@ -877,6 +881,7 @@ retry: /* * For debugging. Print the contents of an ldmarr array. */ +#ifdef SLAPD_UNUSED static void dump_ldm_array( LDAPMod **ldmarr @@ -910,3 +915,4 @@ dump_ldm_array( } } } +#endif