mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
Changed be_issuffix and dnParent to struct bervals
This commit is contained in:
parent
7e43108c31
commit
278ccf828b
@ -80,11 +80,12 @@ ldbm_back_add(
|
|||||||
* add the entry.
|
* add the entry.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
pdn.bv_val = dn_parent( be, e->e_ndn );
|
if ( be_issuffix( be, &e->e_nname ) ) {
|
||||||
if (pdn.bv_val && pdn.bv_val[0])
|
pdn = slap_empty_bv;
|
||||||
pdn.bv_len = e->e_nname.bv_len - (pdn.bv_val - e->e_ndn);
|
} else {
|
||||||
else
|
rc = dnParent( &e->e_nname, &pdn );
|
||||||
pdn.bv_len = 0;
|
/* dnParent always returns success */
|
||||||
|
}
|
||||||
|
|
||||||
if( pdn.bv_len ) {
|
if( pdn.bv_len ) {
|
||||||
Entry *matched = NULL;
|
Entry *matched = NULL;
|
||||||
@ -206,7 +207,7 @@ ldbm_back_add(
|
|||||||
|
|
||||||
/* no parent, must be adding entry to root */
|
/* no parent, must be adding entry to root */
|
||||||
if ( !be_isroot( be, &op->o_ndn ) ) {
|
if ( !be_isroot( be, &op->o_ndn ) ) {
|
||||||
if ( be_issuffix( be, "" ) || be_isupdate( be, &op->o_ndn ) ) {
|
if ( be_issuffix( be, (struct berval *)&slap_empty_bv ) || be_isupdate( be, &op->o_ndn ) ) {
|
||||||
p = (Entry *)&slap_entry_root;
|
p = (Entry *)&slap_entry_root;
|
||||||
|
|
||||||
rc = access_allowed( be, conn, op, p,
|
rc = access_allowed( be, conn, op, p,
|
||||||
|
@ -115,8 +115,8 @@ ldbm_back_delete(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* delete from parent's id2children entry */
|
/* delete from parent's id2children entry */
|
||||||
if( (pdn.bv_val = dn_parent( be, e->e_ndn )) != NULL && pdn.bv_val[ 0 ] != '\0' ) {
|
if( !be_issuffix( be, &e->e_nname ) && dnParent( &e->e_nname, &pdn ) == LDAP_SUCCESS
|
||||||
pdn.bv_len = e->e_nname.bv_len - (pdn.bv_val - e->e_ndn);
|
&& pdn.bv_len ) {
|
||||||
if( (p = dn2entry_w( be, &pdn, NULL )) == NULL) {
|
if( (p = dn2entry_w( be, &pdn, NULL )) == NULL) {
|
||||||
#ifdef NEW_LOGGING
|
#ifdef NEW_LOGGING
|
||||||
LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
|
LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
|
||||||
@ -154,7 +154,7 @@ ldbm_back_delete(
|
|||||||
} else {
|
} else {
|
||||||
/* no parent, must be root to delete */
|
/* no parent, must be root to delete */
|
||||||
if( ! be_isroot( be, &op->o_ndn ) ) {
|
if( ! be_isroot( be, &op->o_ndn ) ) {
|
||||||
if ( be_issuffix( be, "" ) || be_isupdate( be, &op->o_ndn ) ) {
|
if ( be_issuffix( be, (struct berval *)&slap_empty_bv ) || be_isupdate( be, &op->o_ndn ) ) {
|
||||||
p = (Entry *)&slap_entry_root;
|
p = (Entry *)&slap_entry_root;
|
||||||
|
|
||||||
rc = access_allowed( be, conn, op, p,
|
rc = access_allowed( be, conn, op, p,
|
||||||
|
@ -26,7 +26,8 @@ dn2id_add(
|
|||||||
int rc, flags;
|
int rc, flags;
|
||||||
DBCache *db;
|
DBCache *db;
|
||||||
Datum key, data;
|
Datum key, data;
|
||||||
char *buf, *ptr, *pdn;
|
char *buf;
|
||||||
|
struct berval ptr, pdn;
|
||||||
|
|
||||||
#ifdef NEW_LOGGING
|
#ifdef NEW_LOGGING
|
||||||
LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
|
LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
|
||||||
@ -55,8 +56,9 @@ dn2id_add(
|
|||||||
buf = ch_malloc( key.dsize );
|
buf = ch_malloc( key.dsize );
|
||||||
key.dptr = buf;
|
key.dptr = buf;
|
||||||
buf[0] = DN_BASE_PREFIX;
|
buf[0] = DN_BASE_PREFIX;
|
||||||
ptr = buf + 1;
|
ptr.bv_val = buf + 1;
|
||||||
strcpy( ptr, dn->bv_val );
|
ptr.bv_len = dn->bv_len;
|
||||||
|
strcpy( ptr.bv_val, dn->bv_val );
|
||||||
|
|
||||||
ldbm_datum_init( data );
|
ldbm_datum_init( data );
|
||||||
data.dptr = (char *) &id;
|
data.dptr = (char *) &id;
|
||||||
@ -65,41 +67,39 @@ dn2id_add(
|
|||||||
flags = LDBM_INSERT;
|
flags = LDBM_INSERT;
|
||||||
rc = ldbm_cache_store( db, key, data, flags );
|
rc = ldbm_cache_store( db, key, data, flags );
|
||||||
|
|
||||||
if ( rc != -1 && !be_issuffix( be, ptr )) {
|
if ( rc != -1 && !be_issuffix( be, &ptr )) {
|
||||||
buf[0] = DN_SUBTREE_PREFIX;
|
buf[0] = DN_SUBTREE_PREFIX;
|
||||||
ldap_pvt_thread_mutex_lock( &db->dbc_write_mutex );
|
ldap_pvt_thread_mutex_lock( &db->dbc_write_mutex );
|
||||||
rc = idl_insert_key( be, db, key, id );
|
rc = idl_insert_key( be, db, key, id );
|
||||||
ldap_pvt_thread_mutex_unlock( &db->dbc_write_mutex );
|
ldap_pvt_thread_mutex_unlock( &db->dbc_write_mutex );
|
||||||
}
|
|
||||||
|
|
||||||
if ( rc != -1 ) {
|
if ( rc != -1 ) {
|
||||||
pdn = dn_parent( be, ptr );
|
rc = dnParent( &ptr, &pdn );
|
||||||
|
|
||||||
if( pdn != NULL ) {
|
if( rc == LDAP_SUCCESS ) {
|
||||||
pdn[-1] = DN_ONE_PREFIX;
|
pdn.bv_val[-1] = DN_ONE_PREFIX;
|
||||||
key.dsize -= pdn - ptr;
|
key.dsize = pdn.bv_len + 2;
|
||||||
key.dptr = pdn - 1;
|
key.dptr = pdn.bv_val - 1;
|
||||||
ldap_pvt_thread_mutex_lock( &db->dbc_write_mutex );
|
ptr = pdn;
|
||||||
rc = idl_insert_key( be, db, key, id );
|
ldap_pvt_thread_mutex_lock( &db->dbc_write_mutex );
|
||||||
ldap_pvt_thread_mutex_unlock( &db->dbc_write_mutex );
|
rc = idl_insert_key( be, db, key, id );
|
||||||
|
ldap_pvt_thread_mutex_unlock( &db->dbc_write_mutex );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while ( rc != -1 && pdn != NULL ) {
|
while ( rc != -1 && !be_issuffix( be, &ptr )) {
|
||||||
if ( be_issuffix( be, pdn ))
|
ptr.bv_val[-1] = DN_SUBTREE_PREFIX;
|
||||||
break;
|
|
||||||
|
|
||||||
pdn[-1] = DN_SUBTREE_PREFIX;
|
|
||||||
|
|
||||||
ldap_pvt_thread_mutex_lock( &db->dbc_write_mutex );
|
ldap_pvt_thread_mutex_lock( &db->dbc_write_mutex );
|
||||||
rc = idl_insert_key( be, db, key, id );
|
rc = idl_insert_key( be, db, key, id );
|
||||||
ldap_pvt_thread_mutex_unlock( &db->dbc_write_mutex );
|
ldap_pvt_thread_mutex_unlock( &db->dbc_write_mutex );
|
||||||
|
|
||||||
if( rc != 0 ) break;
|
if( rc != 0 ) break;
|
||||||
|
rc = dnParent( &ptr, &pdn );
|
||||||
|
key.dsize = pdn.bv_len + 2;
|
||||||
|
key.dptr = pdn.bv_val - 1;
|
||||||
ptr = pdn;
|
ptr = pdn;
|
||||||
pdn = dn_parent( be, pdn );
|
|
||||||
key.dsize -= pdn - ptr;
|
|
||||||
key.dptr = pdn - 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
free( buf );
|
free( buf );
|
||||||
@ -226,7 +226,7 @@ dn2idl(
|
|||||||
assert( idlp != NULL );
|
assert( idlp != NULL );
|
||||||
*idlp = NULL;
|
*idlp = NULL;
|
||||||
|
|
||||||
if ( prefix == DN_SUBTREE_PREFIX && be_issuffix(be, dn->bv_val) ) {
|
if ( prefix == DN_SUBTREE_PREFIX && be_issuffix(be, dn) ) {
|
||||||
*idlp = idl_allids( be );
|
*idlp = idl_allids( be );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -270,7 +270,8 @@ dn2id_delete(
|
|||||||
DBCache *db;
|
DBCache *db;
|
||||||
Datum key;
|
Datum key;
|
||||||
int rc;
|
int rc;
|
||||||
char *buf, *ptr, *pdn;
|
char *buf;
|
||||||
|
struct berval ptr, pdn;
|
||||||
|
|
||||||
#ifdef NEW_LOGGING
|
#ifdef NEW_LOGGING
|
||||||
LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
|
LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
|
||||||
@ -301,44 +302,43 @@ dn2id_delete(
|
|||||||
buf = ch_malloc( key.dsize );
|
buf = ch_malloc( key.dsize );
|
||||||
key.dptr = buf;
|
key.dptr = buf;
|
||||||
buf[0] = DN_BASE_PREFIX;
|
buf[0] = DN_BASE_PREFIX;
|
||||||
ptr = buf + 1;
|
ptr.bv_val = buf + 1;
|
||||||
strcpy( ptr, dn->bv_val );
|
ptr.bv_len = dn->bv_len;
|
||||||
|
strcpy( ptr.bv_val, dn->bv_val );
|
||||||
|
|
||||||
rc = ldbm_cache_delete( db, key );
|
rc = ldbm_cache_delete( db, key );
|
||||||
|
|
||||||
if( !be_issuffix( be, ptr )) {
|
if( !be_issuffix( be, &ptr )) {
|
||||||
buf[0] = DN_SUBTREE_PREFIX;
|
buf[0] = DN_SUBTREE_PREFIX;
|
||||||
ldap_pvt_thread_mutex_lock( &db->dbc_write_mutex );
|
ldap_pvt_thread_mutex_lock( &db->dbc_write_mutex );
|
||||||
(void) idl_delete_key( be, db, key, id );
|
(void) idl_delete_key( be, db, key, id );
|
||||||
ldap_pvt_thread_mutex_unlock( &db->dbc_write_mutex );
|
ldap_pvt_thread_mutex_unlock( &db->dbc_write_mutex );
|
||||||
|
|
||||||
|
rc = dnParent( &ptr, &pdn );
|
||||||
|
|
||||||
|
if( rc == LDAP_SUCCESS ) {
|
||||||
|
pdn.bv_val[-1] = DN_ONE_PREFIX;
|
||||||
|
key.dsize = pdn.bv_len + 2;
|
||||||
|
key.dptr = pdn.bv_val - 1;
|
||||||
|
ptr = pdn;
|
||||||
|
|
||||||
|
ldap_pvt_thread_mutex_lock( &db->dbc_write_mutex );
|
||||||
|
(void) idl_delete_key( be, db, key, id );
|
||||||
|
ldap_pvt_thread_mutex_unlock( &db->dbc_write_mutex );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pdn = dn_parent( be, ptr );
|
while ( rc != -1 && !be_issuffix( be, &ptr )) {
|
||||||
|
ptr.bv_val[-1] = DN_SUBTREE_PREFIX;
|
||||||
if( pdn != NULL ) {
|
|
||||||
pdn[-1] = DN_ONE_PREFIX;
|
|
||||||
key.dsize -= pdn - ptr;
|
|
||||||
key.dptr = pdn - 1;
|
|
||||||
|
|
||||||
ldap_pvt_thread_mutex_lock( &db->dbc_write_mutex );
|
|
||||||
(void) idl_delete_key( be, db, key, id );
|
|
||||||
ldap_pvt_thread_mutex_unlock( &db->dbc_write_mutex );
|
|
||||||
}
|
|
||||||
|
|
||||||
while ( pdn != NULL ) {
|
|
||||||
if ( be_issuffix( be, pdn ))
|
|
||||||
break;
|
|
||||||
|
|
||||||
pdn[-1] = DN_SUBTREE_PREFIX;
|
|
||||||
|
|
||||||
ldap_pvt_thread_mutex_lock( &db->dbc_write_mutex );
|
ldap_pvt_thread_mutex_lock( &db->dbc_write_mutex );
|
||||||
(void) idl_delete_key( be, db, key, id );
|
(void) idl_delete_key( be, db, key, id );
|
||||||
ldap_pvt_thread_mutex_unlock( &db->dbc_write_mutex );
|
ldap_pvt_thread_mutex_unlock( &db->dbc_write_mutex );
|
||||||
|
|
||||||
|
rc = dnParent( &ptr, &pdn );
|
||||||
|
key.dsize = pdn.bv_len + 2;
|
||||||
|
key.dptr = pdn.bv_val - 1;
|
||||||
ptr = pdn;
|
ptr = pdn;
|
||||||
pdn = dn_parent( be, pdn );
|
|
||||||
key.dsize -= pdn - ptr;
|
|
||||||
key.dptr = pdn - 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
free( buf );
|
free( buf );
|
||||||
@ -415,9 +415,8 @@ dn2entry_rw(
|
|||||||
if( matched == NULL ) return NULL;
|
if( matched == NULL ) return NULL;
|
||||||
|
|
||||||
/* entry does not exist - see how much of the dn does exist */
|
/* entry does not exist - see how much of the dn does exist */
|
||||||
/* dn_parent checks returns NULL if dn is suffix */
|
if ( !be_issuffix( be, dn ) && dnParent( dn, &pdn ) == LDAP_SUCCESS
|
||||||
if ( (pdn.bv_val = dn_parent( be, dn->bv_val )) != NULL && *pdn.bv_val ) {
|
&& pdn.bv_len ) {
|
||||||
pdn.bv_len = dn->bv_len - (pdn.bv_val - dn->bv_val);
|
|
||||||
/* get entry with reader lock */
|
/* get entry with reader lock */
|
||||||
if ( (e = dn2entry_r( be, &pdn, matched )) != NULL ) {
|
if ( (e = dn2entry_r( be, &pdn, matched )) != NULL ) {
|
||||||
*matched = e;
|
*matched = e;
|
||||||
|
@ -148,11 +148,11 @@ ldbm_back_modrdn(
|
|||||||
goto return_results;
|
goto return_results;
|
||||||
}
|
}
|
||||||
|
|
||||||
p_ndn.bv_val = dn_parent( be, e->e_ndn );
|
if ( be_issuffix( be, &e->e_nname ) ) {
|
||||||
if ( p_ndn.bv_val )
|
p_ndn = slap_empty_bv ;
|
||||||
p_ndn.bv_len = e->e_nname.bv_len - (p_ndn.bv_val - e->e_ndn);
|
} else {
|
||||||
else
|
dnParent( &e->e_nname, &p_ndn );
|
||||||
p_ndn.bv_len = 0;
|
}
|
||||||
|
|
||||||
if ( p_ndn.bv_len != 0 ) {
|
if ( p_ndn.bv_len != 0 ) {
|
||||||
/* Make sure parent entry exist and we can write its
|
/* Make sure parent entry exist and we can write its
|
||||||
@ -201,11 +201,11 @@ ldbm_back_modrdn(
|
|||||||
p_ndn.bv_val, 0, 0 );
|
p_ndn.bv_val, 0, 0 );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
p_dn.bv_val = dn_parent( be, e->e_dn );
|
if ( p_ndn.bv_val == slap_empty_bv.bv_val ) {
|
||||||
if ( p_dn.bv_val )
|
p_dn = slap_empty_bv;
|
||||||
p_dn.bv_len = e->e_name.bv_len - (p_dn.bv_val - e->e_dn);
|
} else {
|
||||||
else
|
dnParent( &e->e_name, &p_dn );
|
||||||
p_dn.bv_len = 0;
|
}
|
||||||
|
|
||||||
#ifdef NEW_LOGGING
|
#ifdef NEW_LOGGING
|
||||||
LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
|
LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
|
||||||
@ -219,7 +219,7 @@ ldbm_back_modrdn(
|
|||||||
/* no parent, must be root to modify rdn */
|
/* no parent, must be root to modify rdn */
|
||||||
isroot = be_isroot( be, &op->o_ndn );
|
isroot = be_isroot( be, &op->o_ndn );
|
||||||
if ( ! isroot ) {
|
if ( ! isroot ) {
|
||||||
if ( be_issuffix( be, "" ) || be_isupdate( be, &op->o_ndn ) ) {
|
if ( be_issuffix( be, (struct berval *)&slap_empty_bv ) || be_isupdate( be, &op->o_ndn ) ) {
|
||||||
p = (Entry *)&slap_entry_root;
|
p = (Entry *)&slap_entry_root;
|
||||||
|
|
||||||
rc = access_allowed( be, conn, op, p,
|
rc = access_allowed( be, conn, op, p,
|
||||||
@ -397,7 +397,7 @@ ldbm_back_modrdn(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( ! isroot ) {
|
if ( ! isroot ) {
|
||||||
if ( be_issuffix( be, "" ) || be_isupdate( be, &op->o_ndn ) ) {
|
if ( be_issuffix( be, (struct berval *)&slap_empty_bv ) || be_isupdate( be, &op->o_ndn ) ) {
|
||||||
np = (Entry *)&slap_entry_root;
|
np = (Entry *)&slap_entry_root;
|
||||||
|
|
||||||
rc = access_allowed( be, conn, op, np,
|
rc = access_allowed( be, conn, op, np,
|
||||||
|
@ -343,11 +343,10 @@ searchit:
|
|||||||
|
|
||||||
/* need to skip alias which deref into scope */
|
/* need to skip alias which deref into scope */
|
||||||
if( scope & LDAP_SCOPE_ONELEVEL ) {
|
if( scope & LDAP_SCOPE_ONELEVEL ) {
|
||||||
char *pdn = dn_parent( NULL, e->e_ndn );
|
struct berval pdn;
|
||||||
if ( pdn != NULL ) {
|
dnParent( &e->e_nname, &pdn );
|
||||||
if( strcmp( pdn, realbase.bv_val ) ) {
|
if ( ber_bvcmp( &pdn, &realbase ) ) {
|
||||||
goto loop_continue;
|
goto loop_continue;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if ( dnIsSuffix( &e->e_nname, &realbase ) ) {
|
} else if ( dnIsSuffix( &e->e_nname, &realbase ) ) {
|
||||||
@ -375,14 +374,13 @@ searchit:
|
|||||||
if ( !manageDSAit && scope != LDAP_SCOPE_BASE &&
|
if ( !manageDSAit && scope != LDAP_SCOPE_BASE &&
|
||||||
is_entry_referral( e ) )
|
is_entry_referral( e ) )
|
||||||
{
|
{
|
||||||
char *dn;
|
struct berval dn;
|
||||||
|
|
||||||
/* check scope */
|
/* check scope */
|
||||||
if ( !scopeok && scope == LDAP_SCOPE_ONELEVEL ) {
|
if ( !scopeok && scope == LDAP_SCOPE_ONELEVEL ) {
|
||||||
if ( (dn = dn_parent( be, e->e_ndn )) != NULL ) {
|
if ( !be_issuffix( be, &e->e_nname ) ) {
|
||||||
scopeok = (dn == realbase.bv_val)
|
dnParent( &e->e_nname, &dn );
|
||||||
? 1
|
scopeok = dn_match( &dn, &realbase );
|
||||||
: (strcmp( dn, realbase.bv_val ) ? 0 : 1 );
|
|
||||||
} else {
|
} else {
|
||||||
scopeok = (realbase.bv_len == 0);
|
scopeok = (realbase.bv_len == 0);
|
||||||
}
|
}
|
||||||
@ -425,14 +423,13 @@ searchit:
|
|||||||
|
|
||||||
/* if it matches the filter and scope, send it */
|
/* if it matches the filter and scope, send it */
|
||||||
if ( test_filter( be, conn, op, e, filter ) == LDAP_COMPARE_TRUE ) {
|
if ( test_filter( be, conn, op, e, filter ) == LDAP_COMPARE_TRUE ) {
|
||||||
char *dn;
|
struct berval dn;
|
||||||
|
|
||||||
/* check scope */
|
/* check scope */
|
||||||
if ( !scopeok && scope == LDAP_SCOPE_ONELEVEL ) {
|
if ( !scopeok && scope == LDAP_SCOPE_ONELEVEL ) {
|
||||||
if ( (dn = dn_parent( be, e->e_ndn )) != NULL ) {
|
if ( !be_issuffix( be, &e->e_nname ) ) {
|
||||||
scopeok = (dn == realbase.bv_val)
|
dnParent( &e->e_nname, &dn );
|
||||||
? 1
|
scopeok = dn_match( &dn, &realbase );
|
||||||
: (strcmp( dn, realbase.bv_val ) ? 0 : 1 );
|
|
||||||
} else {
|
} else {
|
||||||
scopeok = (realbase.bv_len == 0);
|
scopeok = (realbase.bv_len == 0);
|
||||||
}
|
}
|
||||||
|
@ -206,7 +206,7 @@ monitor_cache_dn2entry(
|
|||||||
|
|
||||||
/* try with parent/ancestors */
|
/* try with parent/ancestors */
|
||||||
if ( ndn->bv_len ) {
|
if ( ndn->bv_len ) {
|
||||||
p_ndn.bv_val = dn_parent( NULL, ndn->bv_val );
|
dnParent( ndn, &p_ndn );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( p_ndn.bv_val == NULL ) {
|
if ( p_ndn.bv_val == NULL ) {
|
||||||
|
@ -47,7 +47,7 @@ passwd_back_search(
|
|||||||
int err = LDAP_SUCCESS;
|
int err = LDAP_SUCCESS;
|
||||||
|
|
||||||
LDAPRDN *rdn = NULL;
|
LDAPRDN *rdn = NULL;
|
||||||
char *parent = NULL;
|
struct berval parent = { 0, NULL };
|
||||||
char *matched = NULL;
|
char *matched = NULL;
|
||||||
const char *text = NULL;
|
const char *text = NULL;
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ passwd_back_search(
|
|||||||
#endif /* HAVE_SETPWFILE */
|
#endif /* HAVE_SETPWFILE */
|
||||||
|
|
||||||
/* Handle a query for the base of this backend */
|
/* Handle a query for the base of this backend */
|
||||||
if ( be_issuffix( be, nbase->bv_val ) ) {
|
if ( be_issuffix( be, nbase ) ) {
|
||||||
struct berval vals[2];
|
struct berval vals[2];
|
||||||
|
|
||||||
vals[1].bv_val = NULL;
|
vals[1].bv_val = NULL;
|
||||||
@ -174,12 +174,14 @@ passwd_back_search(
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
parent = dn_parent( be, nbase->bv_val );
|
if (! be_issuffix( be, nbase ) ) {
|
||||||
|
dnParent( nbase, &parent );
|
||||||
|
}
|
||||||
|
|
||||||
/* This backend is only one layer deep. Don't answer requests for
|
/* This backend is only one layer deep. Don't answer requests for
|
||||||
* anything deeper than that.
|
* anything deeper than that.
|
||||||
*/
|
*/
|
||||||
if( !be_issuffix( be, parent ) ) {
|
if( !be_issuffix( be, &parent ) ) {
|
||||||
int i;
|
int i;
|
||||||
for( i=0; be->be_nsuffix[i] != NULL; i++ ) {
|
for( i=0; be->be_nsuffix[i] != NULL; i++ ) {
|
||||||
if( dnIsSuffix( nbase, be->be_nsuffix[i] ) ) {
|
if( dnIsSuffix( nbase, be->be_nsuffix[i] ) ) {
|
||||||
@ -203,7 +205,7 @@ passwd_back_search(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( (pw = getpwnam( rdn[0][0]->la_value.bv_val )) == NULL ) {
|
if ( (pw = getpwnam( rdn[0][0]->la_value.bv_val )) == NULL ) {
|
||||||
matched = parent;
|
matched = parent.bv_val;
|
||||||
err = LDAP_NO_SUCH_OBJECT;
|
err = LDAP_NO_SUCH_OBJECT;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user