mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-02-15 16:47:56 -05:00
prefix undef attrs with undef: (ITS#6823)
This commit is contained in:
parent
e72c093a55
commit
4e3eac93f7
2 changed files with 22 additions and 2 deletions
|
|
@ -79,6 +79,7 @@ special attributes "*" (all user attributes), "+" (all operational attributes)
|
||||||
or both; in the latter case, any other attribute is redundant and should
|
or both; in the latter case, any other attribute is redundant and should
|
||||||
be avoided for clarity. A set of attributes can contain "1.1" as the only
|
be avoided for clarity. A set of attributes can contain "1.1" as the only
|
||||||
attribute; in this case, only the presence of the entries is cached.
|
attribute; in this case, only the presence of the entries is cached.
|
||||||
|
Attributes prefixed by "undef:" need not be present in the schema.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B pcacheMaxQueries <queries>
|
.B pcacheMaxQueries <queries>
|
||||||
|
|
|
||||||
|
|
@ -3763,13 +3763,21 @@ pc_cf_gen( ConfigArgs *c )
|
||||||
/* count the attr length */
|
/* count the attr length */
|
||||||
for ( attr_name = qm->attr_sets[i].attrs;
|
for ( attr_name = qm->attr_sets[i].attrs;
|
||||||
attr_name->an_name.bv_val; attr_name++ )
|
attr_name->an_name.bv_val; attr_name++ )
|
||||||
|
{
|
||||||
bv.bv_len += attr_name->an_name.bv_len + 1;
|
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 );
|
bv.bv_val = ch_malloc( bv.bv_len+1 );
|
||||||
ptr = lutil_strcopy( bv.bv_val, c->cr_msg );
|
ptr = lutil_strcopy( bv.bv_val, c->cr_msg );
|
||||||
for ( attr_name = qm->attr_sets[i].attrs;
|
for ( attr_name = qm->attr_sets[i].attrs;
|
||||||
attr_name->an_name.bv_val; attr_name++ ) {
|
attr_name->an_name.bv_val; attr_name++ ) {
|
||||||
*ptr++ = ' ';
|
*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 );
|
ptr = lutil_strcopy( ptr, attr_name->an_name.bv_val );
|
||||||
}
|
}
|
||||||
ber_bvarray_add( &c->rvalue_vals, &bv );
|
ber_bvarray_add( &c->rvalue_vals, &bv );
|
||||||
|
|
@ -4025,7 +4033,12 @@ pc_cf_gen( ConfigArgs *c )
|
||||||
all_op = 1;
|
all_op = 1;
|
||||||
BER_BVSTR( &attr_name->an_name, LDAP_ALL_OPERATIONAL_ATTRIBUTES );
|
BER_BVSTR( &attr_name->an_name, LDAP_ALL_OPERATIONAL_ATTRIBUTES );
|
||||||
} else {
|
} 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 );
|
strcpy( c->cr_msg, text );
|
||||||
Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->cr_msg, 0 );
|
Debug( LDAP_DEBUG_CONFIG, "%s: %s.\n", c->log, c->cr_msg, 0 );
|
||||||
ch_free( qm->attr_sets[num].attrs );
|
ch_free( qm->attr_sets[num].attrs );
|
||||||
|
|
@ -4793,7 +4806,13 @@ pcache_db_close(
|
||||||
free( tm );
|
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[i].attrs );
|
||||||
}
|
}
|
||||||
free( qm->attr_sets );
|
free( qm->attr_sets );
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue