mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
Fix previous commit
This commit is contained in:
parent
7f54a89f32
commit
b907603b2d
@ -569,14 +569,13 @@ dnParent(
|
||||
struct berval *dn,
|
||||
struct berval *pdn )
|
||||
{
|
||||
const char *p;
|
||||
char *p;
|
||||
|
||||
p = strchr( dn->bv_val, ',' );
|
||||
|
||||
/* one-level dn */
|
||||
if ( p == NULL ) {
|
||||
pdn->bv_val = "";
|
||||
pdn->bv_len = 0;
|
||||
*pdn = slap_empty_bv;
|
||||
return LDAP_SUCCESS;
|
||||
}
|
||||
|
||||
@ -645,8 +644,7 @@ dn_parent(
|
||||
Backend *be,
|
||||
const char *dn )
|
||||
{
|
||||
const char *pdn;
|
||||
struct berval bv;
|
||||
struct berval bv, pdn;
|
||||
|
||||
if ( dn == NULL ) {
|
||||
return NULL;
|
||||
@ -660,17 +658,17 @@ dn_parent(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bv.bv_val = dn;
|
||||
bv.bv_val = (char *)dn;
|
||||
bv.bv_len = strlen(bv.bv_val);
|
||||
if ( be != NULL && be_issuffix( be, &bv ) ) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ( dnParent( dn, &pdn ) != LDAP_SUCCESS ) {
|
||||
if ( dnParent( &bv, &pdn ) != LDAP_SUCCESS ) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return ( char * )pdn;
|
||||
return pdn.bv_val;
|
||||
}
|
||||
#endif /* SLAP_DN_MIGRATION */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user