]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/bind.c
(Partial) Sync with HEAD
[openldap] / libraries / libldap / bind.c
index b9579f2b4a9c7b6530c0cbb9e74e9e9ea7d21dd7..32238a53d55b3681a20699ae437091b7ff192392 100644 (file)
@@ -1,13 +1,23 @@
+/* bind.c */
 /* $OpenLDAP$ */
-/*
- * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
- */
-/*  Portions
- *  Copyright (c) 1990 Regents of the University of Michigan.
- *  All rights reserved.
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 1998-2003 The OpenLDAP Foundation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
  *
- *  bind.c
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
+ */
+/* Portions Copyright (c) 1990 Regents of the University of Michigan.
+ * All rights reserved.
+ */
+/* Portions Copyright (C) The Internet Society (1997)
+ * ASN.1 fragments are from RFC 2251; see RFC for full legal notices.
  */
 
 /*
@@ -16,7 +26,7 @@
  *             name            DistinguishedName,       -- who
  *             authentication  CHOICE {
  *                     simple          [0] OCTET STRING -- passwd
-#ifdef HAVE_KERBEROS
+#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND
  *                     krbv42ldap      [1] OCTET STRING
  *                     krbv42dsa       [2] OCTET STRING
 #endif
@@ -42,7 +52,7 @@
 #include <ac/time.h>
 
 #include "ldap-int.h"
-
+#include "ldap_log.h"
 
 /*
  * ldap_bind - bind to the ldap server (and X.500).  The dn and password
 int
 ldap_bind( LDAP *ld, LDAP_CONST char *dn, LDAP_CONST char *passwd, int authmethod )
 {
+#ifdef NEW_LOGGING
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_bind\n", 0, 0, 0 );
+#else
        Debug( LDAP_DEBUG_TRACE, "ldap_bind\n", 0, 0, 0 );
+#endif
 
        switch ( authmethod ) {
        case LDAP_AUTH_SIMPLE:
                return( ldap_simple_bind( ld, dn, passwd ) );
 
-#ifdef HAVE_KERBEROS
+#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND
        case LDAP_AUTH_KRBV41:
                return( ldap_kerberos_bind1( ld, dn ) );
 
@@ -105,13 +119,17 @@ ldap_bind_s(
        LDAP_CONST char *passwd,
        int authmethod )
 {
+#ifdef NEW_LOGGING
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_bind_s\n", 0, 0, 0 );
+#else
        Debug( LDAP_DEBUG_TRACE, "ldap_bind_s\n", 0, 0, 0 );
+#endif
 
        switch ( authmethod ) {
        case LDAP_AUTH_SIMPLE:
                return( ldap_simple_bind_s( ld, dn, passwd ) );
 
-#ifdef HAVE_KERBEROS
+#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND
        case LDAP_AUTH_KRBV4:
                return( ldap_kerberos_bind_s( ld, dn ) );
 
@@ -130,14 +148,3 @@ ldap_bind_s(
                return( ld->ld_errno = LDAP_AUTH_UNKNOWN );
        }
 }
-
-
-void
-ldap_set_rebind_proc( LDAP *ld, int (*rebindproc)( LDAP *ld, char **dnp,
-       char **passwdp, int *authmethodp, int freeit ))
-{
-       assert( ld != NULL );
-       assert( LDAP_VALID( ld ) );
-
-       ld->ld_rebindproc = rebindproc;
-}