ITS#6075, cleanup, add missing equality match

This commit is contained in:
Howard Chu 2009-06-17 00:42:59 +00:00
parent fc0418db8f
commit 2ae35da6bb

View File

@ -72,7 +72,7 @@ insert_ordered( slap_overinst *on, collect_info *ci ) {
ci->ci_next = NULL; ci->ci_next = NULL;
} }
found = 1; found = 1;
} else if (find->ci_dn.bv_len <= ci->ci_dn.bv_len) { } else if (find->ci_dn.bv_len < ci->ci_dn.bv_len) {
/* insert into list here */ /* insert into list here */
if (prev == NULL) { if (prev == NULL) {
/* entry is head of list */ /* entry is head of list */
@ -151,7 +151,11 @@ collect_cf( ConfigArgs *c )
collect_info **cip, *ci; collect_info **cip, *ci;
int i; int i;
cip = (collect_info **)&on->on_bi.bi_private; cip = (collect_info **)&on->on_bi.bi_private;
for ( i=0; i <= c->valx; i++, cip = &ci->ci_next ) ci = *cip; ci = *cip;
for ( i=0; i < c->valx; i++ ) {
cip = &ci->ci_next;
ci = *cip;
}
*cip = ci->ci_next; *cip = ci->ci_next;
ch_free( ci->ci_dn.bv_val ); ch_free( ci->ci_dn.bv_val );
ch_free( ci ); ch_free( ci );
@ -174,10 +178,6 @@ collect_cf( ConfigArgs *c )
arg = strtok(NULL, ","); arg = strtok(NULL, ",");
} }
/* allocate config info with room for attribute array */
ci = ch_malloc( sizeof( collect_info ) +
sizeof( AttributeDescription * ) * count );
/* validate and normalize dn */ /* validate and normalize dn */
ber_str2bv( c->argv[1], 0, 0, &bv ); ber_str2bv( c->argv[1], 0, 0, &bv );
if ( dnNormalize( 0, NULL, NULL, &bv, &dn, NULL ) ) { if ( dnNormalize( 0, NULL, NULL, &bv, &dn, NULL ) ) {
@ -188,6 +188,10 @@ collect_cf( ConfigArgs *c )
return ARG_BAD_CONF; return ARG_BAD_CONF;
} }
/* allocate config info with room for attribute array */
ci = ch_malloc( sizeof( collect_info ) +
sizeof( AttributeDescription * ) * count );
/* load attribute description for attribute list */ /* load attribute description for attribute list */
arg = c->argv[2]; arg = c->argv[2];
for( idx=0; idx<count; idx++) { for( idx=0; idx<count; idx++) {
@ -199,6 +203,7 @@ collect_cf( ConfigArgs *c )
c->argv[0], arg); c->argv[0], arg);
Debug( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE, Debug( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE,
"%s: %s\n", c->log, c->cr_msg, 0 ); "%s: %s\n", c->log, c->cr_msg, 0 );
ch_free( ci );
return ARG_BAD_CONF; return ARG_BAD_CONF;
} }
while(*arg!='\0') { while(*arg!='\0') {
@ -230,6 +235,7 @@ static ConfigTable collectcfg[] = {
ARG_MAGIC, collect_cf, ARG_MAGIC, collect_cf,
"( OLcfgOvAt:19.1 NAME 'olcCollectInfo' " "( OLcfgOvAt:19.1 NAME 'olcCollectInfo' "
"DESC 'DN of entry and attribute to distribute' " "DESC 'DN of entry and attribute to distribute' "
"EQUALITY caseIgnoreMatch "
"SYNTAX OMsDirectoryString )", NULL, NULL }, "SYNTAX OMsDirectoryString )", NULL, NULL },
{ NULL, NULL, 0, 0, 0, ARG_IGNORED } { NULL, NULL, 0, 0, 0, ARG_IGNORED }
}; };