+/* $OpenLDAP$ */
/*
* Copyright (c) 1996 Regents of the University of Michigan.
* All rights reserved.
#include <ac/krb.h>
+#if defined( STR_TRANSLATION ) && defined( LDAP_DEFAULT_CHARSET )
+/* Get LDAP->ld_lberoptions. Must precede slurp.h, both define ldap_debug. */
+#include "../../libraries/libldap/ldap-int.h"
+#endif
+
#include <lber.h>
#include <ldap.h>
static int getmodtype LDAP_P(( char * ));
static void dump_ldm_array LDAP_P(( LDAPMod ** ));
static char **read_krbnames LDAP_P(( Ri * ));
+#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND
static void upcase LDAP_P(( char * ));
+#endif
static int do_bind LDAP_P(( Ri *, int * ));
static int do_unbind LDAP_P(( Ri * ));
while ( retry > 0 ) {
if ( ri->ri_ldp == NULL ) {
rc = do_bind( ri, &lderr );
+
if ( rc != BIND_OK ) {
- return DO_LDAP_ERR_RETRYABLE;
+ (void) do_unbind( ri );
+ return DO_LDAP_ERR_RETRYABLE;
}
}
#endif /* LDAP_DEBUG */
/* Do the modrdn */
- rc = ldap_rename2_s( ri->ri_ldp, re->re_dn, mi->mi_val, drdnflag, newsup );
+ rc = ldap_rename2_s( ri->ri_ldp, re->re_dn, mi->mi_val, newsup, drdnflag );
ldap_get_option( ri->ri_ldp, LDAP_OPT_ERROR_NUMBER, &lderr);
return( lderr );
)
{
int ldrc;
-#ifdef HAVE_KERBEROS
+#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND
int rc;
int retval = 0;
int kni, got_tgt;
char realm[ REALM_SZ ];
char name[ ANAME_SZ ];
char instance[ INST_SZ ];
-#endif /* HAVE_KERBEROS */
+#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND */
*lderr = 0;
switch ( ri->ri_bind_method ) {
case AUTH_KERBEROS:
-#ifndef HAVE_KERBEROS
+#ifndef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND
Debug( LDAP_DEBUG_ANY,
"Error: Kerberos bind for %s:%d, but not compiled w/kerberos\n",
ri->ri_hostname, ri->ri_port, 0 );
return( BIND_ERR_KERBEROS_FAILED );
-#else /* HAVE_KERBEROS */
+#else /* LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND */
/*
* Bind using kerberos.
* If "bindprincipal" was given in the config file, then attempt
}
return( retval);
break;
-#endif /* HAVE_KERBEROS */
+#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND */
case AUTH_SIMPLE:
/*
* Bind with a plaintext password.
}
+#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND
/*
* upcase a string
*p = TOUPPER( (unsigned char) *p );
}
}
+
+#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND */