Lines Matching refs:op
99 { "logops", "op|writes|reads|session|all", 2, 0, 0,
122 { "logbase", "op|writes|reads|session|all< <baseDN", 3, 3, 0,
583 log_old_lookup( Operation *op, SlapReply *rs )
585 purge_data *pd = op->o_callback->sc_private;
627 Operation *op;
638 op = &opbuf.ob_op;
651 op->o_tag = LDAP_REQ_SEARCH;
652 op->o_bd = li->li_db;
653 op->o_dn = li->li_db->be_rootdn;
654 op->o_ndn = li->li_db->be_rootndn;
655 op->o_req_dn = li->li_db->be_suffix[0];
656 op->o_req_ndn = li->li_db->be_nsuffix[0];
657 op->o_callback = &cb;
658 op->ors_scope = LDAP_SCOPE_ONELEVEL;
659 op->ors_deref = LDAP_DEREF_NEVER;
660 op->ors_tlimit = SLAP_NO_LIMIT;
661 op->ors_slimit = SLAP_NO_LIMIT;
662 op->ors_filter = &f;
663 filter2bv_x( op, &f, &op->ors_filterstr );
664 op->ors_attrs = slap_anlist_no_attrs;
665 op->ors_attrsonly = 1;
672 op->o_bd->be_search( op, &rs );
673 op->o_tmpfree( op->ors_filterstr.bv_val, op->o_tmpmemctx );
679 op->o_tag = LDAP_REQ_DELETE;
680 op->o_callback = &nullsc;
681 op->o_csn = pd.csn;
682 op->o_dont_replicate = 1;
685 op->o_req_dn = pd.dn[i];
686 op->o_req_ndn = pd.ndn[i];
689 op->o_bd->be_delete( op, &rs );
712 op->o_tag = LDAP_REQ_MODIFY;
713 op->orm_modlist = &mod;
714 op->orm_no_opattrs = 1;
715 op->o_req_dn = li->li_db->be_suffix[0];
716 op->o_req_ndn = li->li_db->be_nsuffix[0];
717 op->o_no_schema_check = 1;
718 op->o_managedsait = SLAP_CONTROL_NONCRITICAL;
719 op->o_bd->be_modify( op, &rs );
743 switch( c->op ) {
1281 static Entry *accesslog_entry( Operation *op, SlapReply *rs, int logop,
1283 slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
1301 slap_timestamp( &op->o_time, ×tamp );
1302 snprintf( timestamp.bv_val + timestamp.bv_len-1, sizeof(".123456Z"), ".%06dZ", op->o_tincr );
1309 op->o_tmpmemctx );
1321 op->o_tmpfree( ntimestamp.bv_val, op->o_tmpmemctx );
1330 attr_merge_normalize_one( e, ad_reqEnd, ×tamp, op->o_tmpmemctx );
1334 bv.bv_len = lo->word.bv_len + op->ore_reqoid.bv_len + 2;
1338 AC_MEMCPY( bv.bv_val+lo->word.bv_len+1, op->ore_reqoid.bv_val,
1339 op->ore_reqoid.bv_len );
1347 rdn.bv_len = snprintf( rdn.bv_val, sizeof( rdnbuf ), "%lu", op->o_connid );
1352 if ( BER_BVISNULL( &op->o_dn ) ) {
1356 attr_merge_one( e, ad_reqAuthzID, &op->o_dn, &op->o_ndn );
1360 if ( op->o_ctrls ) {
1364 if ( accesslog_ctrls( op->o_ctrls, &vals, &nvals,
1365 op->o_tmpmemctx ) == LDAP_SUCCESS && vals )
1368 ber_bvarray_free_x( vals, op->o_tmpmemctx );
1369 ber_bvarray_free_x( nvals, op->o_tmpmemctx );
1378 op->o_tmpmemctx ) == LDAP_SUCCESS && vals )
1381 ber_bvarray_free_x( vals, op->o_tmpmemctx );
1382 ber_bvarray_free_x( nvals, op->o_tmpmemctx );
1424 static int accesslog_response(Operation *op, SlapReply *rs) {
1425 slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
1444 switch ( op->o_tag ) {
1463 if (( lb->lb_ops & lo->mask ) && dnIsSuffix( &op->o_req_ndn, &lb->lb_base )) {
1475 if ( op->o_dont_replicate && op->orm_no_opattrs )
1482 for ( cb = op->o_callback; cb; cb = cb->sc_next ) {
1488 ldap_pvt_thread_rmutex_unlock( &li->li_op_rmutex, op->o_tid );
1494 e = accesslog_entry( op, rs, logop, &op2 );
1496 attr_merge_one( e, ad_reqDN, &op->o_req_dn, &op->o_req_ndn );
1517 e2 = op->ora_e;
1553 for ( m = op->orm_modlist; m; m = m->sml_next ) {
1580 for ( m = op->orm_modlist; m; m = m->sml_next ) {
1607 /* unknown op. there shouldn't be any of these. we
1678 attr_merge_one( e, ad_reqNewRDN, &op->orr_newrdn, &op->orr_nnewrdn );
1679 attr_merge_one( e, ad_reqDeleteOldRDN, op->orr_deleteoldrdn ?
1682 if ( op->orr_newSup ) {
1683 attr_merge_one( e, ad_reqNewSuperior, op->orr_newSup, op->orr_nnewSup );
1688 bv.bv_len = op->orc_ava->aa_desc->ad_cname.bv_len + 1 +
1689 op->orc_ava->aa_value.bv_len;
1690 bv.bv_val = op->o_tmpalloc( bv.bv_len+1, op->o_tmpmemctx );
1691 ptr = lutil_strcopy( bv.bv_val, op->orc_ava->aa_desc->ad_cname.bv_val );
1693 AC_MEMCPY( ptr, op->orc_ava->aa_value.bv_val, op->orc_ava->aa_value.bv_len );
1696 op->o_tmpfree( bv.bv_val, op->o_tmpmemctx );
1700 attr_merge_one( e, ad_reqScope, &scopes[op->ors_scope], NULL );
1701 attr_merge_one( e, ad_reqDerefAliases, &derefs[op->ors_deref], NULL );
1702 attr_merge_one( e, ad_reqAttrsOnly, op->ors_attrsonly ?
1705 if ( !BER_BVISEMPTY( &op->ors_filterstr ))
1706 attr_merge_one( e, ad_reqFilter, &op->ors_filterstr, NULL );
1707 if ( op->ors_attrs ) {
1710 for (i=0; !BER_BVISNULL(&op->ors_attrs[i].an_name );i++)
1712 vals = op->o_tmpalloc( (i+1) * sizeof(struct berval),
1713 op->o_tmpmemctx );
1714 for (i=0, j=0; !BER_BVISNULL(&op->ors_attrs[i].an_name );i++) {
1715 if (!BER_BVISEMPTY(&op->ors_attrs[i].an_name)) {
1716 vals[j] = op->ors_attrs[i].an_name;
1722 op->o_tmpfree( vals, op->o_tmpmemctx );
1730 bv.bv_len = snprintf( bv.bv_val, sizeof( timebuf ), "%d", op->ors_tlimit );
1735 bv.bv_len = snprintf( bv.bv_val, sizeof( timebuf ), "%d", op->ors_slimit );
1743 bv.bv_len = snprintf( bv.bv_val, sizeof( timebuf ), "%d", op->o_protocol );
1747 if ( op->orb_method == LDAP_AUTH_SIMPLE ) {
1750 bv.bv_len = STRLENOF("SASL()") + op->orb_mech.bv_len;
1751 bv.bv_val = op->o_tmpalloc( bv.bv_len + 1, op->o_tmpmemctx );
1753 ptr = lutil_strcopy( ptr, op->orb_mech.bv_val );
1757 op->o_tmpfree( bv.bv_val, op->o_tmpmemctx );
1763 if ( op->ore_reqdata ) {
1764 attr_merge_one( e, ad_reqData, op->ore_reqdata, NULL );
1773 op2.o_hdr = op->o_hdr;
1783 if (( lo->mask & LOG_OP_WRITES ) && !BER_BVISEMPTY( &op->o_csn )) {
1784 slap_queue_csn( &op2, &op->o_csn );
1803 accesslog_bind_resp( Operation *op, SlapReply *rs )
1809 be = op->o_bd;
1811 op->o_bd = &db;
1812 db.bd_info = op->o_callback->sc_private;
1813 rc = accesslog_response( op, rs );
1814 op->o_bd = be;
1815 sc = op->o_callback;
1816 op->o_callback = sc->sc_next;
1817 op->o_tmpfree( sc, op->o_tmpmemctx );
1822 accesslog_op_bind( Operation *op, SlapReply *rs )
1826 sc = op->o_tmpcalloc( 1, sizeof(slap_callback), op->o_tmpmemctx );
1828 sc->sc_private = op->o_bd->bd_info;
1830 if ( op->o_callback ) {
1831 sc->sc_next = op->o_callback->sc_next;
1832 op->o_callback->sc_next = sc;
1834 op->o_callback = sc;
1840 accesslog_mod_cleanup( Operation *op, SlapReply *rs )
1842 slap_callback *sc = op->o_callback;
1844 op->o_callback = sc->sc_next;
1846 op->o_tmpfree( sc, op->o_tmpmemctx );
1849 BackendInfo *bi = op->o_bd->bd_info;
1850 op->o_bd->bd_info = (BackendInfo *)on;
1851 accesslog_response( op, rs );
1852 op->o_bd->bd_info = bi;
1858 accesslog_op_mod( Operation *op, SlapReply *rs )
1860 slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
1865 if ( op->o_dont_replicate && op->orm_no_opattrs )
1874 if (( lb->lb_ops & LOG_OP_WRITES ) && dnIsSuffix( &op->o_req_ndn, &lb->lb_base )) {
1881 slap_callback *cb = op->o_tmpalloc( sizeof( slap_callback ), op->o_tmpmemctx ), *cb2;
1886 for ( cb2 = op->o_callback; cb2->sc_next; cb2 = cb2->sc_next );
1889 ldap_pvt_thread_rmutex_lock( &li->li_op_rmutex, op->o_tid );
1890 if ( li->li_oldf && ( op->o_tag == LDAP_REQ_DELETE ||
1891 op->o_tag == LDAP_REQ_MODIFY ||
1892 ( op->o_tag == LDAP_REQ_MODRDN && li->li_oldattrs ))) {
1896 op->o_bd->bd_info = (BackendInfo *)on->on_info;
1897 rc = be_entry_get_rw( op, &op->o_req_ndn, NULL, NULL, 0, &e );
1899 if ( test_filter( op, e, li->li_oldf ) == LDAP_COMPARE_TRUE )
1901 be_entry_release_rw( op, e, 0 );
1903 op->o_bd->bd_info = (BackendInfo *)on;
1913 accesslog_unbind( Operation *op, SlapReply *rs )
1915 slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
1916 if ( op->o_conn->c_authz_backend == on->on_info->oi_origdb ) {
1928 if (( lb->lb_ops & LOG_OP_UNBIND ) && dnIsSuffix( &op->o_ndn, &lb->lb_base )) {
1936 e = accesslog_entry( op, rs, LOG_EN_UNBIND, &op2 );
1937 op2.o_hdr = op->o_hdr;
1957 accesslog_abandon( Operation *op, SlapReply *rs )
1959 slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
1968 if ( !op->o_time )
1976 if (( lb->lb_ops & LOG_OP_ABANDON ) && dnIsSuffix( &op->o_ndn, &lb->lb_base )) {
1984 e = accesslog_entry( op, rs, LOG_EN_ABANDON, &op2 );
1986 bv.bv_len = snprintf( buf, sizeof( buf ), "%d", op->orn_msgid );
1991 op2.o_hdr = op->o_hdr;
2011 accesslog_operational( Operation *op, SlapReply *rs )
2013 slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
2016 if ( op->o_sync != SLAP_CONTROL_NONE )
2020 && dn_match( &op->o_bd->be_nsuffix[0], &rs->sr_entry->e_nname ) )
2091 Operation *op;
2097 op = &opbuf.ob_op;
2098 op->o_bd = li->li_db;
2099 op->o_dn = li->li_db->be_rootdn;
2100 op->o_ndn = li->li_db->be_rootndn;
2101 rc = be_entry_get_rw( op, li->li_db->be_nsuffix, NULL, NULL, 0, &e );
2104 be_entry_release_rw( op, e, 0 );
2141 op->o_bd = on->on_info->oi_origdb;
2142 rc = be_entry_get_rw( op, op->o_bd->be_nsuffix, NULL,
2156 be_entry_release_rw( op, e_ctx, 0 );
2159 op->o_bd = &db;
2161 op->ora_e = e;
2162 op->o_req_dn = e->e_name;
2163 op->o_req_ndn = e->e_nname;
2164 op->o_callback = &nullsc;
2165 SLAP_DBFLAGS( op->o_bd ) |= SLAP_DBFLAG_NOLASTMOD;
2166 rc = op->o_bd->be_add( op, &rs );
2167 if ( e == op->ora_e )