Diff for /servers/slapd/overlays/syncprov.c between versions 1.56.2.27 and 1.130

version 1.56.2.27, 2006/01/23 23:52:17 version 1.130, 2005/11/25 11:43:51
Line 1 Line 1
 /* $OpenLDAP: pkg/ldap/servers/slapd/overlays/syncprov.c,v 1.56.2.26 2006/01/03 22:16:25 kurt Exp $ */  /* $OpenLDAP: pkg/ldap/servers/slapd/overlays/syncprov.c,v 1.129 2005/11/24 00:10:08 ando Exp $ */
 /* syncprov.c - syncrepl provider */  /* syncprov.c - syncrepl provider */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.  /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *   *
  * Copyright 2004-2006 The OpenLDAP Foundation.   * Copyright 2004-2005 The OpenLDAP Foundation.
  * All rights reserved.   * All rights reserved.
  *   *
  * Redistribution and use in source and binary forms, with or without   * Redistribution and use in source and binary forms, with or without
Line 450  syncprov_findbase( Operation *op, fbase_ Line 450  syncprov_findbase( Operation *op, fbase_
                 case LDAP_SCOPE_SUBTREE:                  case LDAP_SCOPE_SUBTREE:
                         fc->fscope = dnIsSuffix( fc->fdn, &fc->fss->s_base );                          fc->fscope = dnIsSuffix( fc->fdn, &fc->fss->s_base );
                         break;                          break;
   #ifdef LDAP_SCOPE_SUBORDINATE
                 case LDAP_SCOPE_SUBORDINATE:                  case LDAP_SCOPE_SUBORDINATE:
                         fc->fscope = dnIsSuffix( fc->fdn, &fc->fss->s_base ) &&                          fc->fscope = dnIsSuffix( fc->fdn, &fc->fss->s_base ) &&
                                 !dn_match( fc->fdn, &fc->fss->s_base );                                  !dn_match( fc->fdn, &fc->fss->s_base );
                         break;                          break;
   #endif
                 }                  }
         }          }
   
Line 1429  syncprov_playlog( Operation *op, SlapRep Line 1431  syncprov_playlog( Operation *op, SlapRep
                         mf.f_av_value = uuids[i];                          mf.f_av_value = uuids[i];
                         cb.sc_private = NULL;                          cb.sc_private = NULL;
                         fop.ors_slimit = 1;                          fop.ors_slimit = 1;
                         frs.sr_nentries = 0;  
                         rc = fop.o_bd->be_search( &fop, &frs );                          rc = fop.o_bd->be_search( &fop, &frs );
   
                         /* If entry was not found, add to delete list */                          /* If entry was not found, add to delete list */
Line 1757  syncprov_detach_op( Operation *op, synco Line 1758  syncprov_detach_op( Operation *op, synco
         op2->ors_filterstr.bv_val = ptr;          op2->ors_filterstr.bv_val = ptr;
         strcpy( ptr, so->s_filterstr.bv_val );          strcpy( ptr, so->s_filterstr.bv_val );
         op2->ors_filterstr.bv_len = so->s_filterstr.bv_len;          op2->ors_filterstr.bv_len = so->s_filterstr.bv_len;
         op2->ors_filter = filter_dup( op->ors_filter, NULL );          op2->ors_filter = str2filter( ptr );
         so->s_op = op2;          so->s_op = op2;
   
         /* Copy any cached group ACLs individually */          /* Copy any cached group ACLs individually */
Line 1801  syncprov_search_response( Operation *op, Line 1802  syncprov_search_response( Operation *op,
                         return SLAP_CB_CONTINUE;                          return SLAP_CB_CONTINUE;
                 }                  }
                 a = attr_find( rs->sr_entry->e_attrs, slap_schema.si_ad_entryCSN );                  a = attr_find( rs->sr_entry->e_attrs, slap_schema.si_ad_entryCSN );
                 if ( a == NULL && rs->sr_operational_attrs != NULL ) {  
                         a = attr_find( rs->sr_operational_attrs, slap_schema.si_ad_entryCSN );  
                 }  
                 if ( a ) {                  if ( a ) {
                         /* Make sure entry is less than the snaphot'd contextCSN */                          /* Make sure entry is less than the snaphot'd contextCSN */
                         if ( ber_bvcmp( &a->a_nvals[0], &ss->ss_ctxcsn ) > 0 )                          if ( ber_bvcmp( &a->a_nvals[0], &ss->ss_ctxcsn ) > 0 )
Line 2280  syncprov_db_open( Line 2278  syncprov_db_open(
         slap_overinst   *on = (slap_overinst *) be->bd_info;          slap_overinst   *on = (slap_overinst *) be->bd_info;
         syncprov_info_t *si = (syncprov_info_t *)on->on_bi.bi_private;          syncprov_info_t *si = (syncprov_info_t *)on->on_bi.bi_private;
   
         Connection conn = { 0 };          Connection conn;
         OperationBuffer opbuf = { 0 };          OperationBuffer opbuf;
         char ctxcsnbuf[LDAP_LUTIL_CSNSTR_BUFSIZE];          char ctxcsnbuf[LDAP_LUTIL_CSNSTR_BUFSIZE];
         Operation *op = (Operation *) &opbuf;          Operation *op = (Operation *) &opbuf;
         Entry *e;          Entry *e;
Line 2324  syncprov_db_open( Line 2322  syncprov_db_open(
                         strcpy( ctxcsnbuf, si->si_ctxcsnbuf );                          strcpy( ctxcsnbuf, si->si_ctxcsnbuf );
                 }                  }
                 be_entry_release_rw( op, e, 0 );                  be_entry_release_rw( op, e, 0 );
                 if ( !BER_BVISEMPTY( &si->si_ctxcsn ) ) {                  op->o_bd->bd_info = (BackendInfo *)on;
                         op->o_bd->bd_info = (BackendInfo *)on;                  op->o_req_dn = be->be_suffix[0];
                         op->o_req_dn = be->be_suffix[0];                  op->o_req_ndn = be->be_nsuffix[0];
                         op->o_req_ndn = be->be_nsuffix[0];                  op->ors_scope = LDAP_SCOPE_SUBTREE;
                         op->ors_scope = LDAP_SCOPE_SUBTREE;                  ldap_pvt_thread_create( &tid, 0, syncprov_db_otask, op );
                         ldap_pvt_thread_create( &tid, 0, syncprov_db_otask, op );                  ldap_pvt_thread_join( tid, NULL );
                         ldap_pvt_thread_join( tid, NULL );  
                 }  
         } else if ( SLAP_SYNC_SHADOW( op->o_bd )) {          } else if ( SLAP_SYNC_SHADOW( op->o_bd )) {
                 /* If we're also a consumer, and we didn't find the context entry,                  /* If we're also a consumer, and we didn't find the context entry,
                  * then don't generate anything, wait for our provider to send it                   * then don't generate anything, wait for our provider to send it
Line 2425  syncprov_db_destroy( Line 2421  syncprov_db_destroy(
         syncprov_info_t *si = (syncprov_info_t *)on->on_bi.bi_private;          syncprov_info_t *si = (syncprov_info_t *)on->on_bi.bi_private;
   
         if ( si ) {          if ( si ) {
                 if ( si->si_logs ) {  
                         ch_free( si->si_logs );  
                 }  
                 ldap_pvt_thread_mutex_destroy( &si->si_mods_mutex );                  ldap_pvt_thread_mutex_destroy( &si->si_mods_mutex );
                 ldap_pvt_thread_mutex_destroy( &si->si_ops_mutex );                  ldap_pvt_thread_mutex_destroy( &si->si_ops_mutex );
                 ldap_pvt_thread_mutex_destroy( &si->si_csn_mutex );                  ldap_pvt_thread_mutex_destroy( &si->si_csn_mutex );
Line 2551  syncprov_initialize() Line 2544  syncprov_initialize()
         int rc;          int rc;
   
         rc = register_supported_control( LDAP_CONTROL_SYNC,          rc = register_supported_control( LDAP_CONTROL_SYNC,
                 SLAP_CTRL_SEARCH, NULL,                  SLAP_CTRL_HIDE|SLAP_CTRL_SEARCH, NULL,
                 syncprov_parseCtrl, &slap_cids.sc_LDAPsync );                  syncprov_parseCtrl, &slap_cids.sc_LDAPsync );
         if ( rc != LDAP_SUCCESS ) {          if ( rc != LDAP_SUCCESS ) {
                 Debug( LDAP_DEBUG_ANY,                  Debug( LDAP_DEBUG_ANY,

Removed from v.1.56.2.27  
changed lines
  Added in v.1.130


______________
© Copyright 1998-2020, OpenLDAP Foundation, info@OpenLDAP.org