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

Store sasl callbacks in session handle so that they can properly freed.

parent c8ca70f3
No related branches found
No related tags found
No related merge requests found
......@@ -379,6 +379,7 @@ long connection_init(
c->c_sasl_bind_mech = NULL;
c->c_sasl_context = NULL;
c->c_sasl_extra = NULL;
c->c_sb = ber_sockbuf_alloc( );
c->c_currentber = NULL;
......@@ -405,6 +406,7 @@ long connection_init(
assert( c->c_pending_ops == NULL );
assert( c->c_sasl_bind_mech == NULL );
assert( c->c_sasl_context == NULL );
assert( c->c_sasl_extra == NULL );
assert( c->c_currentber == NULL );
c->c_listener_url = ch_strdup( url );
......
......@@ -231,8 +231,14 @@ int slap_sasl_open( Connection *conn )
#ifdef HAVE_CYRUS_SASL
sasl_conn_t *ctx = NULL;
sasl_callback_t *session_callbacks =
sasl_callback_t *session_callbacks;
assert( conn->c_sasl_context == NULL );
assert( conn->c_sasl_extra == NULL );
session_callbacks =
ch_calloc( 3, sizeof(sasl_callback_t));
conn->c_sasl_extra = session_callbacks;
session_callbacks[0].id = SASL_CB_LOG;
session_callbacks[0].proc = &sasl_cb_log;
......@@ -363,6 +369,9 @@ int slap_sasl_close( Connection *conn )
}
conn->c_sasl_context = NULL;
free( conn->c_sasl_extra );
conn->c_sasl_extra = NULL;
#endif
return LDAP_SUCCESS;
}
......
......@@ -1067,6 +1067,7 @@ typedef struct slap_conn {
int c_needs_tls_accept; /* true if SSL_accept should be called */
#endif
void *c_sasl_context; /* SASL session context */
void *c_sasl_extra; /* SASL session extra stuff */
long c_n_ops_received; /* num of ops received (next op_id) */
long c_n_ops_executing; /* num of ops currently executing */
......
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