This commit is contained in:
Kurt Zeilenga 2003-04-07 03:46:22 +00:00
parent 8db24ce9e8
commit 926b2cf0bf

View file

@ -70,6 +70,8 @@ blobValidate(
return LDAP_SUCCESS; return LDAP_SUCCESS;
} }
#define berValidate blobValidate
static int static int
octetStringMatch( octetStringMatch(
int *matchp, int *matchp,
@ -79,12 +81,11 @@ octetStringMatch(
struct berval *value, struct berval *value,
void *assertedValue ) void *assertedValue )
{ {
int match = value->bv_len - ((struct berval *) assertedValue)->bv_len; struct berval *asserted = (struct berval *) assertedValue;
int match = value->bv_len - asserted->bv_len;
if( match == 0 ) { if( match == 0 ) {
match = memcmp( value->bv_val, match = memcmp( value->bv_val, asserted->bv_val, value->bv_len );
((struct berval *) assertedValue)->bv_val,
value->bv_len );
} }
*matchp = match; *matchp = match;
@ -100,11 +101,11 @@ octetStringOrderingMatch(
struct berval *value, struct berval *value,
void *assertedValue ) void *assertedValue )
{ {
struct berval *asserted = (struct berval *) assertedValue;
ber_len_t v_len = value->bv_len; ber_len_t v_len = value->bv_len;
ber_len_t av_len = ((struct berval *) assertedValue)->bv_len; ber_len_t av_len = asserted->bv_len;
int match = memcmp( value->bv_val, int match = memcmp( value->bv_val, asserted->bv_val,
((struct berval *) assertedValue)->bv_val,
(v_len < av_len ? v_len : av_len) ); (v_len < av_len ? v_len : av_len) );
if( match == 0 ) match = v_len - av_len; if( match == 0 ) match = v_len - av_len;
@ -619,7 +620,6 @@ octetStringSubstringsFilter (
ber_dupbv( &keys[nkeys++], &digest ); ber_dupbv( &keys[nkeys++], &digest );
} }
} }
} }
@ -676,8 +676,8 @@ bitStringValidate(
} }
/* /*
* rfc 2252 section 6.3 Bit String * RFC 2252 section 6.3 Bit String
* bitstring = "'" *binary-digit "'" * bitstring = "'" *binary-digit "'B"
* binary-digit = "0" / "1" * binary-digit = "0" / "1"
* example: '0101111101'B * example: '0101111101'B
*/ */
@ -1504,8 +1504,7 @@ integerMatch(
match = (vlen != avlen match = (vlen != avlen
? ( vlen < avlen ? -1 : 1 ) ? ( vlen < avlen ? -1 : 1 )
: memcmp( v, av, vlen )); : memcmp( v, av, vlen ));
if( vsign < 0 ) if( vsign < 0 ) match = -match;
match = -match;
} }
*matchp = match; *matchp = match;
@ -1547,7 +1546,6 @@ integerNormalize(
int negative=0; int negative=0;
ber_len_t len; ber_len_t len;
p = val->bv_val; p = val->bv_val;
len = val->bv_len; len = val->bv_len;
@ -2094,8 +2092,7 @@ static int
serial_and_issuer_parse( serial_and_issuer_parse(
struct berval *assertion, struct berval *assertion,
struct berval *serial, struct berval *serial,
struct berval *issuer_dn struct berval *issuer_dn )
)
{ {
char *begin; char *begin;
char *end; char *end;
@ -2516,7 +2513,6 @@ utcTimeValidate(
struct berval *in ) struct berval *in )
{ {
int parts[9]; int parts[9];
return check_time_syntax(in, 1, parts); return check_time_syntax(in, 1, parts);
} }
#endif #endif
@ -2527,7 +2523,6 @@ generalizedTimeValidate(
struct berval *in ) struct berval *in )
{ {
int parts[9]; int parts[9];
return check_time_syntax(in, 0, parts); return check_time_syntax(in, 0, parts);
} }
@ -2665,7 +2660,6 @@ static slap_syntax_defs_rec syntax_defs[] = {
SLAP_SYNTAX_BLOB, blobValidate, NULL}, SLAP_SYNTAX_BLOB, blobValidate, NULL},
{"( 1.3.6.1.4.1.1466.115.121.1.5 DESC 'Binary' " {"( 1.3.6.1.4.1.1466.115.121.1.5 DESC 'Binary' "
X_NOT_H_R ")", X_NOT_H_R ")",
#define berValidate blobValidate
SLAP_SYNTAX_BER, berValidate, NULL}, SLAP_SYNTAX_BER, berValidate, NULL},
{"( 1.3.6.1.4.1.1466.115.121.1.6 DESC 'Bit String' )", {"( 1.3.6.1.4.1.1466.115.121.1.6 DESC 'Bit String' )",
0, bitStringValidate, NULL }, 0, bitStringValidate, NULL },
@ -3152,7 +3146,7 @@ int
slap_schema_init( void ) slap_schema_init( void )
{ {
int res; int res;
int i = 0; int i;
/* we should only be called once (from main) */ /* we should only be called once (from main) */
assert( schema_init_done == 0 ); assert( schema_init_done == 0 );
@ -3195,7 +3189,6 @@ slap_schema_init( void )
void void
schema_destroy( void ) schema_destroy( void )
{ {
int i;
oidm_destroy(); oidm_destroy();
oc_destroy(); oc_destroy();
at_destroy(); at_destroy();