]> git.sur5r.net Git - openldap/commitdiff
ITS#7149 more for back-perl, always use bv_len when available
authorHoward Chu <hyc@openldap.org>
Thu, 29 Mar 2012 13:11:55 +0000 (06:11 -0700)
committerHoward Chu <hyc@openldap.org>
Thu, 29 Mar 2012 13:11:55 +0000 (06:11 -0700)
servers/slapd/back-perl/add.c
servers/slapd/back-perl/bind.c
servers/slapd/back-perl/compare.c
servers/slapd/back-perl/delete.c
servers/slapd/back-perl/modrdn.c
servers/slapd/back-perl/search.c

index 2fb9b9e00dffec5d1a3fcb6bae1296dada641016..0df962b422824041948711a2ea9f0b31342cbd6f 100644 (file)
@@ -35,7 +35,7 @@ perl_back_add(
 
                PUSHMARK(sp);
                XPUSHs( perl_back->pb_obj_ref );
-               XPUSHs(sv_2mortal(newSVpv( entry2str( op->ora_e, &len ), 0 )));
+               XPUSHs(sv_2mortal(newSVpv( entry2str( op->ora_e, &len ), len )));
 
                PUTBACK;
 
index 5b6c8e7d88654c4f8cd60f2b157d100bb0d57fb3..192b403fd512e34415bf04c8823e1479ad2a01ed 100644 (file)
@@ -50,7 +50,7 @@ perl_back_bind(
 
                PUSHMARK(SP);
                XPUSHs( perl_back->pb_obj_ref );
-               XPUSHs(sv_2mortal(newSVpv( op->o_req_dn.bv_val , 0)));
+               XPUSHs(sv_2mortal(newSVpv( op->o_req_dn.bv_val , op->o_req_dn.bv_len)));
                XPUSHs(sv_2mortal(newSVpv( op->orb_cred.bv_val , op->orb_cred.bv_len)));
                PUTBACK;
 
index 0bd3dd6dfa219ac1d0715bb5484a32aed6860960..7cb561401df5552021b80e5f1d4e2ca5f5415a75 100644 (file)
@@ -29,14 +29,15 @@ perl_back_compare(
        Operation       *op,
        SlapReply       *rs )
 {
-       int count;
+       int count, avalen;
        char *avastr;
 
        PerlBackend *perl_back = (PerlBackend *)op->o_bd->be_private;
 
-       avastr = ch_malloc( op->orc_ava->aa_desc->ad_cname.bv_len + 1 +
-               op->orc_ava->aa_value.bv_len + 1 );
-       
+       avalen = op->orc_ava->aa_desc->ad_cname.bv_len + 1 +
+               op->orc_ava->aa_value.bv_len;
+       avastr = ch_malloc( avalen + 1 );
+
        lutil_strcopy( lutil_strcopy( lutil_strcopy( avastr,
                op->orc_ava->aa_desc->ad_cname.bv_val ), "=" ),
                op->orc_ava->aa_value.bv_val );
@@ -49,8 +50,8 @@ perl_back_compare(
 
                PUSHMARK(sp);
                XPUSHs( perl_back->pb_obj_ref );
-               XPUSHs(sv_2mortal(newSVpv( op->o_req_dn.bv_val , 0)));
-               XPUSHs(sv_2mortal(newSVpv( avastr , 0)));
+               XPUSHs(sv_2mortal(newSVpv( op->o_req_dn.bv_val , op->o_req_dn.bv_len)));
+               XPUSHs(sv_2mortal(newSVpv( avastr , avalen)));
                PUTBACK;
 
                count = call_method("compare", G_SCALAR);
index 80c96074808aa1559f47115010c533e484c6af5f..f72a540697d9a34feb17c58a85d9206696297505 100644 (file)
@@ -33,7 +33,7 @@ perl_back_delete(
 
                PUSHMARK(sp);
                XPUSHs( perl_back->pb_obj_ref );
-               XPUSHs(sv_2mortal(newSVpv( op->o_req_dn.bv_val , 0 )));
+               XPUSHs(sv_2mortal(newSVpv( op->o_req_dn.bv_val , op->o_req_dn.bv_len )));
 
                PUTBACK;
 
index 31ff2001d517d96239670760e73e7dee0fa30c29..dcfb080c469e85efe3beaf8c0036b49a661471c4 100644 (file)
@@ -33,11 +33,11 @@ perl_back_modrdn(
                
                PUSHMARK(sp) ;
                XPUSHs( perl_back->pb_obj_ref );
-               XPUSHs(sv_2mortal(newSVpv( op->o_req_dn.bv_val , 0 )));
-               XPUSHs(sv_2mortal(newSVpv( op->orr_newrdn.bv_val , 0 )));
+               XPUSHs(sv_2mortal(newSVpv( op->o_req_dn.bv_val , op->o_req_dn.bv_len )));
+               XPUSHs(sv_2mortal(newSVpv( op->orr_newrdn.bv_val , op->orr_newrdn.bv_len )));
                XPUSHs(sv_2mortal(newSViv( op->orr_deleteoldrdn )));
                if ( op->orr_newSup != NULL ) {
-                       XPUSHs(sv_2mortal(newSVpv( op->orr_newSup->bv_val , 0 )));
+                       XPUSHs(sv_2mortal(newSVpv( op->orr_newSup->bv_val , op->orr_newSup->bv_len )));
                }
                PUTBACK ;
 
index c7428010f816d4c1d8da5ac6b8469d0d958c041d..220e89c77987b78ad78d7b5e57880a8a91379051 100644 (file)
@@ -42,16 +42,16 @@ perl_back_search(
 
                PUSHMARK(sp) ;
                XPUSHs( perl_back->pb_obj_ref );
-               XPUSHs(sv_2mortal(newSVpv( op->o_req_ndn.bv_val , 0)));
+               XPUSHs(sv_2mortal(newSVpv( op->o_req_ndn.bv_val , op->o_req_ndn.bv_len)));
                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(newSVpv( op->ors_filterstr.bv_val , op->ors_filterstr.bv_len)));
                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)));
+                       XPUSHs(sv_2mortal(newSVpv( an->an_name.bv_val , an->an_name.bv_len)));
                }
                PUTBACK;