From 00086db3f611e5be46e1c4840a68d1a9ce11299f Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Mon, 5 Jul 1999 23:01:17 +0000 Subject: [PATCH] Add get_ctrls()... --- servers/slapd/abandon.c | 2 -- servers/slapd/add.c | 2 -- servers/slapd/bind.c | 4 ++-- servers/slapd/compare.c | 2 -- servers/slapd/delete.c | 2 -- servers/slapd/libslapd.dsp | 4 ++++ servers/slapd/modify.c | 2 -- servers/slapd/monitor.c | 4 ---- servers/slapd/operation.c | 4 ++++ servers/slapd/search.c | 2 -- 10 files changed, 10 insertions(+), 18 deletions(-) diff --git a/servers/slapd/abandon.c b/servers/slapd/abandon.c index b8c3438576..d0eb0244e8 100644 --- a/servers/slapd/abandon.c +++ b/servers/slapd/abandon.c @@ -43,12 +43,10 @@ do_abandon( return LDAP_PROTOCOL_ERROR; } -#ifdef GET_CTRLS if( (rc = get_ctrls( conn, op, 0 )) != LDAP_SUCCESS ) { Debug( LDAP_DEBUG_ANY, "do_abandon: get_ctrls failed\n", 0, 0 ,0 ); return rc; } -#endif Debug( LDAP_DEBUG_ARGS, "do_abandon: id %d\n", id, 0 ,0 ); diff --git a/servers/slapd/add.c b/servers/slapd/add.c index b1db141b59..5e85be3aa7 100644 --- a/servers/slapd/add.c +++ b/servers/slapd/add.c @@ -110,13 +110,11 @@ do_add( Connection *conn, Operation *op ) return LDAP_PROTOCOL_ERROR; } -#ifdef GET_CTRLS if( (rc = get_ctrls( conn, op, 1 )) != LDAP_SUCCESS ) { entry_free( e ); Debug( LDAP_DEBUG_ANY, "do_add: get_ctrls failed\n", 0, 0, 0 ); return rc; } -#endif Statslog( LDAP_DEBUG_STATS, "conn=%d op=%d ADD dn=\"%s\"\n", conn->c_connid, op->o_opid, e->e_ndn, 0, 0 ); diff --git a/servers/slapd/bind.c b/servers/slapd/bind.c index 28133792e3..9586812e3e 100644 --- a/servers/slapd/bind.c +++ b/servers/slapd/bind.c @@ -108,6 +108,8 @@ do_bind( goto cleanup; } + op->o_protocol = version; + if( method != LDAP_AUTH_SASL ) { tag = ber_scanf( ber, /*{*/ "o}", &cred ); @@ -134,12 +136,10 @@ do_bind( goto cleanup; } -#ifdef GET_CTRLS if( (rc = get_ctrls( conn, op, 1 )) != LDAP_SUCCESS ) { Debug( LDAP_DEBUG_ANY, "do_bind: get_ctrls failed\n", 0, 0, 0 ); goto cleanup; } -#endif if( method == LDAP_AUTH_SASL ) { Debug( LDAP_DEBUG_TRACE, "do_sasl_bind: dn (%s) mech %s\n", diff --git a/servers/slapd/compare.c b/servers/slapd/compare.c index 544b7ca1cd..c07c8dabcb 100644 --- a/servers/slapd/compare.c +++ b/servers/slapd/compare.c @@ -58,14 +58,12 @@ do_compare( return rc; } -#ifdef GET_CTRLS if( ( rc = get_ctrls( conn, op, 1 )) != LDAP_SUCCESS ) { free( ndn ); ava_free( &ava, 0 ); Debug( LDAP_DEBUG_ANY, "do_compare: get_ctrls failed\n", 0, 0, 0 ); return rc; } -#endif value_normalize( ava.ava_value.bv_val, attr_syntax( ava.ava_type ) ); diff --git a/servers/slapd/delete.c b/servers/slapd/delete.c index 06253200a5..87b3207601 100644 --- a/servers/slapd/delete.c +++ b/servers/slapd/delete.c @@ -51,13 +51,11 @@ do_delete( return rc; } -#ifdef GET_CTRLS if( ( rc = get_ctrls( conn, op, 1 ) ) != LDAP_SUCCESS ) { free( ndn ); Debug( LDAP_DEBUG_ANY, "do_add: get_ctrls failed\n", 0, 0, 0 ); return rc; } -#endif Debug( LDAP_DEBUG_ARGS, "do_delete: dn (%s)\n", ndn, 0, 0 ); diff --git a/servers/slapd/libslapd.dsp b/servers/slapd/libslapd.dsp index 3c58616d44..6800343d72 100644 --- a/servers/slapd/libslapd.dsp +++ b/servers/slapd/libslapd.dsp @@ -180,6 +180,10 @@ SOURCE=.\connection.c # End Source File # Begin Source File +SOURCE=.\controls.c +# End Source File +# Begin Source File + SOURCE=.\daemon.c # End Source File # Begin Source File diff --git a/servers/slapd/modify.c b/servers/slapd/modify.c index c245a54c62..6be8038bdf 100644 --- a/servers/slapd/modify.c +++ b/servers/slapd/modify.c @@ -142,14 +142,12 @@ do_modify( } #endif -#ifdef GET_CTRLS if( (rc = get_ctrls( conn, op, 1 )) != LDAP_SUCCESS ) { free( ndn ); modlist_free( modlist ); Debug( LDAP_DEBUG_ANY, "do_modify: get_ctrls failed\n", 0, 0, 0 ); return rc; } -#endif Statslog( LDAP_DEBUG_STATS, "conn=%d op=%d MOD dn=\"%s\"\n", conn->c_connid, op->o_opid, ndn, 0, 0 ); diff --git a/servers/slapd/monitor.c b/servers/slapd/monitor.c index a37ab8b2a5..9dcf13d9e9 100644 --- a/servers/slapd/monitor.c +++ b/servers/slapd/monitor.c @@ -21,10 +21,6 @@ #include "ldap_defaults.h" #include "slap.h" -char *supportedControls[] = { - NULL -}; - char *supportedExtensions[] = { NULL }; diff --git a/servers/slapd/operation.c b/servers/slapd/operation.c index ddad7b9064..4ca92d801b 100644 --- a/servers/slapd/operation.c +++ b/servers/slapd/operation.c @@ -27,6 +27,9 @@ slap_op_free( Operation *op ) if ( op->o_authmech != NULL ) { free( op->o_authmech ); } + if ( op->o_ctrls != NULL ) { + ldap_controls_free( op->o_ctrls ); + } ldap_pvt_thread_mutex_destroy( &op->o_abandonmutex ); @@ -55,6 +58,7 @@ slap_op_alloc( op->o_dn = NULL; op->o_ndn = NULL; op->o_authmech = NULL; + op->o_ctrls = NULL; op->o_time = slap_get_time(); op->o_opid = id; diff --git a/servers/slapd/search.c b/servers/slapd/search.c index 25f7316379..fece855dc7 100644 --- a/servers/slapd/search.c +++ b/servers/slapd/search.c @@ -104,12 +104,10 @@ do_search( goto return_results; } -#ifdef GET_CTRLS if( (rc = get_ctrls( conn, op, 1 )) != LDAP_SUCCESS ) { Debug( LDAP_DEBUG_ANY, "do_search: get_ctrls failed\n", 0, 0, 0 ); goto return_results; } -#endif rc = 0;