mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-15 03:01:09 +08:00
Log out to stderr, add LDAP_VERSION3 support to bind.c and modrdn.c
This commit is contained in:
parent
2660d0b42f
commit
dcc5bdfe7e
@ -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 ) {
|
||||
|
Loading…
Reference in New Issue
Block a user