Fixed slapd empty DN uniqueMember normalization
Fixed slapd empty DN in proxyAuthx control
Fixed slapd parsing of auth{cz} "dn:<pat>" rules
- Fixed slapd set acl recursion (ITS#3140)
Fixed slapd first component bug (ITS#3118)
Fixed slapd TOLOWER macro use bug (ITS#3115)
Fixed slapd TLS context clash bug (ITS#3109)
+ Fixed slapd set acl recursion (ITS#3140)
+ Fixed slapd entry2mods normalization bug (ITS#3144,3152)
Fixed slapd extended match memory leak (ITS#3146)
- Fixed libldap SASL buffering bug (ITS#1181)
+ Fixed back-ldap normalization bug
+ Fixed pcache cache_entries init bug (ITS#3150)
+ Fixed pcache consistency_check bug (ITS#3151)
+ Fixed libldap SASL buffering bug (ITS#3139)
Build Environment
Fixed liblber memory debug portability bug (ITS#3116)
Fixed back-perl perl portability bug (ITS#2554,2946)
return EXIT_FAILURE;
}
- err = ber_printf( seber, "{b}", abs(subentries) == 1 ? 0 : 1 );
+ err = ber_printf( seber, "b", abs(subentries) == 1 ? 0 : 1 );
if ( err == -1 ) {
ber_free( seber, 1 );
fprintf( stderr, _("Subentries control encoding error!\n") );
(zero) removes the
.B ldap.conf
limit.
+A timelimit of
+.I none
+uses
+.I maxInt
+(2147483647, RFC 2251) as timelimit.
A server may impose a maximal timelimit which only
the root user may override.
.TP
(zero) removes the
.B ldap.conf
limit.
+A sizelimit of
+.I none
+uses
+.I maxInt
+(2147483647, RFC 2251) as sizelimit.
A server may impose a maximal sizelimit which only
the root user may override.
.TP
for ( i = 0; i < count; i++ ) {
ber_dupbv(mod->sml_values+i, a_new->a_vals+i);
if ( mod->sml_nvalues ) {
- ber_dupbv( mod->sml_nvalues+i, a_new->a_vals+i );
+ ber_dupbv( mod->sml_nvalues+i, a_new->a_nvals+i );
}
}
ldap_build_entry( Operation *op, LDAPMessage *e, Entry *ent,
struct berval *bdn, int flags );
#define LDAP_BUILD_ENTRY_PRIVATE 0x01
-#define LDAP_BUILD_ENTRY_NORMALIZE 0x02
static struct berval dummy = BER_BVNULL;
const char *text;
int last;
int private = flags & LDAP_BUILD_ENTRY_PRIVATE;
- int normalize = flags & LDAP_BUILD_ENTRY_NORMALIZE;
dncookie dc;
/* safe assumptions ... */
ldap_dnattr_result_rewrite( &dc, attr->a_vals );
}
- if ( normalize && last && attr->a_desc->ad_type->sat_equality &&
+ if ( last && attr->a_desc->ad_type->sat_equality &&
attr->a_desc->ad_type->sat_equality->smr_normalize ) {
int i;
*ent = ch_calloc(1,sizeof(Entry));
- rc = ldap_build_entry(op, e, *ent, &bdn, LDAP_BUILD_ENTRY_NORMALIZE);
+ rc = ldap_build_entry(op, e, *ent, &bdn, 0);
if (rc != LDAP_SUCCESS) {
ch_free(*ent);
void slap_free_ctrls(
Operation *op,
- LDAPControl **ctrls
-)
+ LDAPControl **ctrls )
{
int i;
if( sc->sc_extendedops != NULL ) {
int i;
for( i=0; sc->sc_extendedops[i] != NULL; i++ ) {
- if( strcmp( op->ore_reqoid.bv_val, sc->sc_extendedops[i] )
- == 0 )
+ if( strcmp( op->ore_reqoid.bv_val,
+ sc->sc_extendedops[i] ) == 0 )
{
tagmask=0L;
break;
}
rs->sr_err = sc->sc_parse( op, rs, c );
-
+ assert( rs->sr_err != LDAP_UNAVAILABLE_CRITICAL_EXTENSION );
if( rs->sr_err != LDAP_SUCCESS ) goto return_results;
if ( sc->sc_mask & SLAP_CTRL_FRONTEND ) {
LDAPControl *ctrl )
{
#if 0
- if ( op->o_parseModifyIncrement != SLAP_NO_CONTROL ) {
+ if ( op->o_modifyIncrement != SLAP_NO_CONTROL ) {
rs->sr_text = "modifyIncrement control specified multiple times";
return LDAP_PROTOCOL_ERROR;
}
}
#if 0
- op->o_parseModifyIncrement = ctrl->ldctl_iscritical
+ op->o_modifyIncrement = ctrl->ldctl_iscritical
? SLAP_CRITICAL_CONTROL
: SLAP_NONCRITICAL_CONTROL;
#endif
ctrl->ldctl_value.bv_val, ctrl->ldctl_value.bv_len,
NULL, &dn, SLAP_GETDN_AUTHZID );
- if( rc != LDAP_SUCCESS ) {
+ /* FIXME: empty DN in proxyAuthz control should be legal... */
+ if( rc != LDAP_SUCCESS /* || !dn.bv_len */ ) {
if ( dn.bv_val ) {
ch_free( dn.bv_val );
}
rs->sr_text = "authzId mapping failed";
return LDAP_PROXY_AUTHZ_FAILURE;
-
}
#ifdef NEW_LOGGING
op->o_dn.bv_val = NULL;
op->o_ndn = dn;
+ Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu PROXYAUTHZ dn=\"%s\"\n",
+ op->o_connid, op->o_opid, dn.bv_val, 0, 0 );
+
/*
* NOTE: since slap_sasl_getdn() returns a normalized dn,
* from now on op->o_dn is normalized
return LDAP_PROTOCOL_ERROR;
}
+ if ( op->o_sync != SLAP_NO_CONTROL ) {
+ rs->sr_text = "paged results control specified with sync control";
+ return LDAP_PROTOCOL_ERROR;
+ }
+
if ( ctrl->ldctl_value.bv_len == 0 ) {
rs->sr_text = "paged results control value is empty (or absent)";
return LDAP_PROTOCOL_ERROR;
if ( search_flags & LDAP_SEARCH_FLAG_DOMAIN_SCOPE ) {
if ( op->o_domain_scope != SLAP_NO_CONTROL ) {
- rs->sr_text = "searchOptions control specified multiple times or with domainScope control";
+ rs->sr_text = "searchOptions control specified multiple times "
+ "or with domainScope control";
return LDAP_PROTOCOL_ERROR;
}
if ( search_flags & ~(LDAP_SEARCH_FLAG_DOMAIN_SCOPE) ) {
/* Other search flags not recognised so far */
- rs->sr_text = "searchOptions contained invalid flag";
- return LDAP_UNAVAILABLE_CRITICAL_EXTENSION;
+ rs->sr_text = "searchOptions contained unrecongized flag";
+ return LDAP_UNWILLING_TO_PERFORM;
}
return LDAP_SUCCESS;
struct slap_session_entry *se;
if ( op->o_sync != SLAP_NO_CONTROL ) {
- rs->sr_text = "LDAP Sync control specified multiple times";
+ rs->sr_text = "Sync control specified multiple times";
+ return LDAP_PROTOCOL_ERROR;
+ }
+
+ if ( op->o_pagedresults != SLAP_NO_CONTROL ) {
+ rs->sr_text = "Sync control specified with pagedResults control";
return LDAP_PROTOCOL_ERROR;
}
+
if ( ctrl->ldctl_value.bv_len == 0 ) {
- rs->sr_text = "LDAP Sync control value is empty (or absent)";
+ rs->sr_text = "Sync control value is empty (or absent)";
return LDAP_PROTOCOL_ERROR;
}
}
if ( (tag = ber_scanf( ber, "{i" /*}*/, &mode )) == LBER_ERROR ) {
- rs->sr_text = "LDAP Sync control : mode decoding error";
+ rs->sr_text = "Sync control : mode decoding error";
return LDAP_PROTOCOL_ERROR;
}
mode = SLAP_SYNC_REFRESH_AND_PERSIST;
break;
default:
- rs->sr_text = "LDAP Sync control : unknown update mode";
+ rs->sr_text = "Sync control : unknown update mode";
return LDAP_PROTOCOL_ERROR;
}
if ( tag == LDAP_TAG_SYNC_COOKIE ) {
struct berval tmp_bv;
if (( ber_scanf( ber, /*{*/ "o", &tmp_bv )) == LBER_ERROR ) {
- rs->sr_text = "LDAP Sync control : cookie decoding error";
+ rs->sr_text = "Sync control : cookie decoding error";
return LDAP_PROTOCOL_ERROR;
}
ber_bvarray_add( &op->o_sync_state.octet_str, &tmp_bv );
}
if ( tag == LDAP_TAG_RELOAD_HINT ) {
if (( ber_scanf( ber, /*{*/ "b", &op->o_sync_rhint )) == LBER_ERROR ) {
- rs->sr_text = "LDAP Sync control : rhint decoding error";
+ rs->sr_text = "Sync control : rhint decoding error";
return LDAP_PROTOCOL_ERROR;
}
}
if (( ber_scanf( ber, /*{*/ "}")) == LBER_ERROR ) {
- rs->sr_text = "LDAP Sync control : decoding error";
+ rs->sr_text = "Sync control : decoding error";
return LDAP_PROTOCOL_ERROR;
}
filter_escape_value_x( &f->f_sub_initial, &tmp, op->o_tmpmemctx );
fstr->bv_len += tmp.bv_len;
- fstr->bv_val = op->o_tmprealloc( fstr->bv_val, fstr->bv_len + 1, op->o_tmpmemctx );
+ fstr->bv_val = op->o_tmprealloc( fstr->bv_val, fstr->bv_len + 1,
+ op->o_tmpmemctx );
snprintf( &fstr->bv_val[len-2], tmp.bv_len+3,
/* "(attr=" */ "%s*)",
if ( f->f_sub_any != NULL ) {
for ( i = 0; f->f_sub_any[i].bv_val != NULL; i++ ) {
len = fstr->bv_len;
- filter_escape_value_x( &f->f_sub_any[i], &tmp, op->o_tmpmemctx );
+ filter_escape_value_x( &f->f_sub_any[i],
+ &tmp, op->o_tmpmemctx );
fstr->bv_len += tmp.bv_len + 1;
- fstr->bv_val = op->o_tmprealloc( fstr->bv_val, fstr->bv_len + 1, op->o_tmpmemctx );
+ fstr->bv_val = op->o_tmprealloc( fstr->bv_val, fstr->bv_len + 1,
+ op->o_tmpmemctx );
snprintf( &fstr->bv_val[len-1], tmp.bv_len+3,
/* "(attr=[init]*[any*]" */ "%s*)",
filter_escape_value_x( &f->f_sub_final, &tmp, op->o_tmpmemctx );
fstr->bv_len += tmp.bv_len;
- fstr->bv_val = op->o_tmprealloc( fstr->bv_val, fstr->bv_len + 1, op->o_tmpmemctx );
+ fstr->bv_val = op->o_tmprealloc( fstr->bv_val, fstr->bv_len + 1,
+ op->o_tmpmemctx );
snprintf( &fstr->bv_val[len-1], tmp.bv_len+3,
/* "(attr=[init*][any*]" */ "%s)",
filter2bv_x( op, p, &tmp );
fstr->bv_len += tmp.bv_len;
- fstr->bv_val = op->o_tmprealloc( fstr->bv_val, fstr->bv_len + 1, op->o_tmpmemctx );
+ fstr->bv_val = op->o_tmprealloc( fstr->bv_val, fstr->bv_len + 1,
+ op->o_tmpmemctx );
snprintf( &fstr->bv_val[len-1], tmp.bv_len + 2,
/*"("*/ "%s)", tmp.bv_val );
break;
case LDAP_FILTER_EXT: {
- struct berval ad;
- filter_escape_value_x( &f->f_mr_value, &tmp, op->o_tmpmemctx );
-
- if ( f->f_mr_desc ) {
- ad = f->f_mr_desc->ad_cname;
- } else {
- ad.bv_len = 0;
- ad.bv_val = "";
- }
+ struct berval ad;
+ filter_escape_value_x( &f->f_mr_value, &tmp, op->o_tmpmemctx );
+
+ if ( f->f_mr_desc ) {
+ ad = f->f_mr_desc->ad_cname;
+ } else {
+ ad.bv_len = 0;
+ ad.bv_val = "";
+ }
- fstr->bv_len = ad.bv_len +
- ( f->f_mr_dnattrs ? sizeof(":dn")-1 : 0 ) +
- ( f->f_mr_rule_text.bv_len ? f->f_mr_rule_text.bv_len+1 : 0 ) +
- tmp.bv_len + ( sizeof("(:=)") - 1 );
- fstr->bv_val = op->o_tmpalloc( fstr->bv_len + 1, op->o_tmpmemctx );
-
- snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s%s%s%s:=%s)",
- ad.bv_val,
- f->f_mr_dnattrs ? ":dn" : "",
- f->f_mr_rule_text.bv_len ? ":" : "",
- f->f_mr_rule_text.bv_len ? f->f_mr_rule_text.bv_val : "",
- tmp.bv_val );
- ber_memfree_x( tmp.bv_val, op->o_tmpmemctx );
+ fstr->bv_len = ad.bv_len +
+ ( f->f_mr_dnattrs ? sizeof(":dn")-1 : 0 ) +
+ ( f->f_mr_rule_text.bv_len ? f->f_mr_rule_text.bv_len+1 : 0 ) +
+ tmp.bv_len + ( sizeof("(:=)") - 1 );
+ fstr->bv_val = op->o_tmpalloc( fstr->bv_len + 1, op->o_tmpmemctx );
+
+ snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s%s%s%s:=%s)",
+ ad.bv_val,
+ f->f_mr_dnattrs ? ":dn" : "",
+ f->f_mr_rule_text.bv_len ? ":" : "",
+ f->f_mr_rule_text.bv_len ? f->f_mr_rule_text.bv_val : "",
+ tmp.bv_val );
+ ber_memfree_x( tmp.bv_val, op->o_tmpmemctx );
} break;
case SLAPD_FILTER_COMPUTED:
default:
#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ERR,
- "filter_free: unknown filter type %lu\n", vrf->vrf_choice, 0, 0 );
+ LDAP_LOG( FILTER, ERR, "filter_free: unknown filter type %lu\n",
+ vrf->vrf_choice, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY, "filter_free: unknown filter type=%lu\n",
vrf->vrf_choice, 0, 0 );
simple_vrFilter2bv( op, p, &tmp );
fstr->bv_len += tmp.bv_len;
- fstr->bv_val = op->o_tmprealloc( fstr->bv_val, fstr->bv_len + 1, op->o_tmpmemctx );
+ fstr->bv_val = op->o_tmprealloc( fstr->bv_val, fstr->bv_len + 1,
+ op->o_tmpmemctx );
snprintf( &fstr->bv_val[len-1], tmp.bv_len + 2,
/*"("*/ "%s)", tmp.bv_val );
ber_len_t len;
if ( vrf == NULL ) {
- ber_str2bv_x( "No filter!", sizeof("No filter!")-1, 1, fstr, op->o_tmpmemctx );
+ ber_str2bv_x( "No filter!", sizeof("No filter!")-1, 1, fstr,
+ op->o_tmpmemctx );
return;
}
filter_escape_value_x( &vrf->vrf_sub_initial, &tmp, op->o_tmpmemctx );
fstr->bv_len += tmp.bv_len;
- fstr->bv_val = op->o_tmprealloc( fstr->bv_val, fstr->bv_len + 1, op->o_tmpmemctx );
+ fstr->bv_val = op->o_tmprealloc( fstr->bv_val, fstr->bv_len + 1,
+ op->o_tmpmemctx );
snprintf( &fstr->bv_val[len-2], tmp.bv_len+3,
/* "(attr=" */ "%s*)",
int i;
for ( i = 0; vrf->vrf_sub_any[i].bv_val != NULL; i++ ) {
len = fstr->bv_len;
- filter_escape_value_x( &vrf->vrf_sub_any[i], &tmp, op->o_tmpmemctx );
+ filter_escape_value_x( &vrf->vrf_sub_any[i], &tmp,
+ op->o_tmpmemctx );
fstr->bv_len += tmp.bv_len + 1;
- fstr->bv_val = op->o_tmprealloc( fstr->bv_val, fstr->bv_len + 1, op->o_tmpmemctx );
+ fstr->bv_val = op->o_tmprealloc( fstr->bv_val,
+ fstr->bv_len + 1, op->o_tmpmemctx );
snprintf( &fstr->bv_val[len-1], tmp.bv_len+3,
/* "(attr=[init]*[any*]" */ "%s*)",
filter_escape_value_x( &vrf->vrf_sub_final, &tmp, op->o_tmpmemctx );
fstr->bv_len += tmp.bv_len;
- fstr->bv_val = op->o_tmprealloc( fstr->bv_val, fstr->bv_len + 1, op->o_tmpmemctx );
+ fstr->bv_val = op->o_tmprealloc( fstr->bv_val, fstr->bv_len + 1,
+ op->o_tmpmemctx );
snprintf( &fstr->bv_val[len-1], tmp.bv_len+3,
/* "(attr=[init*][any*]" */ "%s)",
fstr->bv_len = ad.bv_len +
( vrf->vrf_mr_dnattrs ? sizeof(":dn")-1 : 0 ) +
- ( vrf->vrf_mr_rule_text.bv_len ? vrf->vrf_mr_rule_text.bv_len+1 : 0 ) +
+ ( vrf->vrf_mr_rule_text.bv_len
+ ? vrf->vrf_mr_rule_text.bv_len+1 : 0 ) +
tmp.bv_len + ( sizeof("(:=)") - 1 );
fstr->bv_val = op->o_tmpalloc( fstr->bv_len + 1, op->o_tmpmemctx );
ber_str2bv_x(
vrf->vrf_result == LDAP_COMPARE_FALSE ? "(?=false)" :
vrf->vrf_result == LDAP_COMPARE_TRUE ? "(?=true)" :
- vrf->vrf_result == SLAPD_COMPARE_UNDEFINED ? "(?=undefined)" :
- "(?=error)",
+ vrf->vrf_result == SLAPD_COMPARE_UNDEFINED
+ ? "(?=undefined)" : "(?=error)",
vrf->vrf_result == LDAP_COMPARE_FALSE ? sizeof("(?=false)")-1 :
vrf->vrf_result == LDAP_COMPARE_TRUE ? sizeof("(?=true)")-1 :
- vrf->vrf_result == SLAPD_COMPARE_UNDEFINED ? sizeof("(?=undefined)")-1 :
- sizeof("(?=error)")-1,
+ vrf->vrf_result == SLAPD_COMPARE_UNDEFINED
+ ? sizeof("(?=undefined)")-1 : sizeof("(?=error)")-1,
1, fstr, op->o_tmpmemctx );
break;
test_filter(
Operation *op,
Entry *e,
- Filter *f
-)
+ Filter *f )
{
int rc;
#ifdef NEW_LOGGING
Debug( LDAP_DEBUG_FILTER, " EQUALITY\n", 0, 0, 0 );
#endif
- rc = test_ava_filter( op, e, f->f_ava,
- LDAP_FILTER_EQUALITY );
+ rc = test_ava_filter( op, e, f->f_ava, LDAP_FILTER_EQUALITY );
break;
case LDAP_FILTER_SUBSTRINGS:
break;
case LDAP_FILTER_GE:
- rc = test_ava_filter( op, e, f->f_ava,
- LDAP_FILTER_GE );
+ rc = test_ava_filter( op, e, f->f_ava, LDAP_FILTER_GE );
break;
case LDAP_FILTER_LE:
- rc = test_ava_filter( op, e, f->f_ava,
- LDAP_FILTER_LE );
+ rc = test_ava_filter( op, e, f->f_ava, LDAP_FILTER_LE );
break;
case LDAP_FILTER_PRESENT:
#else
Debug( LDAP_DEBUG_FILTER, " PRESENT\n", 0, 0, 0 );
#endif
-
rc = test_presence_filter( op, e, f->f_desc );
break;
#else
Debug( LDAP_DEBUG_FILTER, " APPROX\n", 0, 0, 0 );
#endif
- rc = test_ava_filter( op, e, f->f_ava,
- LDAP_FILTER_APPROX );
+ rc = test_ava_filter( op, e, f->f_ava, LDAP_FILTER_APPROX );
break;
case LDAP_FILTER_AND:
#else
Debug( LDAP_DEBUG_FILTER, " AND\n", 0, 0, 0 );
#endif
-
rc = test_filter_and( op, e, f->f_and );
break;
#else
Debug( LDAP_DEBUG_FILTER, " OR\n", 0, 0, 0 );
#endif
-
rc = test_filter_or( op, e, f->f_or );
break;
#else
Debug( LDAP_DEBUG_FILTER, " NOT\n", 0, 0, 0 );
#endif
-
rc = test_filter( op, e, f->f_not );
/* Flip true to false and false to true
#else
Debug( LDAP_DEBUG_FILTER, " EXT\n", 0, 0, 0 );
#endif
-
rc = test_mra_filter( op, e, f->f_mra );
break;
Debug( LDAP_DEBUG_ANY, " unknown filter type %lu\n",
f->f_choice, 0, 0 );
#endif
-
rc = LDAP_PROTOCOL_ERROR;
}
#else
Debug( LDAP_DEBUG_FILTER, "<= test_filter %d\n", rc, 0, 0 );
#endif
-
return( rc );
}
rc = value_match( &ret, a->a_desc, mra->ma_rule, 0,
bv, &mra->ma_value, &text );
- if( rc != LDAP_SUCCESS ) {
- return rc;
- }
-
- if ( ret == 0 ) {
- return LDAP_COMPARE_TRUE;
- }
+ if( rc != LDAP_SUCCESS ) return rc;
+ if ( ret == 0 ) return LDAP_COMPARE_TRUE;
}
}
- } else {
+ } else {
/*
* No attribute description: test all
*/
rc = asserted_value_validate_normalize( a->a_desc, mra->ma_rule,
SLAP_MR_EXT|SLAP_MR_VALUE_OF_ASSERTION_SYNTAX,
&mra->ma_value, &value, &text, memctx );
- if ( rc != LDAP_SUCCESS ) {
- continue;
- }
+ if ( rc != LDAP_SUCCESS ) continue;
/* check search access */
if ( !access_allowed( op, e,
}
/* check match */
- if (mra->ma_rule == a->a_desc->ad_type->sat_equality)
+ if (mra->ma_rule == a->a_desc->ad_type->sat_equality) {
bv = a->a_nvals;
- else
+ } else {
bv = a->a_vals;
- for ( ; bv->bv_val != NULL; bv++ )
- {
+ }
+
+ for ( ; bv->bv_val != NULL; bv++ ) {
int ret;
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 ) {
rc = LDAP_COMPARE_TRUE;
}
}
op->o_tmpfree( value.bv_val, memctx );
- if ( rc != LDAP_SUCCESS ) {
- return rc ;
- }
+ if ( rc != LDAP_SUCCESS ) return rc;
}
}
for ( iAVA = 0; rdn[ iAVA ]; iAVA++ ) {
LDAPAVA *ava = rdn[ iAVA ];
struct berval *bv = &ava->la_value, value;
- AttributeDescription *ad = (AttributeDescription *)ava->la_private;
+ AttributeDescription *ad =
+ (AttributeDescription *)ava->la_private;
int ret;
const char *text;
mra->ma_rule,
SLAP_MR_EXT|SLAP_MR_VALUE_OF_ASSERTION_SYNTAX,
&mra->ma_value, &value, &text, memctx );
- if ( rc != LDAP_SUCCESS ) {
- continue;
- }
+ if ( rc != LDAP_SUCCESS ) continue;
/* check search access */
if ( !access_allowed( op, e,
- ad, &value, ACL_SEARCH, NULL ) ) {
+ ad, &value, ACL_SEARCH, NULL ) )
+ {
op->o_tmpfree( value.bv_val, memctx );
continue;
}
op->o_tmpfree( value.bv_val, memctx );
}
- if ( rc == LDAP_SUCCESS && ret == 0 ) {
- rc = LDAP_COMPARE_TRUE;
- }
+ if ( rc == LDAP_SUCCESS && ret == 0 ) rc = LDAP_COMPARE_TRUE;
if( rc != LDAP_SUCCESS ) {
ldap_dnfree_x( dn, memctx );
Operation *op,
Entry *e,
AttributeAssertion *ava,
- int type
-)
+ int type )
{
Attribute *a;
rc = value_match( &ret, a->a_desc, mr, 0,
bv, &ava->aa_value, &text );
- if( rc != LDAP_SUCCESS ) {
- return rc;
- }
+ if( rc != LDAP_SUCCESS ) return rc;
switch ( type ) {
case LDAP_FILTER_EQUALITY:
case LDAP_FILTER_APPROX:
- if ( ret == 0 ) {
- return LDAP_COMPARE_TRUE;
- }
+ if ( ret == 0 ) return LDAP_COMPARE_TRUE;
break;
case LDAP_FILTER_GE:
- if ( ret >= 0 ) {
- return LDAP_COMPARE_TRUE;
- }
+ if ( ret >= 0 ) return LDAP_COMPARE_TRUE;
break;
case LDAP_FILTER_LE:
- if ( ret <= 0 ) {
- return LDAP_COMPARE_TRUE;
- }
+ if ( ret <= 0 ) return LDAP_COMPARE_TRUE;
break;
}
}
}
if ( ava->aa_desc == slap_schema.si_ad_hasSubordinates
- && op && op->o_bd && op->o_bd->be_has_subordinates ) {
+ && op && op->o_bd && op->o_bd->be_has_subordinates )
+ {
int hasSubordinates;
struct berval hs;
*/
assert( type == LDAP_FILTER_EQUALITY );
- if (op->o_bd->be_has_subordinates( op, e, &hasSubordinates ) != LDAP_SUCCESS) {
+ if ( op->o_bd->be_has_subordinates( op, e, &hasSubordinates ) !=
+ LDAP_SUCCESS )
+ {
return LDAP_OTHER;
}
return LDAP_OTHER;
}
- if ( bvmatch( &ava->aa_value, &hs ) ) {
- return LDAP_COMPARE_TRUE;
- }
-
+ if ( bvmatch( &ava->aa_value, &hs ) ) return LDAP_COMPARE_TRUE;
return LDAP_COMPARE_FALSE;
}
test_presence_filter(
Operation *op,
Entry *e,
- AttributeDescription *desc
-)
+ AttributeDescription *desc )
{
Attribute *a;
- if ( !access_allowed( op, e, desc, NULL, ACL_SEARCH, NULL ) )
- {
+ if ( !access_allowed( op, e, desc, NULL, ACL_SEARCH, NULL ) ) {
return LDAP_INSUFFICIENT_ACCESS;
}
a = attrs_find( e->e_attrs, desc );
-
if ( a == NULL && desc == slap_schema.si_ad_hasSubordinates ) {
/*
test_filter_and(
Operation *op,
Entry *e,
- Filter *flist
-)
+ Filter *flist )
{
Filter *f;
int rtn = LDAP_COMPARE_TRUE; /* True if empty */
Debug( LDAP_DEBUG_FILTER, "=> test_filter_or\n", 0, 0, 0 );
#endif
-
for ( f = flist; f != NULL; f = f->f_next ) {
int rc = test_filter( op, e, f );
#else
Debug( LDAP_DEBUG_FILTER, "<= test_filter_or %d\n", rtn, 0, 0 );
#endif
-
return rtn;
}
test_substrings_filter(
Operation *op,
Entry *e,
- Filter *f
-)
+ Filter *f )
{
Attribute *a;
Debug( LDAP_DEBUG_FILTER, "begin test_substrings_filter\n", 0, 0, 0 );
#endif
-
if ( !access_allowed( op, e,
f->f_sub_desc, NULL, ACL_SEARCH, NULL ) )
{
MatchingRule *mr = a->a_desc->ad_type->sat_substr;
struct berval *bv;
- if( mr == NULL ) {
- continue;
- }
+ if( mr == NULL ) continue;
- for ( bv = a->a_nvals; bv->bv_val != NULL; bv++ )
- {
+ for ( bv = a->a_nvals; bv->bv_val != NULL; bv++ ) {
int ret;
int rc;
const char *text;
rc = value_match( &ret, a->a_desc, mr, 0,
bv, f->f_sub, &text );
- if( rc != LDAP_SUCCESS ) {
- return rc;
- }
-
- if ( ret == 0 ) {
- return LDAP_COMPARE_TRUE;
- }
+ if( rc != LDAP_SUCCESS ) return rc;
+ if ( ret == 0 ) return LDAP_COMPARE_TRUE;
}
}
#ifdef NEW_LOGGING
- LDAP_LOG( FILTER, ENTRY, "test_substrings_filter: return FALSE\n", 0, 0, 0 );
+ LDAP_LOG( FILTER, ENTRY, "test_substrings_filter: return FALSE\n",
+ 0, 0, 0 );
#else
- Debug( LDAP_DEBUG_FILTER, "end test_substrings_filter 1\n", 0, 0, 0 );
+ Debug( LDAP_DEBUG_FILTER, "end test_substrings_filter 1\n",
+ 0, 0, 0 );
#endif
-
return LDAP_COMPARE_FALSE;
}
slap_name, 0, 0 );
#endif
-
- slap_sasl_destroy();
-
/* let backends do whatever cleanup they need to do */
rc = backend_shutdown( be );
rc = backend_destroy();
+ slap_sasl_destroy();
+
entry_destroy();
ldap_pvt_thread_destroy();
cache_manager *cm = on->on_bi.bi_private;
query_manager* qm = cm->qm;
int i;
- int return_val;
+ int return_val = 0;
Entry *e;
struct berval crp_uuid;
char uuidbuf[ LDAP_LUTIL_UUIDSTR_BUFSIZE ];
si->tail = NULL;
}
}
- } else if ( rs->sr_type == REP_RESULT && !si->over ) {
+ } else if ( rs->sr_type == REP_RESULT && si->count ) {
if ( cache_entries( op, rs, &uuid ) == 0) {
qm->addfunc(qm, &si->query, si->template_id, &uuid);
/* If the consistency checker suspended itself,
}
ldap_pvt_thread_mutex_unlock(&cm->remove_mutex);
}
- /* If there were no queries, defer processing for a while */
- if ( pause ) {
- ldap_pvt_thread_mutex_lock( &syncrepl_rq.rq_mutex );
- cm->cc_paused = 1;
- if ( ldap_pvt_runqueue_isrunning( &syncrepl_rq, rtask )) {
- ldap_pvt_runqueue_stoptask( &syncrepl_rq, rtask );
- }
- ldap_pvt_runqueue_resched( &syncrepl_rq, rtask, 1 );
- ldap_pvt_thread_mutex_unlock( &syncrepl_rq.rq_mutex );
+ ldap_pvt_thread_mutex_lock( &syncrepl_rq.rq_mutex );
+ if ( ldap_pvt_runqueue_isrunning( &syncrepl_rq, rtask )) {
+ ldap_pvt_runqueue_stoptask( &syncrepl_rq, rtask );
}
+ /* If there were no queries, defer processing for a while */
+ cm->cc_paused = pause;
+ ldap_pvt_runqueue_resched( &syncrepl_rq, rtask, pause );
+
+ ldap_pvt_thread_mutex_unlock( &syncrepl_rq.rq_mutex );
return NULL;
}
|| (c) == '(' || (c) == ')' || !ASCII_PRINTABLE(c) )
#define DN_ESCAPE(c) ((c) == SLAP_ESCAPE_CHAR)
-#define DN_SEPARATOR(c) ((c) == ',' || (c) == ';')
+/* NOTE: for consistency, this macro must only operate
+ * on normalized/pretty DN, such that ';' is never used
+ * as RDN separator, and all occurrences of ';' must be escaped */
+#define DN_SEPARATOR(c) ((c) == ',')
#define RDN_ATTRTYPEANDVALUE_SEPARATOR(c) ((c) == '+') /* RFC 2253 */
#define RDN_SEPARATOR(c) (DN_SEPARATOR(c) || RDN_ATTRTYPEANDVALUE_SEPARATOR(c))
#define RDN_NEEDSESCAPE(c) ((c) == '\\' || (c) == '"')
struct sync_cookie *sc = NULL;
struct sync_cookie syncCookie = { NULL, -1, NULL };
struct berval *psub;
+#ifdef HAVE_TLS
+ void *ssl;
+#endif
psub = &si->si_be->be_nsuffix[0];
}
}
+ /* Set SSF to strongest of TLS, SASL SSFs */
+ op->o_sasl_ssf = 0;
+ op->o_tls_ssf = 0;
+#ifdef HAVE_TLS
+ if ( ldap_get_option( si->si_ld, LDAP_OPT_X_TLS_SSL_CTX, &ssl ) == LDAP_SUCCESS &&
+ ssl != NULL ) {
+ op->o_tls_ssf = ldap_pvt_tls_get_strength( ssl );
+ }
+#endif /* HAVE_TLS */
+ ldap_get_option( si->si_ld, LDAP_OPT_X_SASL_SSF, &op->o_sasl_ssf );
+ op->o_transport_ssf = op->o_ssf = ( op->o_sasl_ssf > op->o_tls_ssf ) ?
+ op->o_sasl_ssf : op->o_tls_ssf;
+
/* get syncrepl cookie of shadow replica from subentry */
assert( si->si_rid < 1000 );