Diff for /servers/slapd/overlays/unique.c between versions 1.8 and 1.8.2.3

version 1.8, 2004/12/05 02:06:01 version 1.8.2.3, 2005/03/14 22:25:02
Line 1 Line 1
 /* unique.c - attribute uniqueness module */  /* unique.c - attribute uniqueness module */
 /* $OpenLDAP: pkg/ldap/servers/slapd/overlays/unique.c,v 1.7 2004/11/25 20:16:56 hyc Exp $ */  /* $OpenLDAP: pkg/ldap/servers/slapd/overlays/unique.c,v 1.8.2.2 2005/02/02 17:32:45 kurt Exp $ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.  /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *   *
  * Copyright 2004 The OpenLDAP Foundation.   * Copyright 2004-2005 The OpenLDAP Foundation.
  * Portions Copyright 2004 Symas Corporation.   * Portions Copyright 2004 Symas Corporation.
  * All rights reserved.   * All rights reserved.
  *   *
Line 46  typedef struct unique_data_s { Line 46  typedef struct unique_data_s {
 } unique_data;  } unique_data;
   
 typedef struct unique_counter_s {  typedef struct unique_counter_s {
           struct berval *ndn;
         int count;          int count;
 } unique_counter;  } unique_counter;
   
Line 231  static int count_attr_cb( Line 232  static int count_attr_cb(
         SlapReply *rs          SlapReply *rs
 )  )
 {  {
           unique_counter *uc;
   
         /* because you never know */          /* because you never know */
         if(!op || !rs) return(0);          if(!op || !rs) return(0);
   
         /* Only search entries are interesting */          /* Only search entries are interesting */
         if(rs->sr_type != REP_SEARCH) return(0);          if(rs->sr_type != REP_SEARCH) return(0);
   
           uc = op->o_callback->sc_private;
   
           /* Ignore the current entry */
           if ( dn_match( uc->ndn, &rs->sr_entry->e_nname )) return(0);
   
         Debug(LDAP_DEBUG_TRACE, "==> count_attr_cb <%s>\n",          Debug(LDAP_DEBUG_TRACE, "==> count_attr_cb <%s>\n",
                 rs->sr_entry ? rs->sr_entry->e_name.bv_val : "UNKNOWN_DN", 0, 0);                  rs->sr_entry ? rs->sr_entry->e_name.bv_val : "UNKNOWN_DN", 0, 0);
   
         ((unique_counter*)op->o_callback->sc_private)->count++;          uc->count++;
   
         return(0);          return(0);
 }  }
Line 316  static int unique_search( Line 324  static int unique_search(
         unique_data *ud = on->on_bi.bi_private;          unique_data *ud = on->on_bi.bi_private;
         SlapReply nrs = { REP_RESULT };          SlapReply nrs = { REP_RESULT };
         slap_callback cb = { NULL, NULL, NULL, NULL }; /* XXX */          slap_callback cb = { NULL, NULL, NULL, NULL }; /* XXX */
         unique_counter uq = { 0 };          unique_counter uq = { NULL, 0 };
         int rc;          int rc;
   
         nop->ors_filter = str2filter_x(nop, key);          nop->ors_filter = str2filter_x(nop, key);
Line 328  static int unique_search( Line 336  static int unique_search(
         nop->o_tag      = LDAP_REQ_SEARCH;          nop->o_tag      = LDAP_REQ_SEARCH;
         nop->ors_scope  = LDAP_SCOPE_SUBTREE;          nop->ors_scope  = LDAP_SCOPE_SUBTREE;
         nop->ors_deref  = LDAP_DEREF_NEVER;          nop->ors_deref  = LDAP_DEREF_NEVER;
           nop->ors_limit  = NULL;
         nop->ors_slimit = SLAP_NO_LIMIT;          nop->ors_slimit = SLAP_NO_LIMIT;
         nop->ors_tlimit = SLAP_NO_LIMIT;          nop->ors_tlimit = SLAP_NO_LIMIT;
         nop->ors_attrs  = slap_anlist_no_attrs;          nop->ors_attrs  = slap_anlist_no_attrs;
         nop->ors_attrsonly = 1;          nop->ors_attrsonly = 1;
   
           uq.ndn = &op->o_req_ndn;
   
         nop->o_req_ndn  = ud->dn;          nop->o_req_ndn  = ud->dn;
         nop->o_ndn = op->o_bd->be_rootndn;          nop->o_ndn = op->o_bd->be_rootndn;
   

Removed from v.1.8  
changed lines
  Added in v.1.8.2.3


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