mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-22 07:39:35 -05:00
cleanup
This commit is contained in:
parent
8db24ce9e8
commit
926b2cf0bf
1 changed files with 35 additions and 42 deletions
|
|
@ -70,6 +70,8 @@ blobValidate(
|
|||
return LDAP_SUCCESS;
|
||||
}
|
||||
|
||||
#define berValidate blobValidate
|
||||
|
||||
static int
|
||||
octetStringMatch(
|
||||
int *matchp,
|
||||
|
|
@ -79,12 +81,11 @@ octetStringMatch(
|
|||
struct berval *value,
|
||||
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 ) {
|
||||
match = memcmp( value->bv_val,
|
||||
((struct berval *) assertedValue)->bv_val,
|
||||
value->bv_len );
|
||||
match = memcmp( value->bv_val, asserted->bv_val, value->bv_len );
|
||||
}
|
||||
|
||||
*matchp = match;
|
||||
|
|
@ -100,11 +101,11 @@ octetStringOrderingMatch(
|
|||
struct berval *value,
|
||||
void *assertedValue )
|
||||
{
|
||||
struct berval *asserted = (struct berval *) assertedValue;
|
||||
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,
|
||||
((struct berval *) assertedValue)->bv_val,
|
||||
int match = memcmp( value->bv_val, asserted->bv_val,
|
||||
(v_len < av_len ? v_len : av_len) );
|
||||
|
||||
if( match == 0 ) match = v_len - av_len;
|
||||
|
|
@ -216,7 +217,7 @@ int octetStringFilter(
|
|||
}
|
||||
|
||||
static int
|
||||
octetStringSubstringsMatch (
|
||||
octetStringSubstringsMatch(
|
||||
int *matchp,
|
||||
slap_mask_t flags,
|
||||
Syntax *syntax,
|
||||
|
|
@ -228,7 +229,7 @@ octetStringSubstringsMatch (
|
|||
SubstringsAssertion *sub = assertedValue;
|
||||
struct berval left = *value;
|
||||
int i;
|
||||
ber_len_t inlen=0;
|
||||
ber_len_t inlen = 0;
|
||||
|
||||
/* Add up asserted input length */
|
||||
if( sub->sa_initial.bv_val ) {
|
||||
|
|
@ -341,7 +342,7 @@ done:
|
|||
|
||||
/* Substrings Index generation function */
|
||||
static int
|
||||
octetStringSubstringsIndexer (
|
||||
octetStringSubstringsIndexer(
|
||||
slap_mask_t use,
|
||||
slap_mask_t flags,
|
||||
Syntax *syntax,
|
||||
|
|
@ -371,15 +372,15 @@ octetStringSubstringsIndexer (
|
|||
if( flags & SLAP_INDEX_SUBSTR_INITIAL ) {
|
||||
if( values[i].bv_len >= SLAP_INDEX_SUBSTR_MAXLEN ) {
|
||||
nkeys += SLAP_INDEX_SUBSTR_MAXLEN -
|
||||
( SLAP_INDEX_SUBSTR_MINLEN - 1);
|
||||
(SLAP_INDEX_SUBSTR_MINLEN - 1);
|
||||
} else {
|
||||
nkeys += values[i].bv_len - ( SLAP_INDEX_SUBSTR_MINLEN - 1 );
|
||||
nkeys += values[i].bv_len - (SLAP_INDEX_SUBSTR_MINLEN - 1);
|
||||
}
|
||||
}
|
||||
|
||||
if( flags & SLAP_INDEX_SUBSTR_ANY ) {
|
||||
if( values[i].bv_len >= SLAP_INDEX_SUBSTR_MAXLEN ) {
|
||||
nkeys += values[i].bv_len - ( SLAP_INDEX_SUBSTR_MAXLEN - 1 );
|
||||
nkeys += values[i].bv_len - (SLAP_INDEX_SUBSTR_MAXLEN - 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -388,7 +389,7 @@ octetStringSubstringsIndexer (
|
|||
nkeys += SLAP_INDEX_SUBSTR_MAXLEN -
|
||||
( SLAP_INDEX_SUBSTR_MINLEN - 1);
|
||||
} else {
|
||||
nkeys += values[i].bv_len - ( SLAP_INDEX_SUBSTR_MINLEN - 1 );
|
||||
nkeys += values[i].bv_len - (SLAP_INDEX_SUBSTR_MINLEN - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -414,7 +415,7 @@ octetStringSubstringsIndexer (
|
|||
( values[i].bv_len >= SLAP_INDEX_SUBSTR_MAXLEN ) )
|
||||
{
|
||||
char pre = SLAP_INDEX_SUBSTR_PREFIX;
|
||||
max = values[i].bv_len - ( SLAP_INDEX_SUBSTR_MAXLEN - 1);
|
||||
max = values[i].bv_len - (SLAP_INDEX_SUBSTR_MAXLEN - 1);
|
||||
|
||||
for( j=0; j<max; j++ ) {
|
||||
HASH_Init( &HASHcontext );
|
||||
|
|
@ -619,7 +620,6 @@ octetStringSubstringsFilter (
|
|||
|
||||
ber_dupbv( &keys[nkeys++], &digest );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -676,8 +676,8 @@ bitStringValidate(
|
|||
}
|
||||
|
||||
/*
|
||||
* rfc 2252 section 6.3 Bit String
|
||||
* bitstring = "'" *binary-digit "'"
|
||||
* RFC 2252 section 6.3 Bit String
|
||||
* bitstring = "'" *binary-digit "'B"
|
||||
* binary-digit = "0" / "1"
|
||||
* example: '0101111101'B
|
||||
*/
|
||||
|
|
@ -1504,8 +1504,7 @@ integerMatch(
|
|||
match = (vlen != avlen
|
||||
? ( vlen < avlen ? -1 : 1 )
|
||||
: memcmp( v, av, vlen ));
|
||||
if( vsign < 0 )
|
||||
match = -match;
|
||||
if( vsign < 0 ) match = -match;
|
||||
}
|
||||
|
||||
*matchp = match;
|
||||
|
|
@ -1547,7 +1546,6 @@ integerNormalize(
|
|||
int negative=0;
|
||||
ber_len_t len;
|
||||
|
||||
|
||||
p = val->bv_val;
|
||||
len = val->bv_len;
|
||||
|
||||
|
|
@ -2094,8 +2092,7 @@ static int
|
|||
serial_and_issuer_parse(
|
||||
struct berval *assertion,
|
||||
struct berval *serial,
|
||||
struct berval *issuer_dn
|
||||
)
|
||||
struct berval *issuer_dn )
|
||||
{
|
||||
char *begin;
|
||||
char *end;
|
||||
|
|
@ -2516,7 +2513,6 @@ utcTimeValidate(
|
|||
struct berval *in )
|
||||
{
|
||||
int parts[9];
|
||||
|
||||
return check_time_syntax(in, 1, parts);
|
||||
}
|
||||
#endif
|
||||
|
|
@ -2527,7 +2523,6 @@ generalizedTimeValidate(
|
|||
struct berval *in )
|
||||
{
|
||||
int parts[9];
|
||||
|
||||
return check_time_syntax(in, 0, parts);
|
||||
}
|
||||
|
||||
|
|
@ -2665,7 +2660,6 @@ static slap_syntax_defs_rec syntax_defs[] = {
|
|||
SLAP_SYNTAX_BLOB, blobValidate, NULL},
|
||||
{"( 1.3.6.1.4.1.1466.115.121.1.5 DESC 'Binary' "
|
||||
X_NOT_H_R ")",
|
||||
#define berValidate blobValidate
|
||||
SLAP_SYNTAX_BER, berValidate, NULL},
|
||||
{"( 1.3.6.1.4.1.1466.115.121.1.6 DESC 'Bit String' )",
|
||||
0, bitStringValidate, NULL },
|
||||
|
|
@ -3152,7 +3146,7 @@ int
|
|||
slap_schema_init( void )
|
||||
{
|
||||
int res;
|
||||
int i = 0;
|
||||
int i;
|
||||
|
||||
/* we should only be called once (from main) */
|
||||
assert( schema_init_done == 0 );
|
||||
|
|
@ -3195,7 +3189,6 @@ slap_schema_init( void )
|
|||
void
|
||||
schema_destroy( void )
|
||||
{
|
||||
int i;
|
||||
oidm_destroy();
|
||||
oc_destroy();
|
||||
at_destroy();
|
||||
|
|
|
|||
Loading…
Reference in a new issue