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

Add c_protocol to slap_conn to track protocol version used by client.

Is initialized to 0 (unknown) and then set to 2 or 3 on bind.  Should
also be 0->3 if a special (or any) operation occurs before the bind.
parent 7662b7ea
No related branches found
No related tags found
No related merge requests found
......@@ -135,6 +135,8 @@ do_bind(
free( cred.bv_val );
}
conn->c_protocol = version;
send_ldap_result( conn, op, LDAP_SUCCESS, NULL, NULL );
return;
}
......@@ -152,6 +154,7 @@ do_bind(
free( cred.bv_val );
}
if ( cred.bv_len == 0 ) {
conn->c_protocol = version;
send_ldap_result( conn, op, LDAP_SUCCESS,
NULL, NULL );
} else if ( default_referral && *default_referral ) {
......@@ -173,6 +176,8 @@ do_bind(
if ( (*be->be_bind)( be, conn, op, ndn, method, &cred, &edn ) == 0 ) {
pthread_mutex_lock( &conn->c_dnmutex );
conn->c_protocol = version;
if ( conn->c_cdn != NULL ) {
free( conn->c_cdn );
}
......
......@@ -455,6 +455,7 @@ close_connection( Connection *conn, int opconnid, int opid )
close( conn->c_sb.sb_sd );
conn->c_sb.sb_sd = -1;
conn->c_version = 0;
conn->c_protocol = 0;
}
pthread_mutex_unlock( &new_conn_mutex );
}
......@@ -319,6 +319,7 @@ typedef struct slap_conn {
char *c_cdn; /* DN provided by the client */
char *c_dn; /* DN bound to this conn */
pthread_mutex_t c_dnmutex; /* mutex for c_dn field */
int c_protocol; /* version of the LDAP protocol used by client */
int c_authtype; /* auth method used to bind c_dn */
#ifdef LDAP_COMPAT
int c_version; /* for compatibility w/2.0, 3.0 */
......
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