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

Add framework for sasl and controls.

parent c0af8125
No related branches found
No related tags found
No related merge requests found
......@@ -64,6 +64,7 @@ ldbm_back_bind(
Operation *op,
char *dn,
int method,
char *mech,
struct berval *cred,
char** edn
)
......
......@@ -18,7 +18,7 @@ extern int ldbm_back_db_config LDAP_P(( BackendDB *bd,
extern int ldbm_back_bind LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
char *dn, int method, struct berval *cred, char** edn ));
char *dn, int method, char* mech, struct berval *cred, char** edn ));
extern int ldbm_back_unbind LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op ));
......
......@@ -164,7 +164,7 @@ do_bind(
ndn = suffixAlias( ndn, op, be );
if ( (*be->be_bind)( be, conn, op, ndn, method, &cred, &edn ) == 0 ) {
if ( (*be->be_bind)( be, conn, op, ndn, method, NULL, &cred, &edn ) == 0 ) {
ldap_pvt_thread_mutex_lock( &conn->c_mutex );
conn->c_protocol = version;
......
......@@ -898,6 +898,8 @@ static int connection_op_activate( Connection *conn, Operation *op )
arg->co_op->o_dn = ch_strdup( tmpdn != NULL ? tmpdn : "" );
arg->co_op->o_ndn = dn_normalize_case( ch_strdup( arg->co_op->o_dn ) );
arg->co_op->o_protocol = conn->c_protocol;
slap_op_add( &conn->c_ops, arg->co_op );
if(tag == LDAP_REQ_BIND) {
......
......@@ -224,10 +224,6 @@ SOURCE=.\monitor.c
# End Source File
# Begin Source File
SOURCE=.\nt_debug.c
# End Source File
# Begin Source File
SOURCE=.\operation.c
# End Source File
# Begin Source File
......
......@@ -76,13 +76,16 @@ do_modrdn(
if ( ber_peek_tag( op->o_ber, &length ) == LDAP_TAG_NEWSUPERIOR ) {
if ( conn->c_protocol == 0 ) {
if ( op->o_protocol == 0 ) {
/*
* Promote to LDAPv3
*/
ldap_pvt_thread_mutex_lock( &conn->c_mutex );
conn->c_protocol = LDAP_VERSION3;
ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
op->o_protocol = LDAP_VERSION3;
} else if ( conn->c_protocol < LDAP_VERSION3 ) {
} else if ( op->o_protocol < LDAP_VERSION3 ) {
/* Conection record indicates v2 but field
* newSuperior is present: report error.
*/
......@@ -103,7 +106,7 @@ do_modrdn(
"" );
return;
}/* if ( ber_scanf( ber, { "a}", &newSuperior ) == ... ) */
}
Debug( LDAP_DEBUG_ARGS, "do_modrdn: newSuperior=(%s)\n",
......@@ -138,7 +141,7 @@ do_modrdn(
}
}/* if ( ber_peek_tag( op->o_ber, &length ) == LDAP_TAG_NEWSUPERIOR )*/
}
dn_normalize_case( ndn );
......@@ -180,7 +183,7 @@ do_modrdn(
return;
}/* if ( (newSuperior_be != NULL) && ( be != newSuperior_be) ) */
}
/* alias suffix if approp */
......
......@@ -427,7 +427,8 @@ struct backend_info {
/* LDAP Operations Handling Routines */
int (*bi_op_bind) LDAP_P(( BackendDB *bd,
struct slap_conn *c, struct slap_op *o,
char *dn, int method, struct berval *cred, char** edn ));
char *dn, int method, char* mechanism,
struct berval *cred, char** edn ));
int (*bi_op_unbind) LDAP_P((BackendDB *bd,
struct slap_conn *c, struct slap_op *o ));
int (*bi_op_search) LDAP_P((BackendDB *bd,
......@@ -491,9 +492,13 @@ typedef struct slap_op {
time_t o_time; /* time op was initiated */
char *o_dn; /* dn bound when op was initiated */
char *o_ndn; /* normalized dn bound when op was initiated */
ber_int_t o_protocol; /* version of the LDAP protocol used by client */
ber_tag_t o_authtype; /* auth method used to bind dn */
/* values taken from ldap.h */
/* LDAP_AUTH_* */
char *o_authmech; /* SASL mechanism used to bind dn */
LDAPControl **o_ctrls; /* controls */
/* long o_connid; *//* id of conn initiating this op */
......@@ -533,6 +538,7 @@ typedef struct slap_conn {
char *c_dn; /* DN bound to this conn */
ber_int_t c_protocol; /* version of the LDAP protocol used by client */
ber_tag_t c_authtype; /* auth method used to bind c_dn */
char *c_authmech; /* SASL mechanism used to bind c_dn */
Operation *c_ops; /* list of operations being processed */
Operation *c_pending_ops; /* list of pending operations */
......
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