mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-06 15:10:22 -05:00
All "o=foo" add to suffix "" if bound as root.
This commit is contained in:
parent
c57e5952f9
commit
52e69dfc14
1 changed files with 14 additions and 3 deletions
|
|
@ -52,9 +52,13 @@ bdb2i_back_add_internal(
|
|||
* add the entry.
|
||||
*/
|
||||
|
||||
if ( (pdn = dn_parent( be, e->e_ndn )) != NULL ) {
|
||||
pdn = dn_parent( be, e->e_ndn );
|
||||
|
||||
if( pdn != NULL && *pdn != '\0' && !be_issuffix(be, "") ) {
|
||||
char *matched = NULL;
|
||||
|
||||
assert( *pdn != '\0' );
|
||||
|
||||
/* get parent with writer lock */
|
||||
if ( (p = bdb2i_dn2entry_w( be, pdn, &matched )) == NULL ) {
|
||||
Debug( LDAP_DEBUG_TRACE, "parent does not exist\n", 0,
|
||||
|
|
@ -93,10 +97,17 @@ bdb2i_back_add_internal(
|
|||
}
|
||||
|
||||
} else {
|
||||
if(pdn != NULL) {
|
||||
assert( *pdn == '\0' );
|
||||
free(pdn);
|
||||
}
|
||||
|
||||
/* no parent, must be adding entry to root */
|
||||
if ( ! be_isroot( be, op->o_ndn ) ) {
|
||||
Debug( LDAP_DEBUG_TRACE, "no parent & not root\n", 0,
|
||||
0, 0 );
|
||||
Debug( LDAP_DEBUG_TRACE, "%s add denied\n",
|
||||
pdn == NULL ? "suffix" : "entry at root",
|
||||
0, 0 );
|
||||
|
||||
send_ldap_result( conn, op, LDAP_INSUFFICIENT_ACCESS,
|
||||
"", "" );
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue