]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/kbind.c
Cast char* argument to hh_to_c() to Byte*
[openldap] / libraries / libldap / kbind.c
index 6ed05253c06d271d802ce5a744644f54475764db..9a0f4a1e008cd0b27c28871eeae65d496ae98223 100644 (file)
@@ -1,39 +1,27 @@
 /*
+ * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
+/*  Portions
  *  Copyright (c) 1993 Regents of the University of Michigan.
  *  All rights reserved.
  *
  *  kbind.c
  */
 
-#ifndef lint 
-static char copyright[] = "@(#) Copyright (c) 1993 Regents of the University of Michigan.\nAll rights reserved.\n";
-#endif
+#include "portable.h"
 
-#ifdef KERBEROS
+#ifdef HAVE_KERBEROS
 
 #include <stdio.h>
-#include <string.h>
-
-#ifdef MACOS
-#include <stdlib.h>
-#include "macos.h"
-#else /* MACOS */
-#ifdef DOS
-#include "msdos.h"
-#endif /* DOS */
-#include <krb.h>
 #include <stdlib.h>
-#if !defined(DOS) && !defined( _WIN32 )
-#include <sys/types.h>
-#endif /* !DOS && !_WIN32 */
-#include <sys/time.h>
-#include <sys/socket.h>
-#endif /* MACOS */
-
-#include "lber.h"
-#include "ldap.h"
-#include "ldap-int.h"
 
+#include <ac/krb.h>
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
+
+#include "ldap-int.h"
 
 
 /*
@@ -52,7 +40,6 @@ ldap_kerberos_bind1( LDAP *ld, char *dn )
        BerElement      *ber;
        char            *cred;
        int             rc, credlen;
-       char            *ldap_get_kerberosv4_credentials();
 #ifdef STR_TRANSLATION
        int             str_translation_on;
 #endif /* STR_TRANSLATION */
@@ -112,11 +99,11 @@ ldap_kerberos_bind1( LDAP *ld, char *dn )
 
        free( cred );
 
-#ifndef NO_CACHE
+#ifndef LDAP_NOCACHE
        if ( ld->ld_cache != NULL ) {
                ldap_flush_cache( ld );
        }
-#endif /* !NO_CACHE */
+#endif /* !LDAP_NOCACHE */
 
        /* send the message */
        return ( ldap_send_initial_request( ld, LDAP_REQ_BIND, dn, ber ));
@@ -159,7 +146,6 @@ ldap_kerberos_bind2( LDAP *ld, char *dn )
        BerElement      *ber;
        char            *cred;
        int             rc, credlen;
-       char            *ldap_get_kerberosv4_credentials();
 #ifdef STR_TRANSLATION
        int             str_translation_on;
 #endif /* STR_TRANSLATION */
@@ -264,25 +250,25 @@ ldap_get_kerberosv4_credentials( LDAP *ld, char *who, char *service, int *len )
        Debug( LDAP_DEBUG_TRACE, "ldap_get_kerberosv4_credentials\n", 0, 0, 0 );
 
        if ( (err = krb_get_tf_realm( tkt_string(), realm )) != KSUCCESS ) {
-#ifndef NO_USERINTERFACE
+#ifdef LDAP_LIBUI
                fprintf( stderr, "krb_get_tf_realm failed (%s)\n",
                    krb_err_txt[err] );
-#endif /* NO_USERINTERFACE */
+#endif /* LDAP_LIBUI */
                ld->ld_errno = LDAP_INVALID_CREDENTIALS;
                return( NULL );
        }
 
-#ifdef LDAP_REFERRALS
+#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS
        krbinstance = ld->ld_defconn->lconn_krbinstance;
-#else /* LDAP_REFERRALS */
+#else /* LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS */
        krbinstance = ld->ld_host;
-#endif /* LDAP_REFERRALS */
+#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS */
 
        if ( (err = krb_mk_req( &ktxt, service, krbinstance, realm, 0 ))
            != KSUCCESS ) {
-#ifndef NO_USERINTERFACE
+#ifdef LDAP_LIBUI
                fprintf( stderr, "krb_mk_req failed (%s)\n", krb_err_txt[err] );
-#endif /* NO_USERINTERFACE */
+#endif /* LDAP_LIBUI */
                ld->ld_errno = LDAP_INVALID_CREDENTIALS;
                return( NULL );
        }
@@ -299,4 +285,4 @@ ldap_get_kerberosv4_credentials( LDAP *ld, char *who, char *service, int *len )
 }
 
 #endif /* !AUTHMAN */
-#endif /* KERBEROS */
+#endif /* HAVE_KERBEROS */