1 /* lastmod.c - returns last modification info */
2 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4 * Copyright 2004 The OpenLDAP Foundation.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted only as authorized by the OpenLDAP
11 * A copy of this license is available in the file LICENSE in the
12 * top-level directory of the distribution or, alternatively, at
13 * <http://www.OpenLDAP.org/license.html>.
16 * This work was initially developed by Pierangelo Masarati for inclusion in
22 #ifdef SLAPD_OVER_LASTMOD
26 #include <ac/string.h>
27 #include <ac/socket.h>
32 typedef struct lastmod_info_t {
33 struct berval lmi_rdnvalue;
35 ldap_pvt_thread_mutex_t lmi_entry_mutex;
38 struct lastmod_schema_t {
39 ObjectClass *lms_oc_lastmod;
40 AttributeDescription *lms_ad_lastmodDN;
41 AttributeDescription *lms_ad_lastmodType;
53 struct berval lastmodType[] = {
69 { "lastmod", "( 1.3.6.1.4.1.4203.666.3.13"
71 "DESC 'OpenLDAP per-database last modification monitoring' "
79 ") )", SLAP_OC_OPERATIONAL|SLAP_OC_HIDE,
80 offsetof(struct lastmod_schema_t, lms_oc_lastmod) },
83 { "lastmodDN", "( 1.3.6.1.4.1.4203.666.1.28"
85 "DESC 'DN of last modification' "
86 "EQUALITY distinguishedNameMatch "
87 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 "
88 "NO-USER-MODIFICATION "
89 "USAGE directoryOperation )", SLAP_AT_HIDE,
90 offsetof(struct lastmod_schema_t, lms_ad_lastmodDN) },
91 { "lastmodType", "( 1.3.6.1.4.1.4203.666.1.29"
93 "DESC 'Type of last modification' "
94 "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 "
95 "EQUALITY caseIgnoreMatch "
97 "NO-USER-MODIFICATION "
98 "USAGE directoryOperation )", SLAP_AT_HIDE,
99 offsetof(struct lastmod_schema_t, lms_ad_lastmodType) },
103 static const struct berval *write_exop[] = {
104 &slap_EXOP_MODIFY_PASSWD,
109 lastmod_search( Operation *op, SlapReply *rs )
111 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
112 lastmod_info_t *lmi = (lastmod_info_t *)on->on_bi.bi_private;
115 /* FIXME: can't restore the correct bd_info otherwise
116 * backend_operational() screws things up */
117 op->o_bd->bd_info = (BackendInfo *)on->on_info;
119 ldap_pvt_thread_mutex_lock( &lmi->lmi_entry_mutex );
120 rs->sr_attrs = op->ors_attrs;
122 rs->sr_entry = lmi->lmi_e;
123 rs->sr_err = send_search_entry( op, rs );
127 ldap_pvt_thread_mutex_unlock( &lmi->lmi_entry_mutex );
129 send_ldap_result( op, rs );
135 lastmod_compare( Operation *op, SlapReply *rs )
137 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
138 lastmod_info_t *lmi = (lastmod_info_t *)on->on_bi.bi_private;
141 ldap_pvt_thread_mutex_lock( &lmi->lmi_entry_mutex );
142 if ( get_assert( op ) &&
143 ( test_filter( op, lmi->lmi_e, get_assertion( op )) != LDAP_COMPARE_TRUE ))
145 rs->sr_err = LDAP_ASSERTION_FAILED;
149 rs->sr_err = access_allowed( op, lmi->lmi_e, op->oq_compare.rs_ava->aa_desc,
150 &op->oq_compare.rs_ava->aa_value, ACL_COMPARE, NULL );
151 if ( ! rs->sr_err ) {
152 rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
156 rs->sr_err = LDAP_NO_SUCH_ATTRIBUTE;
158 for ( a = attr_find( lmi->lmi_e->e_attrs, op->oq_compare.rs_ava->aa_desc );
160 a = attr_find( a->a_next, op->oq_compare.rs_ava->aa_desc ))
162 rs->sr_err = LDAP_COMPARE_FALSE;
164 if ( value_find_ex( op->oq_compare.rs_ava->aa_desc,
165 SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH |
166 SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH,
167 a->a_nvals, &op->oq_compare.rs_ava->aa_value, op->o_tmpmemctx ) == 0 )
169 rs->sr_err = LDAP_COMPARE_TRUE;
175 ldap_pvt_thread_mutex_unlock( &lmi->lmi_entry_mutex );
176 send_ldap_result( op, rs );
178 if( rs->sr_err == LDAP_COMPARE_FALSE || rs->sr_err == LDAP_COMPARE_TRUE ) {
179 rs->sr_err = LDAP_SUCCESS;
186 lastmod_exop( Operation *op, SlapReply *rs )
188 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
192 op->o_bd->bd_info = (BackendInfo *)on->on_info;
193 rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
194 rs->sr_text = "not allowed within namingContext";
195 send_ldap_result( op, rs );
202 lastmod_op_func( Operation *op, SlapReply *rs )
204 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
205 lastmod_info_t *lmi = (lastmod_info_t *)on->on_bi.bi_private;
208 if ( dn_match( &op->o_req_ndn, &lmi->lmi_e->e_nname ) ) {
209 switch ( op->o_tag ) {
210 case LDAP_REQ_SEARCH:
211 if ( op->ors_scope != LDAP_SCOPE_BASE ) {
212 goto return_referral;
215 return lastmod_search( op, rs );
217 case LDAP_REQ_COMPARE:
218 return lastmod_compare( op, rs );
220 case LDAP_REQ_EXTENDED:
221 /* if write, reject; otherwise process */
222 for ( i = 0; write_exop[ i ] != NULL; i++ ) {
223 if ( ber_bvcmp( write_exop[ i ], &op->oq_extended.rs_reqoid ) == 0 ) {
224 rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
225 rs->sr_text = "not allowed within namingContext";
229 return lastmod_exop( op, rs );
232 rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
233 rs->sr_text = "not allowed within namingContext";
238 if ( dnIsSuffix( &op->o_req_ndn, &lmi->lmi_e->e_nname ) ) {
239 goto return_referral;
242 return SLAP_CB_CONTINUE;
245 op->o_bd->bd_info = (BackendInfo *)on->on_info;
246 rs->sr_ref = referral_rewrite( default_referral,
247 NULL, &op->o_req_dn, op->ors_scope );
249 if (!rs->sr_ref) rs->sr_ref = default_referral;
250 rs->sr_err = LDAP_REFERRAL;
251 send_ldap_result( op, rs );
253 if (rs->sr_ref != default_referral)
254 ber_bvarray_free( rs->sr_ref );
260 op->o_bd->bd_info = (BackendInfo *)on->on_info;
261 send_ldap_result( op, rs );
268 lastmod_update( Operation *op, SlapReply *rs )
270 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
271 lastmod_info_t *lmi = (lastmod_info_t *)on->on_bi.bi_private;
273 Modifications *ml = NULL;
274 struct berval bv_modifyTimestamp = BER_BVNULL,
275 bv_nmodifyTimestamp = BER_BVNULL,
276 bv_modifiersName = BER_BVNULL,
277 bv_nmodifiersName = BER_BVNULL,
278 bv_name = BER_BVNULL,
279 bv_nname = BER_BVNULL;
280 enum lastmodType_e lmt = LASTMOD_UNKNOWN;
284 /* FIXME: timestamp? modifier? */
285 switch ( op->o_tag ) {
289 a = attr_find( e->e_attrs, slap_schema.si_ad_modifiersName );
291 ber_dupbv( &bv_modifiersName, &a->a_vals[0] );
292 ber_dupbv( &bv_nmodifiersName, &a->a_nvals[0] );
294 a = attr_find( e->e_attrs, slap_schema.si_ad_modifyTimestamp );
296 ber_dupbv( &bv_modifyTimestamp, &a->a_vals[0] );
297 if ( a->a_nvals && !BER_BVISNULL( &a->a_nvals[0] ) ) {
298 ber_dupbv( &bv_nmodifyTimestamp, &a->a_nvals[0] );
300 ber_dupbv( &bv_nmodifyTimestamp, &a->a_vals[0] );
303 ber_dupbv( &bv_name, &e->e_name );
304 ber_dupbv( &bv_nname, &e->e_nname );
307 case LDAP_REQ_DELETE:
313 char tmbuf[ LDAP_LUTIL_GENTIME_BUFSIZE ];
316 lmt = LASTMOD_DELETE;
319 currtime = slap_get_time();
321 #ifndef HAVE_GMTIME_R
322 ldap_pvt_thread_mutex_lock( &gmtime_mutex );
323 tm = gmtime( &currtime );
324 #else /* HAVE_GMTIME_R */
325 tm = gmtime_r( &currtime, &tm_buf );
326 #endif /* HAVE_GMTIME_R */
327 lutil_gentime( tmbuf, sizeof( tmbuf ), tm );
328 #ifndef HAVE_GMTIME_R
329 ldap_pvt_thread_mutex_unlock( &gmtime_mutex );
332 ber_str2bv( tmbuf, 0, 1, &bv_modifyTimestamp );
333 ber_dupbv( &bv_nmodifyTimestamp, &bv_modifyTimestamp );
336 ber_dupbv( &bv_modifiersName, &op->o_dn );
337 ber_dupbv( &bv_nmodifiersName, &op->o_ndn );
339 ber_dupbv( &bv_name, &op->o_req_dn );
340 ber_dupbv( &bv_nname, &op->o_req_ndn );
344 case LDAP_REQ_MODIFY:
345 lmt = LASTMOD_MODIFY;
347 for ( ml = op->orm_modlist; ml; ml = ml->sml_next ) {
348 if ( ad_cmp( ml->sml_desc , slap_schema.si_ad_modifiersName ) == 0 ) {
349 ber_dupbv( &bv_modifiersName, &ml->sml_values[0] );
350 ber_dupbv( &bv_nmodifiersName, &ml->sml_nvalues[0] );
352 if ( !BER_BVISNULL( &bv_modifyTimestamp ) ) {
356 } else if ( ad_cmp( ml->sml_desc, slap_schema.si_ad_modifyTimestamp ) == 0 ) {
357 ber_dupbv( &bv_modifyTimestamp, &ml->sml_values[0] );
358 if ( ml->sml_nvalues && !BER_BVISNULL( &ml->sml_nvalues[0] ) ) {
359 ber_dupbv( &bv_nmodifyTimestamp, &ml->sml_nvalues[0] );
361 ber_dupbv( &bv_nmodifyTimestamp, &ml->sml_values[0] );
364 if ( !BER_BVISNULL( &bv_modifiersName ) ) {
370 ber_dupbv( &bv_name, &op->o_req_dn );
371 ber_dupbv( &bv_nname, &op->o_req_ndn );
374 case LDAP_REQ_MODRDN:
375 lmt = LASTMOD_MODRDN;
377 if ( on->on_info->oi_orig->bi_entry_get_rw ) {
378 BackendInfo *bi = op->o_bd->bd_info;
379 struct berval dn = BER_BVNULL;
381 if ( op->orr_nnewSup && !BER_BVISNULL( op->orr_nnewSup ) ) {
382 build_new_dn( &dn, op->orr_nnewSup, &op->orr_nnewrdn, NULL );
387 dnParent( &op->o_req_ndn, &pdn );
388 build_new_dn( &dn, &pdn, &op->orr_nnewrdn, NULL );
391 op->o_bd->bd_info = (BackendInfo *)on->on_info->oi_orig;
392 if ( (*op->o_bd->bd_info->bi_entry_get_rw)( op, &dn, NULL, NULL, 0, &e ) == LDAP_SUCCESS ) {
393 a = attr_find( e->e_attrs, slap_schema.si_ad_modifiersName );
395 ber_dupbv( &bv_modifiersName, &a->a_vals[0] );
396 ber_dupbv( &bv_nmodifiersName, &a->a_nvals[0] );
398 a = attr_find( e->e_attrs, slap_schema.si_ad_modifyTimestamp );
400 ber_dupbv( &bv_modifyTimestamp, &a->a_vals[0] );
401 if ( a->a_nvals && !BER_BVISNULL( &a->a_nvals[0] ) ) {
402 ber_dupbv( &bv_nmodifyTimestamp, &a->a_nvals[0] );
404 ber_dupbv( &bv_nmodifyTimestamp, &a->a_vals[0] );
408 ber_dupbv( &bv_name, &e->e_name );
409 ber_dupbv( &bv_nname, &e->e_nname );
411 (*op->o_bd->bd_info->bi_entry_release_rw)( op, e, 0 );
414 ch_free( dn.bv_val );
415 op->o_bd->bd_info = bi;
423 ldap_pvt_thread_mutex_lock( &lmi->lmi_entry_mutex );
426 fprintf( stderr, "### lastmodDN: %s %s\n", bv_name.bv_val, bv_nname.bv_val );
429 a = attr_find( lmi->lmi_e->e_attrs, lastmod_schema.lms_ad_lastmodDN );
433 ch_free( a->a_vals[0].bv_val );
434 a->a_vals[0] = bv_name;
435 ch_free( a->a_nvals[0].bv_val );
436 a->a_nvals[0] = bv_nname;
439 fprintf( stderr, "### lastmodType: %s %s\n", lastmodType[ lmt ].bv_val, lastmodType[ lmt ].bv_val );
442 a = attr_find( lmi->lmi_e->e_attrs, lastmod_schema.lms_ad_lastmodType );
446 ch_free( a->a_vals[0].bv_val );
447 ber_dupbv( &a->a_vals[0], &lastmodType[ lmt ] );
448 ch_free( a->a_nvals[0].bv_val );
449 ber_dupbv( &a->a_vals[0], &lastmodType[ lmt ] );
452 fprintf( stderr, "### modifiersName: %s %s\n", bv_modifiersName.bv_val, bv_nmodifiersName.bv_val );
455 a = attr_find( lmi->lmi_e->e_attrs, slap_schema.si_ad_modifiersName );
459 ch_free( a->a_vals[0].bv_val );
460 a->a_vals[0] = bv_modifiersName;
461 ch_free( a->a_nvals[0].bv_val );
462 a->a_nvals[0] = bv_nmodifiersName;
465 fprintf( stderr, "### modifyTimestamp: %s %s\n", bv_nmodifyTimestamp.bv_val, bv_modifyTimestamp.bv_val );
468 a = attr_find( lmi->lmi_e->e_attrs, slap_schema.si_ad_modifyTimestamp );
472 ch_free( a->a_vals[0].bv_val );
473 a->a_vals[0] = bv_modifyTimestamp;
474 ch_free( a->a_nvals[0].bv_val );
475 a->a_nvals[0] = bv_nmodifyTimestamp;
480 ldap_pvt_thread_mutex_unlock( &lmi->lmi_entry_mutex );
486 lastmod_response( Operation *op, SlapReply *rs )
490 if ( rs->sr_err != LDAP_SUCCESS ) {
491 return SLAP_CB_CONTINUE;
494 switch ( op->o_tag ) {
496 case LDAP_REQ_MODIFY:
497 case LDAP_REQ_MODRDN:
498 case LDAP_REQ_DELETE:
502 case LDAP_REQ_EXTENDED:
503 /* if write, process */
504 for ( i = 0; write_exop[ i ] != NULL; i++ ) {
505 if ( ber_bvcmp( write_exop[ i ], &op->oq_extended.rs_reqoid ) == 0 ) {
512 return SLAP_CB_CONTINUE;
516 if ( rs->sr_err == LDAP_SUCCESS ) {
517 /* FIXME: ignore errors */
518 (void)lastmod_update( op, rs );
521 return SLAP_CB_CONTINUE;
529 slap_overinst *on = (slap_overinst *) be->bd_info;
532 if ( lastmod_schema.lms_oc_lastmod == NULL ) {
536 /* schema integration */
537 for ( i = 0; mat[i].name; i++ ) {
538 LDAPAttributeType *at;
541 AttributeDescription **ad;
543 at = ldap_str2attributetype( mat[i].schema, &code,
544 &err, LDAP_SCHEMA_ALLOW_ALL );
547 LDAP_LOG( OPERATION, CRIT, "lastmod_init: "
548 "in AttributeType '%s' %s before %s\n",
549 mat[i].name, ldap_scherr2str(code), err );
551 Debug( LDAP_DEBUG_ANY, "lastmod_init: "
552 "in AttributeType '%s' %s before %s\n",
553 mat[i].name, ldap_scherr2str(code), err );
558 if ( at->at_oid == NULL ) {
560 LDAP_LOG( OPERATION, CRIT, "lastmod_init: "
561 "null OID for attributeType '%s'\n",
564 Debug( LDAP_DEBUG_ANY, "lastmod_init: "
565 "null OID for attributeType '%s'\n",
571 code = at_add(at, &err);
574 LDAP_LOG( OPERATION, CRIT, "lastmod_init: "
575 "%s in attributeType '%s'\n",
576 scherr2str(code), mat[i].name, 0 );
578 Debug( LDAP_DEBUG_ANY, "lastmod_init: "
579 "%s in attributeType '%s'\n",
580 scherr2str(code), mat[i].name, 0 );
586 ad = ((AttributeDescription **)&(((char *)&lastmod_schema)[mat[i].offset]));
588 if ( slap_str2ad( mat[i].name, ad, &text ) ) {
590 LDAP_LOG( OPERATION, CRIT,
591 "lastmod_init: %s\n", text, 0, 0 );
593 Debug( LDAP_DEBUG_ANY,
594 "lastmod_init: %s\n", text, 0, 0 );
599 (*ad)->ad_type->sat_flags |= mat[i].flags;
602 for ( i = 0; moc[i].name; i++ ) {
608 oc = ldap_str2objectclass(moc[i].schema, &code, &err,
609 LDAP_SCHEMA_ALLOW_ALL );
612 LDAP_LOG( OPERATION, CRIT,
613 "unable to parse lastmod objectClass '%s': "
614 "%s before %s\n" , moc[i].name,
615 ldap_scherr2str(code), err );
617 Debug( LDAP_DEBUG_ANY,
618 "unable to parse lastmod objectClass '%s': "
619 "%s before %s\n" , moc[i].name,
620 ldap_scherr2str(code), err );
625 if ( oc->oc_oid == NULL ) {
627 LDAP_LOG( OPERATION, CRIT,
628 "objectClass '%s' has no OID\n" ,
631 Debug( LDAP_DEBUG_ANY,
632 "objectClass '%s' has no OID\n" ,
638 code = oc_add(oc, 0, &err);
641 LDAP_LOG( OPERATION, CRIT,
642 "objectClass '%s': %s \"%s\"\n" ,
643 moc[i].name, scherr2str(code), err );
645 Debug( LDAP_DEBUG_ANY,
646 "objectClass '%s': %s \"%s\"\n" ,
647 moc[i].name, scherr2str(code), err );
654 Oc = oc_find( moc[i].name );
657 LDAP_LOG( OPERATION, CRIT, "lastmod_init: "
658 "unable to find objectClass %s "
659 "(just added)\n", moc[i].name, 0, 0 );
661 Debug( LDAP_DEBUG_ANY, "lastmod_init: "
662 "unable to find objectClass %s "
663 "(just added)\n", moc[i].name, 0, 0 );
668 Oc->soc_flags |= moc[i].flags;
670 ((ObjectClass **)&(((char *)&lastmod_schema)[moc[i].offset]))[0] = Oc;
674 lmi = (lastmod_info_t *)ch_malloc(sizeof(lastmod_info_t));
675 memset(lmi, 0, sizeof(lastmod_info_t));
676 on->on_bi.bi_private = lmi;
690 slap_overinst *on = (slap_overinst *) be->bd_info;
691 lastmod_info_t *lmi = (lastmod_info_t *)on->on_bi.bi_private;
693 if ( strcasecmp( argv[ 0 ], "lastmod-rdnvalue" ) == 0 ) {
694 if ( lmi->lmi_rdnvalue.bv_val ) {
695 /* already defined! */
696 ch_free( lmi->lmi_rdnvalue.bv_val );
699 ber_str2bv( argv[ 1 ], 0, 1, &lmi->lmi_rdnvalue );
702 return SLAP_CONF_UNKNOWN;
713 slap_overinst *on = (slap_overinst *) be->bd_info;
714 lastmod_info_t *lmi = (lastmod_info_t *)on->on_bi.bi_private;
720 static char tmbuf[ LDAP_LUTIL_GENTIME_BUFSIZE ];
722 if ( !SLAP_LASTMOD( be ) ) {
723 fprintf( stderr, "set \"lastmod on\" to make this overlay effective\n" );
730 #ifndef HAVE_GMTIME_R
731 ldap_pvt_thread_mutex_lock( &gmtime_mutex );
732 tms = gmtime( &starttime );
733 #else /* HAVE_GMTIME_R */
734 tms = gmtime_r( &starttime, &tm_buf );
735 #endif /* HAVE_GMTIME_R */
736 lutil_gentime( tmbuf, sizeof(tmbuf), tms );
737 #ifndef HAVE_GMTIME_R
738 ldap_pvt_thread_mutex_unlock( &gmtime_mutex );
741 if ( BER_BVISNULL( &lmi->lmi_rdnvalue ) ) {
742 ber_str2bv( "Lastmod", 0, 1, &lmi->lmi_rdnvalue );
745 snprintf( buf, sizeof( buf ),
748 "structuralObjectClass: %s\n"
750 "description: This object contains the last modification to this database\n"
753 "createTimestamp: %s\n"
755 "modifyTimestamp: %s\n"
756 "modifiersName: %s\n"
757 "hasSubordinates: FALSE\n",
758 lmi->lmi_rdnvalue.bv_val, be->be_suffix[0].bv_val,
759 lastmod_schema.lms_oc_lastmod->soc_cname.bv_val,
760 lastmod_schema.lms_oc_lastmod->soc_cname.bv_val,
761 lmi->lmi_rdnvalue.bv_val,
762 lastmod_schema.lms_ad_lastmodDN->ad_cname.bv_val, lmi->lmi_rdnvalue.bv_val, be->be_suffix[0].bv_val,
763 lastmod_schema.lms_ad_lastmodType->ad_cname.bv_val, lastmodType[ LASTMOD_ADD ].bv_val,
765 BER_BVISNULL( &be->be_rootdn ) ? "" : be->be_rootdn.bv_val,
767 BER_BVISNULL( &be->be_rootdn ) ? "" : be->be_rootdn.bv_val );
770 fprintf( stderr, "# entry:\n%s\n", buf );
774 lmi->lmi_e = str2entry( buf );
775 if ( lmi->lmi_e == NULL ) {
779 ldap_pvt_thread_mutex_init( &lmi->lmi_entry_mutex );
789 slap_overinst *on = (slap_overinst *) be->bd_info;
790 lastmod_info_t *lmi = (lastmod_info_t *)on->on_bi.bi_private;
793 if ( !BER_BVISNULL( &lmi->lmi_rdnvalue ) ) {
794 ch_free( lmi->lmi_rdnvalue.bv_val );
798 entry_free( lmi->lmi_e );
800 ldap_pvt_thread_mutex_destroy( &lmi->lmi_entry_mutex );
809 /* This overlay is set up for dynamic loading via moduleload. For static
810 * configuration, you'll need to arrange for the slap_overinst to be
811 * initialized and registered by some other function inside slapd.
814 static slap_overinst lastmod;
819 memset( &lastmod, 0, sizeof( slap_overinst ) );
820 lastmod.on_bi.bi_type = "lastmod";
821 lastmod.on_bi.bi_db_init = lastmod_db_init;
822 lastmod.on_bi.bi_db_config = lastmod_db_config;
823 lastmod.on_bi.bi_db_destroy = lastmod_db_destroy;
824 lastmod.on_bi.bi_db_open = lastmod_db_open;
826 lastmod.on_bi.bi_op_add = lastmod_op_func;
827 lastmod.on_bi.bi_op_compare = lastmod_op_func;
828 lastmod.on_bi.bi_op_delete = lastmod_op_func;
829 lastmod.on_bi.bi_op_modify = lastmod_op_func;
830 lastmod.on_bi.bi_op_modrdn = lastmod_op_func;
831 lastmod.on_bi.bi_op_search = lastmod_op_func;
832 lastmod.on_bi.bi_extended = lastmod_op_func;
834 lastmod.on_response = lastmod_response;
836 return overlay_register( &lastmod );
839 #if SLAPD_OVER_LASTMOD == SLAPD_MOD_DYNAMIC
841 init_module(int argc, char *argv[])
843 return lastmod_init();
845 #endif /* SLAPD_OVER_LASTMOD == SLAPD_MOD_DYNAMIC */
847 #endif /* defined(SLAPD_OVER_LASTMOD) */