This commit is contained in:
Kurt Zeilenga 2004-12-07 18:40:47 +00:00
parent d3d73a0b96
commit d616bd4ff8
7 changed files with 61 additions and 62 deletions

View file

@ -93,8 +93,8 @@ str2entry( char *s )
if( e == NULL ) { if( e == NULL ) {
Debug( LDAP_DEBUG_ANY, Debug( LDAP_DEBUG_ANY,
"<= str2entry NULL (entry allocation failed)\n", "<= str2entry NULL (entry allocation failed)\n",
0, 0, 0 ); 0, 0, 0 );
return( NULL ); return( NULL );
} }
@ -116,7 +116,7 @@ str2entry( char *s )
if ( ldif_parse_line( s, &type, &vals[0].bv_val, &vals[0].bv_len ) != 0 ) { if ( ldif_parse_line( s, &type, &vals[0].bv_val, &vals[0].bv_len ) != 0 ) {
Debug( LDAP_DEBUG_TRACE, Debug( LDAP_DEBUG_TRACE,
"<= str2entry NULL (parse_line)\n", 0, 0, 0 ); "<= str2entry NULL (parse_line)\n", 0, 0, 0 );
continue; continue;
} }
@ -126,7 +126,7 @@ str2entry( char *s )
if ( e->e_dn != NULL ) { if ( e->e_dn != NULL ) {
Debug( LDAP_DEBUG_ANY, "str2entry: " Debug( LDAP_DEBUG_ANY, "str2entry: "
"entry %ld has multiple DNs \"%s\" and \"%s\"\n", "entry %ld has multiple DNs \"%s\" and \"%s\"\n",
(long) e->e_id, e->e_dn, vals[0].bv_val ); (long) e->e_id, e->e_dn, vals[0].bv_val );
free( vals[0].bv_val ); free( vals[0].bv_val );
entry_free( e ); entry_free( e );
return NULL; return NULL;
@ -254,7 +254,7 @@ str2entry( char *s )
rc = attr_merge( e, ad, vals, nvalsp ); rc = attr_merge( e, ad, vals, nvalsp );
if( rc != 0 ) { if( rc != 0 ) {
Debug( LDAP_DEBUG_ANY, Debug( LDAP_DEBUG_ANY,
"<= str2entry NULL (attr_merge)\n", 0, 0, 0 ); "<= str2entry NULL (attr_merge)\n", 0, 0, 0 );
entry_free( e ); entry_free( e );
free( vals[0].bv_val ); free( vals[0].bv_val );
free( type ); free( type );
@ -271,7 +271,7 @@ str2entry( char *s )
/* check to make sure there was a dn: line */ /* check to make sure there was a dn: line */
if ( e->e_dn == NULL ) { if ( e->e_dn == NULL ) {
Debug( LDAP_DEBUG_ANY, "str2entry: entry %ld has no dn\n", Debug( LDAP_DEBUG_ANY, "str2entry: entry %ld has no dn\n",
(long) e->e_id, 0, 0 ); (long) e->e_id, 0, 0 );
entry_free( e ); entry_free( e );
return NULL; return NULL;
} }
@ -289,7 +289,7 @@ str2entry( char *s )
ptrdiff_t offset; \ ptrdiff_t offset; \
offset = (int) (ecur - ebuf); \ offset = (int) (ecur - ebuf); \
ebuf = (unsigned char *) ch_realloc( (char *) ebuf, \ ebuf = (unsigned char *) ch_realloc( (char *) ebuf, \
emaxsize + GRABSIZE ); \ emaxsize + GRABSIZE ); \
emaxsize += GRABSIZE; \ emaxsize += GRABSIZE; \
ecur = ebuf + offset; \ ecur = ebuf + offset; \
} \ } \
@ -297,8 +297,8 @@ str2entry( char *s )
char * char *
entry2str( entry2str(
Entry *e, Entry *e,
int *len ) int *len )
{ {
Attribute *a; Attribute *a;
struct berval *bv; struct berval *bv;
@ -332,7 +332,7 @@ entry2str(
MAKE_SPACE( LDIF_SIZE_NEEDED( tmplen, bv->bv_len )); MAKE_SPACE( LDIF_SIZE_NEEDED( tmplen, bv->bv_len ));
ldif_sput( (char **) &ecur, LDIF_PUT_VALUE, ldif_sput( (char **) &ecur, LDIF_PUT_VALUE,
a->a_desc->ad_cname.bv_val, a->a_desc->ad_cname.bv_val,
bv->bv_val, bv->bv_len ); bv->bv_val, bv->bv_len );
} }
} }
MAKE_SPACE( 1 ); MAKE_SPACE( 1 );
@ -558,27 +558,27 @@ int entry_encode(Entry *e, struct berval *bv)
ptr += a->a_desc->ad_cname.bv_len; ptr += a->a_desc->ad_cname.bv_len;
*ptr++ = '\0'; *ptr++ = '\0';
if (a->a_vals) { if (a->a_vals) {
for (i=0; a->a_vals[i].bv_val; i++); for (i=0; a->a_vals[i].bv_val; i++);
entry_putlen(&ptr, i); entry_putlen(&ptr, i);
for (i=0; a->a_vals[i].bv_val; i++) { for (i=0; a->a_vals[i].bv_val; i++) {
entry_putlen(&ptr, a->a_vals[i].bv_len); entry_putlen(&ptr, a->a_vals[i].bv_len);
AC_MEMCPY(ptr, a->a_vals[i].bv_val, AC_MEMCPY(ptr, a->a_vals[i].bv_val,
a->a_vals[i].bv_len); a->a_vals[i].bv_len);
ptr += a->a_vals[i].bv_len; ptr += a->a_vals[i].bv_len;
*ptr++ = '\0'; *ptr++ = '\0';
}
if (a->a_nvals != a->a_vals) {
entry_putlen(&ptr, i);
for (i=0; a->a_nvals[i].bv_val; i++) {
entry_putlen(&ptr, a->a_nvals[i].bv_len);
AC_MEMCPY(ptr, a->a_nvals[i].bv_val,
a->a_nvals[i].bv_len);
ptr += a->a_nvals[i].bv_len;
*ptr++ = '\0';
} }
} else { if (a->a_nvals != a->a_vals) {
entry_putlen(&ptr, 0); entry_putlen(&ptr, i);
} for (i=0; a->a_nvals[i].bv_val; i++) {
entry_putlen(&ptr, a->a_nvals[i].bv_len);
AC_MEMCPY(ptr, a->a_nvals[i].bv_val,
a->a_nvals[i].bv_len);
ptr += a->a_nvals[i].bv_len;
*ptr++ = '\0';
}
} else {
entry_putlen(&ptr, 0);
}
} }
} }
*ptr = '\0'; *ptr = '\0';
@ -623,8 +623,8 @@ int entry_decode(struct berval *bv, Entry **e)
x->e_nname.bv_len = i; x->e_nname.bv_len = i;
ptr += i+1; ptr += i+1;
Debug( LDAP_DEBUG_TRACE, Debug( LDAP_DEBUG_TRACE,
"entry_decode: \"%s\"\n", "entry_decode: \"%s\"\n",
x->e_dn, 0, 0 ); x->e_dn, 0, 0 );
x->e_bv = *bv; x->e_bv = *bv;
/* A valid entry must have at least one attr, so this /* A valid entry must have at least one attr, so this

View file

@ -208,18 +208,19 @@ static int test_mra_filter(
const char *text; const char *text;
#ifdef LDAP_COMP_MATCH #ifdef LDAP_COMP_MATCH
/* Component Matching */ /* Component Matching */
if( mra->ma_cf && mra->ma_rule->smr_usage & SLAP_MR_COMPONENT ) { if( mra->ma_cf &&
rc = value_match( &ret, a->a_desc, mra->ma_rule, 0, mra->ma_rule->smr_usage & SLAP_MR_COMPONENT )
(struct berval *)a,(void*) mra , &text ); {
} rc = value_match( &ret, a->a_desc, mra->ma_rule, 0,
else { (struct berval *)a,(void*) mra , &text );
#endif } else
rc = value_match( &ret, a->a_desc, mra->ma_rule, 0,
bv, &mra->ma_value, &text );
#ifdef LDAP_COMP_MATCH
}
#endif #endif
{
rc = value_match( &ret, a->a_desc, mra->ma_rule, 0,
bv, &mra->ma_value, &text );
}
if( rc != LDAP_SUCCESS ) return rc; if( rc != LDAP_SUCCESS ) return rc;
if ( ret == 0 ) return LDAP_COMPARE_TRUE; if ( ret == 0 ) return LDAP_COMPARE_TRUE;
} }
@ -263,20 +264,19 @@ static int test_mra_filter(
int ret; int ret;
#ifdef LDAP_COMP_MATCH #ifdef LDAP_COMP_MATCH
/* Component Matching */ /* Component Matching */
if( mra->ma_cf && if( mra->ma_cf &&
mra->ma_rule->smr_usage & SLAP_MR_COMPONENT) { mra->ma_rule->smr_usage & SLAP_MR_COMPONENT)
rc = value_match( &ret, a->a_desc, mra->ma_rule, 0, {
(struct berval*)a, (void*)mra, &text ); rc = value_match( &ret, a->a_desc, mra->ma_rule, 0,
} (struct berval*)a, (void*)mra, &text );
else { } else
#endif
rc = value_match( &ret, a->a_desc, mra->ma_rule, 0,
bv, &value, &text );
#ifdef LDAP_COMP_MATCH
}
#endif #endif
{
rc = value_match( &ret, a->a_desc, mra->ma_rule, 0,
bv, &value, &text );
}
if( rc != LDAP_SUCCESS ) break; if( rc != LDAP_SUCCESS ) break;
if ( ret == 0 ) { if ( ret == 0 ) {

View file

@ -31,8 +31,9 @@ mra_free(
{ {
#ifdef LDAP_COMP_MATCH #ifdef LDAP_COMP_MATCH
/* free component assertion */ /* free component assertion */
if ( mra->ma_rule->smr_usage & SLAP_MR_COMPONENT ) if ( mra->ma_rule->smr_usage & SLAP_MR_COMPONENT ) {
component_free( mra->ma_cf ); component_free( mra->ma_cf );
}
#endif #endif
/* op->o_tmpfree( mra->ma_value.bv_val, op->o_tmpmemctx ); */ /* op->o_tmpfree( mra->ma_value.bv_val, op->o_tmpmemctx ); */
ch_free( mra->ma_value.bv_val ); ch_free( mra->ma_value.bv_val );

View file

@ -375,7 +375,6 @@ LDAP_SLAPD_F (int) componentFilterValidate LDAP_P((
LDAP_SLAPD_F (int) allComponentsValidate LDAP_P(( LDAP_SLAPD_F (int) allComponentsValidate LDAP_P((
Syntax *syntax, Syntax *syntax,
struct berval* bv )); struct berval* bv ));
#endif #endif
/* /*

View file

@ -3078,8 +3078,8 @@ static slap_syntax_defs_rec syntax_defs[] = {
{"( 1.2.36.79672281.1.5.0 DESC 'RDN' )", {"( 1.2.36.79672281.1.5.0 DESC 'RDN' )",
0, rdnValidate, rdnPretty}, 0, rdnValidate, rdnPretty},
#ifdef LDAP_COMP_MATCH #ifdef LDAP_COMP_MATCH
{"( 1.2.36.79672281.1.5.3 DESC 'allComponents' )", {"( 1.2.36.79672281.1.5.3 DESC 'allComponents' )",
0, allComponentsValidate, NULL}, 0, allComponentsValidate, NULL},
{"( 1.2.36.79672281.1.5.2 DESC 'componentFilterMatch assertion') ", {"( 1.2.36.79672281.1.5.2 DESC 'componentFilterMatch assertion') ",
0, componentFilterValidate, NULL}, 0, componentFilterValidate, NULL},
#endif #endif

View file

@ -1029,7 +1029,6 @@ static struct slap_schema_syn_map {
offsetof(struct slap_internal_schema, si_syn_integer) }, offsetof(struct slap_internal_schema, si_syn_integer) },
{ "1.3.6.1.4.1.1466.115.121.1.40", { "1.3.6.1.4.1.1466.115.121.1.40",
offsetof(struct slap_internal_schema, si_syn_octetString) }, offsetof(struct slap_internal_schema, si_syn_octetString) },
{ "1.3.6.1.4.1.1466.115.121.1.3", { "1.3.6.1.4.1.1466.115.121.1.3",
offsetof(struct slap_internal_schema, si_syn_attributeTypeDesc) }, offsetof(struct slap_internal_schema, si_syn_attributeTypeDesc) },
{ "1.3.6.1.4.1.1466.115.121.1.16", { "1.3.6.1.4.1.1466.115.121.1.16",
@ -1044,10 +1043,8 @@ static struct slap_schema_syn_map {
offsetof(struct slap_internal_schema, si_syn_nameFormDesc) }, offsetof(struct slap_internal_schema, si_syn_nameFormDesc) },
{ "1.3.6.1.4.1.1466.115.121.1.37", { "1.3.6.1.4.1.1466.115.121.1.37",
offsetof(struct slap_internal_schema, si_syn_objectClassDesc) }, offsetof(struct slap_internal_schema, si_syn_objectClassDesc) },
{ "1.3.6.1.4.1.1466.115.121.1.17", { "1.3.6.1.4.1.1466.115.121.1.17",
offsetof(struct slap_internal_schema, si_syn_ditStructureRuleDesc) }, offsetof(struct slap_internal_schema, si_syn_ditStructureRuleDesc) },
{ NULL, 0 } { NULL, 0 }
}; };

View file

@ -476,7 +476,7 @@ typedef struct slap_matching_rule {
#define SLAP_MR_ORDERING 0x0200U #define SLAP_MR_ORDERING 0x0200U
#define SLAP_MR_SUBSTR 0x0400U #define SLAP_MR_SUBSTR 0x0400U
#define SLAP_MR_EXT 0x0800U /* implicitly extensible */ #define SLAP_MR_EXT 0x0800U /* implicitly extensible */
#define SLAP_MR_ORDERED_INDEX 0x1000U #define SLAP_MR_ORDERED_INDEX 0x1000U
#ifdef LDAP_COMP_MATCH #ifdef LDAP_COMP_MATCH
#define SLAP_MR_COMPONENT 0x2000U #define SLAP_MR_COMPONENT 0x2000U
#endif #endif
@ -2675,7 +2675,7 @@ typedef int (SLAP_CTRL_PARSE_FN) LDAP_P((
#define LDAP_COMP_FILTER_ITEM ((ber_tag_t) 0xa3U) #define LDAP_COMP_FILTER_ITEM ((ber_tag_t) 0xa3U)
#define LDAP_COMP_FILTER_UNDEFINED ((ber_tag_t) 0xa4U) #define LDAP_COMP_FILTER_UNDEFINED ((ber_tag_t) 0xa4U)
typedef struct slap_component_id{ typedef struct slap_component_id {
int ci_type; int ci_type;
struct slap_component_id *ci_next; struct slap_component_id *ci_next;
@ -2730,10 +2730,12 @@ typedef struct slap_component_assertion_value {
char* cav_ptr; char* cav_ptr;
char* cav_end; char* cav_end;
} ComponentAssertionValue; } ComponentAssertionValue;
/*
#if 0
typedef int encoder_func LDAP_P(( typedef int encoder_func LDAP_P((
void* b, void* b,
void* comp));*/ void* comp));
#endif
struct slap_component_syntax_info; struct slap_component_syntax_info;