summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2010-09-13 14:28:46 -0600
committerRich Megginson <rmeggins@redhat.com>2010-10-18 10:55:42 -0600
commit54150f2102c26981a135ea3aa7461e9bcdceecdc (patch)
tree59134b805fd6bdbc3b06c764ac4eaf9a6c84dc88
parentb2921c914b7cd18569c9812dfd27b19e8a57bfe9 (diff)
downloadds-54150f2102c26981a135ea3aa7461e9bcdceecdc.tar.gz
ds-54150f2102c26981a135ea3aa7461e9bcdceecdc.tar.xz
ds-54150f2102c26981a135ea3aa7461e9bcdceecdc.zip
Only check modrdn ops for backend/suffix correctness if not the default backend
The function slapi_mapping_tree_select_and_check() is only called for modrdn operations, to make sure we are not attempting to rename a suffix or move an entry from one backend to another. This defeats datainterop plugins that may want to perform some other operation in these cases. If the target suffix/backend is not found, the default backend is used. If the default backend is being used, don't check for all errors, just allow the operation to pass through to the preop plugins. Need to make sure this doesn't cause problems if 1) null suffix is not used - entry really is bogus or doesn't exist 2) null suffix is being used but entry belongs to another null suffix or is really bogus Reviewed by: nhosoi (Thanks!) Tested on: Fedora 14 x86_64 Branch: 389_1.2.6 (cherry picked from commit 09baba59e5b457efe8e0f44fc8cc7bc850ddb50c)
-rw-r--r--ldap/servers/slapd/mapping_tree.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ldap/servers/slapd/mapping_tree.c b/ldap/servers/slapd/mapping_tree.c
index a67ec2ac..57e214eb 100644
--- a/ldap/servers/slapd/mapping_tree.c
+++ b/ldap/servers/slapd/mapping_tree.c
@@ -2291,6 +2291,7 @@ int slapi_mapping_tree_select_and_check(Slapi_PBlock *pb,char *newdn, Slapi_Back
Slapi_DN *target_sdn = NULL;
Slapi_DN dn_newdn;
Slapi_Backend * new_be = NULL;
+ Slapi_Backend * def_be = defbackend_get_backend();
Slapi_Entry * new_referral = NULL;
mapping_tree_node *target_node;
int index;
@@ -2329,7 +2330,7 @@ int slapi_mapping_tree_select_and_check(Slapi_PBlock *pb,char *newdn, Slapi_Back
{
/* suffix is a part of mapping tree. We should not free it */
const Slapi_DN *suffix = slapi_get_suffix_by_dn(target_sdn);
- if (NULL == suffix)
+ if ((*be != def_be) && (NULL == suffix))
{
ret = LDAP_NO_SUCH_OBJECT;
PR_snprintf(errorbuf, BUFSIZ,
@@ -2337,7 +2338,7 @@ int slapi_mapping_tree_select_and_check(Slapi_PBlock *pb,char *newdn, Slapi_Back
slapi_sdn_get_dn(target_sdn));
goto unlock_and_return;
}
- if (0 == slapi_sdn_compare(target_sdn, suffix))
+ if (suffix && (0 == slapi_sdn_compare(target_sdn, suffix)))
{
/* target_sdn is a suffix */
const Slapi_DN *new_suffix = NULL;