int
perl_back_add(
- Backend *be,
- Connection *conn,
Operation *op,
- Entry *e
-)
+ SlapReply *rs )
{
+ PerlBackend *perl_back = (PerlBackend *) op->o_bd->be_private;
int len;
int count;
- int return_code;
-
- PerlBackend *perl_back = (PerlBackend *) be->be_private;
ldap_pvt_thread_mutex_lock( &perl_interpreter_mutex );
ldap_pvt_thread_mutex_lock( &entry2str_mutex );
PUSHMARK(sp);
XPUSHs( perl_back->pb_obj_ref );
- XPUSHs(sv_2mortal(newSVpv( entry2str( e, &len ), 0 )));
+ XPUSHs(sv_2mortal(newSVpv( entry2str( op->ora_e, &len ), 0 )));
PUTBACK;
croak("Big trouble in back_add\n");
}
- return_code = POPi;
+ rs->sr_err = POPi;
PUTBACK; FREETMPS; LEAVE;
}
ldap_pvt_thread_mutex_unlock( &entry2str_mutex );
ldap_pvt_thread_mutex_unlock( &perl_interpreter_mutex );
- send_ldap_result( conn, op, return_code,
- NULL, NULL, NULL, NULL );
+ send_ldap_result( op, rs );
Debug( LDAP_DEBUG_ANY, "Perl ADD\n", 0, 0, 0 );
return( 0 );
**********************************************************/
int
perl_back_bind(
- Backend *be,
- Connection *conn,
Operation *op,
- struct berval *dn,
- struct berval *ndn,
- int method,
- struct berval *cred,
- struct berval *edn
-)
+ SlapReply *rs )
{
- int return_code;
int count;
- PerlBackend *perl_back = (PerlBackend *) be->be_private;
+ PerlBackend *perl_back = (PerlBackend *) op->o_bd->be_private;
#ifdef HAVE_WIN32_ASPERL
PERL_SET_CONTEXT( PERL_INTERPRETER );
PUSHMARK(SP);
XPUSHs( perl_back->pb_obj_ref );
- XPUSHs(sv_2mortal(newSVpv( dn->bv_val , 0)));
- XPUSHs(sv_2mortal(newSVpv( cred->bv_val , cred->bv_len)));
+ XPUSHs(sv_2mortal(newSVpv( op->o_req_dn.bv_val , 0)));
+ XPUSHs(sv_2mortal(newSVpv( op->orb_cred.bv_val , op->orb_cred.bv_len)));
PUTBACK;
#ifdef PERL_IS_5_6
croak("Big trouble in back_bind\n");
}
- return_code = POPi;
+ rs->sr_err = POPi;
PUTBACK; FREETMPS; LEAVE;
ldap_pvt_thread_mutex_unlock( &perl_interpreter_mutex );
- Debug( LDAP_DEBUG_ANY, "Perl BIND returned 0x%04x\n", return_code, 0, 0 );
+ Debug( LDAP_DEBUG_ANY, "Perl BIND returned 0x%04x\n", rs->sr_err, 0, 0 );
/* frontend will send result on success (0) */
- if( return_code != LDAP_SUCCESS )
- send_ldap_result( conn, op, return_code, NULL, NULL, NULL, NULL );
+ if( rs->sr_err != LDAP_SUCCESS )
+ send_ldap_result( op, rs );
- return ( return_code );
+ return ( rs->sr_err );
}
int
perl_back_compare(
- Backend *be,
- Connection *conn,
Operation *op,
- struct berval *dn,
- struct berval *ndn,
- AttributeAssertion *ava
-)
+ SlapReply *rs )
{
- int return_code;
int count;
char *avastr, *ptr;
- PerlBackend *perl_back = (PerlBackend *)be->be_private;
+ PerlBackend *perl_back = (PerlBackend *)op->o_bd->be_private;
- avastr = ch_malloc( ava->aa_desc->ad_cname.bv_len + 1 +
- ava->aa_value.bv_len + 1 );
+ avastr = ch_malloc( op->orc_ava->aa_desc->ad_cname.bv_len + 1 +
+ op->orc_ava->aa_value.bv_len + 1 );
lutil_strcopy( lutil_strcopy( lutil_strcopy( avastr,
- ava->aa_desc->ad_cname.bv_val ), "=" ),
- ava->aa_value.bv_val );
+ op->orc_ava->aa_desc->ad_cname.bv_val ), "=" ),
+ op->orc_ava->aa_value.bv_val );
ldap_pvt_thread_mutex_lock( &perl_interpreter_mutex );
PUSHMARK(sp);
XPUSHs( perl_back->pb_obj_ref );
- XPUSHs(sv_2mortal(newSVpv( dn->bv_val , 0)));
+ XPUSHs(sv_2mortal(newSVpv( op->o_req_dn.bv_val , 0)));
XPUSHs(sv_2mortal(newSVpv( avastr , 0)));
PUTBACK;
croak("Big trouble in back_compare\n");
}
- return_code = POPi;
-
+ rs->sr_err = POPi;
+
PUTBACK; FREETMPS; LEAVE;
}
ch_free( avastr );
- send_ldap_result( conn, op, return_code,
- NULL, NULL, NULL, NULL );
+ send_ldap_result( op, rs );
Debug( LDAP_DEBUG_ANY, "Perl COMPARE\n", 0, 0, 0 );
int
perl_back_delete(
- Backend *be,
- Connection *conn,
Operation *op,
- struct berval *dn,
- struct berval *ndn
-)
+ SlapReply *rs )
{
- int len;
+ PerlBackend *perl_back = (PerlBackend *) op->o_bd->be_private;
int count;
- int return_code;
-
- PerlBackend *perl_back = (PerlBackend *) be->be_private;
ldap_pvt_thread_mutex_lock( &perl_interpreter_mutex );
PUSHMARK(sp);
XPUSHs( perl_back->pb_obj_ref );
- XPUSHs(sv_2mortal(newSVpv( dn->bv_val , 0 )));
+ XPUSHs(sv_2mortal(newSVpv( op->o_req_dn.bv_val , 0 )));
PUTBACK;
if (count != 1) {
croak("Big trouble in perl-back_delete\n");
}
-
- return_code = POPi;
+
+ rs->sr_err = POPi;
PUTBACK; FREETMPS; LEAVE;
}
ldap_pvt_thread_mutex_unlock( &perl_interpreter_mutex );
- send_ldap_result( conn, op, return_code,
- NULL, NULL, NULL, NULL );
+ send_ldap_result( op, rs );
Debug( LDAP_DEBUG_ANY, "Perl DELETE\n", 0, 0, 0 );
return( 0 );
int
perl_back_modify(
- Backend *be,
- Connection *conn,
Operation *op,
- struct berval *dn,
- struct berval *ndn,
- Modifications *modlist
-)
+ SlapReply *rs )
{
- char test[500];
- int return_code;
+ PerlBackend *perl_back = (PerlBackend *)op->o_bd->be_private;
+ Modifications *modlist = op->orm_modlist;
int count;
int i;
- int err = 0;
- char *matched = NULL, *info = NULL;
- PerlBackend *perl_back = (PerlBackend *)be->be_private;
ldap_pvt_thread_mutex_lock( &perl_interpreter_mutex );
PUSHMARK(sp);
XPUSHs( perl_back->pb_obj_ref );
- XPUSHs(sv_2mortal(newSVpv( dn->bv_val , 0)));
+ XPUSHs(sv_2mortal(newSVpv( op->o_req_dn.bv_val , 0)));
for (; modlist != NULL; modlist = modlist->sml_next ) {
Modification *mods = &modlist->sml_mod;
croak("Big trouble in back_modify\n");
}
- return_code = POPi;
+ rs->sr_err = POPi;
PUTBACK; FREETMPS; LEAVE;
}
ldap_pvt_thread_mutex_unlock( &perl_interpreter_mutex );
- send_ldap_result( conn, op, return_code,
- NULL, NULL, NULL, NULL );
+ send_ldap_result( op, rs );
Debug( LDAP_DEBUG_ANY, "Perl MODIFY\n", 0, 0, 0 );
return( 0 );
int
perl_back_modrdn(
- Backend *be,
- Connection *conn,
Operation *op,
- struct berval *dn,
- struct berval *ndn,
- struct berval *newrdn,
- struct berval *nnewrdn,
- int deleteoldrdn,
- struct berval *newSuperior,
- struct berval *nnewSuperior
-)
+ SlapReply *rs )
{
- int len;
+ PerlBackend *perl_back = (PerlBackend *) op->o_bd->be_private;
int count;
- int return_code;
-
- PerlBackend *perl_back = (PerlBackend *) be->be_private;
ldap_pvt_thread_mutex_lock( &perl_interpreter_mutex );
PUSHMARK(sp) ;
XPUSHs( perl_back->pb_obj_ref );
- XPUSHs(sv_2mortal(newSVpv( dn->bv_val , 0 )));
- XPUSHs(sv_2mortal(newSVpv( newrdn->bv_val , 0 )));
- XPUSHs(sv_2mortal(newSViv( deleteoldrdn )));
- if ( newSuperior != NULL ) {
- XPUSHs(sv_2mortal(newSVpv( newSuperior->bv_val , 0 )));
+ XPUSHs(sv_2mortal(newSVpv( op->o_req_dn.bv_val , 0 )));
+ XPUSHs(sv_2mortal(newSVpv( op->orr_newrdn.bv_val , 0 )));
+ XPUSHs(sv_2mortal(newSViv( op->orr_deleteoldrdn )));
+ if ( op->orr_newSup != NULL ) {
+ XPUSHs(sv_2mortal(newSVpv( op->orr_newSup->bv_val , 0 )));
}
PUTBACK ;
croak("Big trouble in back_modrdn\n") ;
}
- return_code = POPi;
+ rs->sr_err = POPi;
PUTBACK; FREETMPS; LEAVE ;
}
ldap_pvt_thread_mutex_unlock( &perl_interpreter_mutex );
- send_ldap_result( conn, op, return_code,
- NULL, NULL, NULL, NULL );
+ send_ldap_result( op, rs );
Debug( LDAP_DEBUG_ANY, "Perl MODRDN\n", 0, 0, 0 );
return( 0 );
**********************************************************/
int
perl_back_search(
- Backend *be,
- Connection *conn,
Operation *op,
- struct berval *base,
- struct berval *nbase,
- int scope,
- int deref,
- int sizelimit,
- int timelimit,
- Filter *filter,
- struct berval *filterstr,
- AttributeName *attrs,
- int attrsonly
- )
+ SlapReply *rs )
{
- char test[500];
+ PerlBackend *perl_back = (PerlBackend *)op->o_bd->be_private;
int count ;
- int err = 0;
- char *matched = NULL, *info = NULL;
- PerlBackend *perl_back = (PerlBackend *)be->be_private;
AttributeName *an;
Entry *e;
char *buf;
int i;
- int return_code;
ldap_pvt_thread_mutex_lock( &perl_interpreter_mutex );
PUSHMARK(sp) ;
XPUSHs( perl_back->pb_obj_ref );
- XPUSHs(sv_2mortal(newSVpv( nbase->bv_val , 0)));
- XPUSHs(sv_2mortal(newSViv( scope )));
- XPUSHs(sv_2mortal(newSViv( deref )));
- XPUSHs(sv_2mortal(newSViv( sizelimit )));
- XPUSHs(sv_2mortal(newSViv( timelimit )));
- XPUSHs(sv_2mortal(newSVpv( filterstr->bv_val , 0)));
- XPUSHs(sv_2mortal(newSViv( attrsonly )));
-
- for ( an = attrs; an && an->an_name.bv_val; an++ ) {
+ XPUSHs(sv_2mortal(newSVpv( op->o_req_ndn.bv_val , 0)));
+ XPUSHs(sv_2mortal(newSViv( op->ors_scope )));
+ XPUSHs(sv_2mortal(newSViv( op->ors_deref )));
+ XPUSHs(sv_2mortal(newSViv( op->ors_slimit )));
+ XPUSHs(sv_2mortal(newSViv( op->ors_tlimit )));
+ XPUSHs(sv_2mortal(newSVpv( op->ors_filterstr.bv_val , 0)));
+ XPUSHs(sv_2mortal(newSViv( op->ors_attrsonly )));
+
+ for ( an = op->ors_attrs; an && an->an_name.bv_val; an++ ) {
XPUSHs(sv_2mortal(newSVpv( an->an_name.bv_val , 0)));
}
PUTBACK;
int send_entry;
if (perl_back->pb_filter_search_results)
- send_entry = (test_filter( be, conn, op, e, filter ) == LDAP_COMPARE_TRUE);
+ send_entry = (test_filter( op, e, op->ors_filter ) == LDAP_COMPARE_TRUE);
else
send_entry = 1;
if (send_entry) {
- send_search_entry( be, conn, op,
- e, attrs, attrsonly, NULL );
+ rs->sr_entry = e;
+ rs->sr_attrs = op->ors_attrs;
+ send_search_entry( op, rs );
}
entry_free( e );
* ex stack: <$res_2> <$res_1> <0>
*/
- return_code = POPi;
+ rs->sr_err = POPi;
ldap_pvt_thread_mutex_unlock( &perl_interpreter_mutex );
- send_ldap_result( conn, op, return_code,
- NULL, NULL, NULL, NULL );
+ send_ldap_result( op, rs );
return 0;
}