Skip to content
Snippets Groups Projects
Commit dcc5bdfe authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Log out to stderr, add LDAP_VERSION3 support to bind.c and modrdn.c

parent 2660d0b4
No related branches found
No related tags found
No related merge requests found
......@@ -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 );
}
......@@ -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 );
}
......
......@@ -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 ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment