mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-30 13:30:57 +08:00
Add framework for sasl and controls.
This commit is contained in:
parent
c0af81253a
commit
1ee85df297
@ -64,6 +64,7 @@ ldbm_back_bind(
|
|||||||
Operation *op,
|
Operation *op,
|
||||||
char *dn,
|
char *dn,
|
||||||
int method,
|
int method,
|
||||||
|
char *mech,
|
||||||
struct berval *cred,
|
struct berval *cred,
|
||||||
char** edn
|
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,
|
extern int ldbm_back_bind LDAP_P(( BackendDB *bd,
|
||||||
Connection *conn, Operation *op,
|
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,
|
extern int ldbm_back_unbind LDAP_P(( BackendDB *bd,
|
||||||
Connection *conn, Operation *op ));
|
Connection *conn, Operation *op ));
|
||||||
|
@ -164,7 +164,7 @@ do_bind(
|
|||||||
|
|
||||||
ndn = suffixAlias( ndn, op, be );
|
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 );
|
ldap_pvt_thread_mutex_lock( &conn->c_mutex );
|
||||||
|
|
||||||
conn->c_protocol = version;
|
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_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_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 );
|
slap_op_add( &conn->c_ops, arg->co_op );
|
||||||
|
|
||||||
if(tag == LDAP_REQ_BIND) {
|
if(tag == LDAP_REQ_BIND) {
|
||||||
|
@ -224,10 +224,6 @@ SOURCE=.\monitor.c
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\nt_debug.c
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\operation.c
|
SOURCE=.\operation.c
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
@ -76,13 +76,16 @@ do_modrdn(
|
|||||||
|
|
||||||
if ( ber_peek_tag( op->o_ber, &length ) == LDAP_TAG_NEWSUPERIOR ) {
|
if ( ber_peek_tag( op->o_ber, &length ) == LDAP_TAG_NEWSUPERIOR ) {
|
||||||
|
|
||||||
if ( conn->c_protocol == 0 ) {
|
if ( op->o_protocol == 0 ) {
|
||||||
/*
|
/*
|
||||||
* Promote to LDAPv3
|
* Promote to LDAPv3
|
||||||
*/
|
*/
|
||||||
|
ldap_pvt_thread_mutex_lock( &conn->c_mutex );
|
||||||
conn->c_protocol = LDAP_VERSION3;
|
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
|
/* Conection record indicates v2 but field
|
||||||
* newSuperior is present: report error.
|
* newSuperior is present: report error.
|
||||||
*/
|
*/
|
||||||
@ -103,7 +106,7 @@ do_modrdn(
|
|||||||
"" );
|
"" );
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}/* if ( ber_scanf( ber, { "a}", &newSuperior ) == ... ) */
|
}
|
||||||
|
|
||||||
|
|
||||||
Debug( LDAP_DEBUG_ARGS, "do_modrdn: newSuperior=(%s)\n",
|
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 );
|
dn_normalize_case( ndn );
|
||||||
|
|
||||||
@ -180,7 +183,7 @@ do_modrdn(
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}/* if ( (newSuperior_be != NULL) && ( be != newSuperior_be) ) */
|
}
|
||||||
|
|
||||||
|
|
||||||
/* alias suffix if approp */
|
/* alias suffix if approp */
|
||||||
|
@ -427,7 +427,8 @@ struct backend_info {
|
|||||||
/* LDAP Operations Handling Routines */
|
/* LDAP Operations Handling Routines */
|
||||||
int (*bi_op_bind) LDAP_P(( BackendDB *bd,
|
int (*bi_op_bind) LDAP_P(( BackendDB *bd,
|
||||||
struct slap_conn *c, struct slap_op *o,
|
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,
|
int (*bi_op_unbind) LDAP_P((BackendDB *bd,
|
||||||
struct slap_conn *c, struct slap_op *o ));
|
struct slap_conn *c, struct slap_op *o ));
|
||||||
int (*bi_op_search) LDAP_P((BackendDB *bd,
|
int (*bi_op_search) LDAP_P((BackendDB *bd,
|
||||||
@ -491,9 +492,13 @@ typedef struct slap_op {
|
|||||||
time_t o_time; /* time op was initiated */
|
time_t o_time; /* time op was initiated */
|
||||||
char *o_dn; /* dn bound when op was initiated */
|
char *o_dn; /* dn bound when op was initiated */
|
||||||
char *o_ndn; /* normalized 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 */
|
ber_tag_t o_authtype; /* auth method used to bind dn */
|
||||||
/* values taken from ldap.h */
|
/* values taken from ldap.h */
|
||||||
/* LDAP_AUTH_* */
|
/* LDAP_AUTH_* */
|
||||||
|
char *o_authmech; /* SASL mechanism used to bind dn */
|
||||||
|
|
||||||
|
LDAPControl **o_ctrls; /* controls */
|
||||||
|
|
||||||
/* long o_connid; *//* id of conn initiating this op */
|
/* 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 */
|
char *c_dn; /* DN bound to this conn */
|
||||||
ber_int_t c_protocol; /* version of the LDAP protocol used by client */
|
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 */
|
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_ops; /* list of operations being processed */
|
||||||
Operation *c_pending_ops; /* list of pending operations */
|
Operation *c_pending_ops; /* list of pending operations */
|
||||||
|
Loading…
Reference in New Issue
Block a user