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

This commit is contained in:
Kurt Zeilenga 2000-07-15 00:01:09 +00:00
parent c8ca70f3ae
commit 5bca08d716
3 changed files with 13 additions and 1 deletions

View File

@ -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 );

View File

@ -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;
}

View File

@ -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 */