Skip to content

Commit

Permalink
[#90, #432] FIX delete entries in overlapping backends (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
vharseko authored Oct 17, 2024
1 parent 5c2894e commit 1989879
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*
* Copyright 2008-2009 Sun Microsystems, Inc.
* Portions Copyright 2011-2016 ForgeRock AS.
* Portions Copyright 2022-2024 3A Systems, LLC.
*/
package org.opends.server.workflowelement.localbackend;

Expand Down Expand Up @@ -281,8 +282,8 @@ private void processDelete(AtomicBoolean executePostOpPlugins)
{
if (dn.isInScopeOf(entryDN, SearchScope.WHOLE_SUBTREE)) {
setResultCodeAndMessageNoInfoDisclosure(entry,ResultCode.NOT_ALLOWED_ON_NONLEAF, ERR_DELETE_HAS_SUB_BACKEND.get(entryDN, dn));
}
return;
return;
}
}

// Actually perform the delete.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.util.Set;

import static org.assertj.core.api.Assertions.assertThat;
import static org.testng.Assert.assertEquals;

@Test(sequential = true)
public class OverlappingBackendTestSuite extends DirectoryServerTestCase {
Expand Down Expand Up @@ -125,5 +126,26 @@ public void test_userRoot2() throws Exception {
hasUserRoot(search("o=test"));
hasUserRoot2(search("o=test"));
hasUserRoot2(search("ou=eus,o=test"));

int resultCode = TestCaseUtils.applyModifications(true,
"dn: uid=user.1,o=test,ou=es,o=test",
"changetype: modify",
"add: description",
"description: user.1");
assertEquals(resultCode, 0);

resultCode = TestCaseUtils.applyModifications(true,
"dn: uid=user.2,o=test,ou=eus,o=test",
"changetype: modify",
"add: description",
"description: user.2");
assertEquals(resultCode, 0);

hasUserRoot(search("o=test"));
hasUserRoot2(search("o=test"));
hasUserRoot2(search("ou=eus,o=test"));

TestCaseUtils.deleteEntry(DN.valueOf("uid=user.1,o=test,ou=es,o=test"));
TestCaseUtils.deleteEntry(DN.valueOf("uid=user.2,o=test,ou=eus,o=test"));
}
}

0 comments on commit 1989879

Please sign in to comment.