Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#90, #432] FIX delete entries in overlapping backends #434

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"));
}
}