mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-02-16 09:09:07 -05:00
Fix aliasing.
This commit is contained in:
parent
152ec5c4ed
commit
bfbe3e49ee
2 changed files with 19 additions and 2 deletions
|
|
@ -95,6 +95,7 @@ Entry *deref_internal_r(
|
||||||
|
|
||||||
/* check if aliasDN is a subordinate of any DN in our list */
|
/* check if aliasDN is a subordinate of any DN in our list */
|
||||||
if( dnlist_subordinate( dnlist, aliasDN ) ) {
|
if( dnlist_subordinate( dnlist, aliasDN ) ) {
|
||||||
|
ch_free( aliasDN );
|
||||||
*matched = entry;
|
*matched = entry;
|
||||||
entry = NULL;
|
entry = NULL;
|
||||||
*err = LDAP_ALIAS_PROBLEM;
|
*err = LDAP_ALIAS_PROBLEM;
|
||||||
|
|
@ -105,6 +106,7 @@ Entry *deref_internal_r(
|
||||||
/* attempt to dereference alias */
|
/* attempt to dereference alias */
|
||||||
|
|
||||||
newe = dn2entry_r( be, aliasDN, &sup );
|
newe = dn2entry_r( be, aliasDN, &sup );
|
||||||
|
ch_free( aliasDN );
|
||||||
|
|
||||||
if( newe != NULL ) {
|
if( newe != NULL ) {
|
||||||
free( dn );
|
free( dn );
|
||||||
|
|
@ -113,7 +115,6 @@ Entry *deref_internal_r(
|
||||||
dn = ch_strdup( entry->e_ndn );
|
dn = ch_strdup( entry->e_ndn );
|
||||||
charray_add( &dnlist, dn );
|
charray_add( &dnlist, dn );
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( sup != NULL ) {
|
if ( sup != NULL ) {
|
||||||
|
|
@ -157,6 +158,7 @@ Entry *deref_internal_r(
|
||||||
}
|
}
|
||||||
|
|
||||||
aliasDN = new_superior( dn, sup->e_ndn, supDN );
|
aliasDN = new_superior( dn, sup->e_ndn, supDN );
|
||||||
|
free(supDN);
|
||||||
|
|
||||||
if( aliasDN == NULL ) {
|
if( aliasDN == NULL ) {
|
||||||
free(aliasDN);
|
free(aliasDN);
|
||||||
|
|
@ -217,6 +219,7 @@ static char* get_alias_dn(
|
||||||
int *err,
|
int *err,
|
||||||
const char **errmsg )
|
const char **errmsg )
|
||||||
{
|
{
|
||||||
|
char *dn;
|
||||||
Attribute *a;
|
Attribute *a;
|
||||||
AttributeDescription *aliasedObjectName = slap_schema.si_ad_aliasedObjectName;
|
AttributeDescription *aliasedObjectName = slap_schema.si_ad_aliasedObjectName;
|
||||||
|
|
||||||
|
|
@ -249,7 +252,16 @@ static char* get_alias_dn(
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return a->a_vals[0]->bv_val;
|
dn = ch_strdup( a->a_vals[0]->bv_val );
|
||||||
|
|
||||||
|
if( dn_normalize(dn) == NULL ) {
|
||||||
|
ch_free( dn );
|
||||||
|
*err = LDAP_ALIAS_PROBLEM;
|
||||||
|
*errmsg = "alias aliasedObjectName value is invalid";
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return dn;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* new_superior(
|
char* new_superior(
|
||||||
|
|
|
||||||
|
|
@ -113,6 +113,11 @@ ldbm_back_search(
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( is_entry_alias( e ) ) {
|
||||||
|
/* don't deref */
|
||||||
|
deref = LDAP_DEREF_NEVER;
|
||||||
|
}
|
||||||
|
|
||||||
if ( tlimit == 0 && be_isroot( be, op->o_ndn ) ) {
|
if ( tlimit == 0 && be_isroot( be, op->o_ndn ) ) {
|
||||||
tlimit = -1; /* allow root to set no limit */
|
tlimit = -1; /* allow root to set no limit */
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue