From dcc5bdfe7e9536904387ce77c159f1ed5e4af96b Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Tue, 29 Jun 1999 01:02:48 +0000 Subject: [PATCH] Log out to stderr, add LDAP_VERSION3 support to bind.c and modrdn.c --- libraries/liblutil/debug.c | 2 +- servers/slapd/bind.c | 2 +- servers/slapd/modrdn.c | 22 ++++++++-------------- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/libraries/liblutil/debug.c b/libraries/liblutil/debug.c index ddb30ed96b..d6bb4f836f 100644 --- a/libraries/liblutil/debug.c +++ b/libraries/liblutil/debug.c @@ -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 ); } diff --git a/servers/slapd/bind.c b/servers/slapd/bind.c index 0d380079a8..54759e8d16 100644 --- a/servers/slapd/bind.c +++ b/servers/slapd/bind.c @@ -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 ); } diff --git a/servers/slapd/modrdn.c b/servers/slapd/modrdn.c index 66b7f93f78..a38160f4f2 100644 --- a/servers/slapd/modrdn.c +++ b/servers/slapd/modrdn.c @@ -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 ) { -- 2.39.5