]> git.sur5r.net Git - openldap/commitdiff
Log out to stderr, add LDAP_VERSION3 support to bind.c and modrdn.c
authorKurt Zeilenga <kurt@openldap.org>
Tue, 29 Jun 1999 01:02:48 +0000 (01:02 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 29 Jun 1999 01:02:48 +0000 (01:02 +0000)
libraries/liblutil/debug.c
servers/slapd/bind.c
servers/slapd/modrdn.c

index ddb30ed96b9b50298dbaa8b558f1546658c9ae97..d6bb4f836f33f0cda7350fce4e5494e29b06f32f 100644 (file)
@@ -69,6 +69,6 @@ void (lutil_debug)( int level, int debug, const char *fmt, ... )
                fflush( log_file );
        }
 
-    puts(buffer );
+    fputs( buffer, stderr );
        va_end( vl );
 }
index 0d380079a8252c8fc4e2c11d8f20ad355c89f71e..54759e8d166a8e75319682590e9f8ca3e7ad28a9 100644 (file)
@@ -68,7 +68,7 @@ do_bind(
        Statslog( LDAP_DEBUG_STATS, "conn=%d op=%d BIND dn=\"%s\" method=%d\n",
            conn->c_connid, op->o_opid, ndn, method, 0 );
 
-       if ( version != LDAP_VERSION2 ) {
+       if ( version < LDAP_VERSION_MIN || version > LDAP_VERSION_MAX ) {
                if ( cdn != NULL ) {
                        free( cdn );
                }
index 66b7f93f782581ecd72acf262d5e3c848151817f..a38160f4f2a6790e24418a94600bb5ce82ac96b9 100644 (file)
@@ -76,29 +76,23 @@ do_modrdn(
 
        if ( ber_peek_tag( op->o_ber, &length ) == LDAP_TAG_NEWSUPERIOR ) {
 
-               if ( conn->c_protocol == LDAP_VERSION2 ) {
+               if ( conn->c_protocol ==  0 ) {
+                       /*
+                        * Promote to LDAPv3
+                        */
+                       conn->c_protocol = LDAP_VERSION3;
 
+               } else if ( conn->c_protocol < LDAP_VERSION3 ) {
                        /* Conection record indicates v2 but field 
                         * newSuperior is present: report error.
                         */
                        Debug( LDAP_DEBUG_ANY,
-                              "modrdn(v2) has field newSuperior!\n",
+                              "modrdn(v2): invalid field newSuperior!\n",
                               0, 0, 0 );
                        send_ldap_result( conn, op, LDAP_PROTOCOL_ERROR,
                                          NULL, "" );
                        return;
-
-               } else if ( conn->c_protocol ==  0 ) {
-
-                       /* The other side is talking v3 but did not Bind as v3
-                        * so we accept this and set the connection record
-                        * accordingly.
-                        */
-                   
-                       conn->c_protocol = LDAP_VERSION3;
-
-               }/* else if ( conn->c_protocol ==  0 ) */
-
+               }
 
                if ( ber_scanf( op->o_ber, /*{*/ "a}", &newSuperior ) 
                     == LBER_ERROR ) {