/* count the attr length */
for ( attr_name = qm->attr_sets[i].attrs;
attr_name->an_name.bv_val; attr_name++ )
+ {
bv.bv_len += attr_name->an_name.bv_len + 1;
+ if ( attr_name->an_desc->ad_flags & SLAP_DESC_TEMPORARY ) {
+ bv.bv_len += STRLENOF("undef:");
+ }
+ }
bv.bv_val = ch_malloc( bv.bv_len+1 );
ptr = lutil_strcopy( bv.bv_val, c->cr_msg );
for ( attr_name = qm->attr_sets[i].attrs;
attr_name->an_name.bv_val; attr_name++ ) {
*ptr++ = ' ';
+ if ( attr_name->an_desc->ad_flags & SLAP_DESC_TEMPORARY ) {
+ ptr = lutil_strcopy( ptr, "undef:" );
+ }
ptr = lutil_strcopy( ptr, attr_name->an_name.bv_val );
}
ber_bvarray_add( &c->rvalue_vals, &bv );
all_op = 1;
BER_BVSTR( &attr_name->an_name, LDAP_ALL_OPERATIONAL_ATTRIBUTES );
} else {
- if ( slap_str2ad( c->argv[i], &attr_name->an_desc, &text ) ) {
+ if ( strncasecmp( c->argv[i], "undef:", STRLENOF("undef:") ) == 0 ) {
+ struct berval bv;
+ ber_str2bv( c->argv[i] + STRLENOF("undef:"), 0, 0, &bv );
+ attr_name->an_desc = slap_bv2tmp_ad( &bv, NULL );
+
+ } else if ( slap_str2ad( c->argv[i], &attr_name->an_desc, &text ) ) {
strcpy( c->cr_msg, text );
Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->cr_msg, 0 );
ch_free( qm->attr_sets[num].attrs );
free( tm );
}
- for ( i=0; i<cm->numattrsets; i++ ) {
+ for ( i = 0; i < cm->numattrsets; i++ ) {
+ int j;
+ for ( j = 0; !BER_BVISNULL( &qm->attr_sets[i].attrs[j].an_name ); j++ ) {
+ if ( qm->attr_sets[i].attrs[j].an_desc->ad_flags & SLAP_DESC_TEMPORARY ) {
+ slap_sl_mfuncs.bmf_free( qm->attr_sets[i].attrs[j].an_desc, NULL );
+ }
+ }
free( qm->attr_sets[i].attrs );
}
free( qm->attr_sets );