ldap/servers/slapd/back-ldbm/ldbm_modrdn.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
New commits: commit 51a1c48f9c3c49efb40e36d9ebee38951ff25f47 Author: Noriko Hosoi nhosoi@totoro.usersys.redhat.com Date: Wed Nov 14 12:23:06 2012 -0800
Trac Ticket #520 - RedHat Directory Server crashes (segfaults) when moving ldap entry
https://fedorahosted.org/389/ticket/520
Fix description: The code to check if the new superior entry exists or not was returning the "No such object" error only when the op was requested by the directory manager. This patch is removing the condition so that whoever the requester is, it returns the error. (cherry picked from commit 40e68b18dae23a21654719a742419f172aa54806) (cherry picked from commit d4dbb3d01a7f3f39c5370a10a02109d90c5140e0)
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c b/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c index 6b0fa34..f7d9f16 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c @@ -400,10 +400,11 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) if ( newparententry == NULL ) { /* There may not be a new parent because we don't intend there to be one. */ - if(slapi_sdn_get_ndn(dn_newsuperiordn)!=NULL) + if (slapi_sdn_get_ndn(dn_newsuperiordn)) { - /* If the new entry is to be a suffix, and we're root, then it's OK that the new parent doesn't exist */ - if (!(slapi_be_issuffix(pb->pb_backend, &dn_newdn)) && isroot) + /* If the new entry is not to be a suffix, + * return an error no matter who requested this modrdn */ + if (!slapi_be_issuffix(pb->pb_backend, &dn_newdn)) { /* Here means that we didn't find the parent */ int err = 0; @@ -421,7 +422,7 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) slapi_sdn_get_ndn(dn_newsuperiordn), 0 ); slapi_sdn_done(&ancestorsdn); goto error_return; - } + } } } else @@ -439,7 +440,7 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) if ( parententry == NULL ) { /* If the entry a suffix, and we're root, then it's OK that the parent doesn't exist */ - if (!(slapi_be_issuffix(pb->pb_backend, sdn)) && isroot) + if (!(slapi_be_issuffix(pb->pb_backend, sdn)) && !isroot) { /* Here means that we didn't find the parent */ ldap_result_matcheddn = "NULL";
389-commits@lists.fedoraproject.org