Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 584480 Details for
Bug 821542
letters in object's cn get converted to lowercase when renaming object
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
git patch file (389-ds-base-1.2.10)
0012-Trac-Ticket-338-letters-in-object-s-cn-get-converted.patch (text/plain), 14.51 KB, created by
Noriko Hosoi
on 2012-05-14 21:18:00 UTC
(
hide
)
Description:
git patch file (389-ds-base-1.2.10)
Filename:
MIME Type:
Creator:
Noriko Hosoi
Created:
2012-05-14 21:18:00 UTC
Size:
14.51 KB
patch
obsolete
>From 1e67087bef1332054f54fadd630937bbc9c7595c Mon Sep 17 00:00:00 2001 >From: Noriko Hosoi <nhosoi@totoro.usersys.redhat.com> >Date: Sun, 13 May 2012 17:05:05 -0700 >Subject: [PATCH 12/13] Trac Ticket #338 - letters in object's cn get > converted to lowercase when renaming object > >https://fedorahosted.org/389/ticket/338 > >Fix description: The value of newrdn was normalized as dn then >decapitalized. The decapitalization was not just needed but >the cause of the reported bug. > >This patch removes the decapitalization call (slapi_dn_ignore_case) >and adds slapi_dn_ignore_case to acl_access_allowed_modrdn (acl.c) >and referint_postop_modrdn (referint/referint.c). > >Additionally, unnecessary code is being removed from chaining_ >back_modrdn (chainingdb/cb_modrdn.c). >(Ported from commit 178fe6a74c793b3c6adc71f571bba40a6271325c) >--- > ldap/servers/plugins/acl/acl.c | 16 +++++++++---- > ldap/servers/plugins/acl/acllist.c | 4 +- > ldap/servers/plugins/chainingdb/cb_add.c | 2 +- > ldap/servers/plugins/chainingdb/cb_compare.c | 2 +- > ldap/servers/plugins/chainingdb/cb_delete.c | 2 +- > ldap/servers/plugins/chainingdb/cb_modify.c | 2 +- > ldap/servers/plugins/chainingdb/cb_modrdn.c | 32 ++----------------------- > ldap/servers/plugins/chainingdb/cb_search.c | 4 +- > ldap/servers/plugins/referint/referint.c | 6 +++- > ldap/servers/plugins/uiduniq/7bit.c | 4 +- > ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c | 3 +- > ldap/servers/slapd/modrdn.c | 7 +++++- > 12 files changed, 36 insertions(+), 48 deletions(-) > >diff --git a/ldap/servers/plugins/acl/acl.c b/ldap/servers/plugins/acl/acl.c >index c8a221e..5a7b446 100644 >--- a/ldap/servers/plugins/acl/acl.c >+++ b/ldap/servers/plugins/acl/acl.c >@@ -118,6 +118,7 @@ acl_access_allowed_modrdn( > { > int retCode ; > char *newrdn; >+ char *ci_newrdn; > const char *oldrdn; > Slapi_DN *target_sdn = NULL; > int deleteoldrdn = 0; >@@ -139,8 +140,11 @@ acl_access_allowed_modrdn( > slapi_pblock_get( pb, SLAPI_MODRDN_TARGET_SDN, &target_sdn ); > slapi_pblock_get( pb, SLAPI_MODRDN_NEWRDN, &newrdn ); > >+ ci_newrdn = slapi_ch_strdup(newrdn); >+ slapi_dn_ignore_case(ci_newrdn); > /* Check can add the new naming attribute */ >- retCode = check_rdn_access( pb, e, newrdn, ACLPB_SLAPI_ACL_WRITE_ADD) ; >+ retCode = check_rdn_access( pb, e, ci_newrdn, ACLPB_SLAPI_ACL_WRITE_ADD) ; >+ slapi_ch_free_string(&ci_newrdn); > if ( retCode != LDAP_SUCCESS ) { > slapi_log_error( SLAPI_LOG_ACL, plugin_name, > "modrdn:write permission to add new naming attribute not allowed\n"); >@@ -150,7 +154,7 @@ acl_access_allowed_modrdn( > /* Check can delete the new naming attribute--if required */ > slapi_pblock_get( pb, SLAPI_MODRDN_DELOLDRDN, &deleteoldrdn ); > if ( deleteoldrdn ) { >- oldrdn = slapi_sdn_get_dn(target_sdn); >+ oldrdn = slapi_sdn_get_ndn(target_sdn); > retCode = check_rdn_access( pb, e, oldrdn, ACLPB_SLAPI_ACL_WRITE_DEL) ; > if ( retCode != LDAP_SUCCESS ) { > slapi_log_error( SLAPI_LOG_ACL, plugin_name, >@@ -1793,8 +1797,10 @@ acl_modified (Slapi_PBlock *pb, int optype, char *n_dn, void *change) > > /* Change the acls */ > acllist_acicache_WRITE_LOCK(); >+ /* acllist_moddn_aci_needsLock expects normalized new_DN, >+ * which is no need to be case-ignored */ > acllist_moddn_aci_needsLock ( e_sdn, new_DN ); >- acllist_acicache_WRITE_UNLOCK(); >+ acllist_acicache_WRITE_UNLOCK(); > > /* deallocat the parent_DN */ > if (parent_DN != NULL) { >@@ -1987,7 +1993,7 @@ acl__resource_match_aci( Acl_PBlock *aclpb, aci_t *aci, int skip_attrEval, int * > int rv; /* return value */ > /* Assume that resource matches */ > int matches = ACL_TRUE; >- int attr_matched; >+ int attr_matched = ACL_TRUE; > int attr_matched_in_targetattrfilters = 0; > int dn_matched; > char *res_attr; >@@ -2713,7 +2719,7 @@ acl__TestRights(Acl_PBlock *aclpb,int access, char **right, char ** map_generic, > char *acl_tag; > int expr_num; > char *testRights[2]; >- aci_t *aci; >+ aci_t *aci = NULL; > int numHandles = 0; > > TNF_PROBE_0_DEBUG(acl__TestRights_start,"ACL",""); >diff --git a/ldap/servers/plugins/acl/acllist.c b/ldap/servers/plugins/acl/acllist.c >index 8eb39b9..9b5363a 100644 >--- a/ldap/servers/plugins/acl/acllist.c >+++ b/ldap/servers/plugins/acl/acllist.c >@@ -889,7 +889,7 @@ acllist_acicache_WRITE_LOCK( ) > } > > /* This routine must be called with the acicache write lock taken */ >-/* newdn is normalized & case-ignored */ >+/* newdn is normalized (no need to be case-ignored) */ > int > acllist_moddn_aci_needsLock ( Slapi_DN *oldsdn, char *newdn ) > { >@@ -919,7 +919,7 @@ acllist_moddn_aci_needsLock ( Slapi_DN *oldsdn, char *newdn ) > > /* Now set the new DN */ > slapi_sdn_done ( head->acic_sdn ); >- slapi_sdn_set_ndn_byval ( head->acic_sdn, newdn ); >+ slapi_sdn_set_normdn_byval ( head->acic_sdn, newdn ); > > aciListHead->acic_sdn = NULL; > __acllist_free_aciContainer ( &aciListHead ); >diff --git a/ldap/servers/plugins/chainingdb/cb_add.c b/ldap/servers/plugins/chainingdb/cb_add.c >index 116ac92..07b90fa 100644 >--- a/ldap/servers/plugins/chainingdb/cb_add.c >+++ b/ldap/servers/plugins/chainingdb/cb_add.c >@@ -69,7 +69,7 @@ chaining_back_add ( Slapi_PBlock *pb ) > const char *dn = NULL; > Slapi_DN *sdn = NULL; > char *cnxerrbuf=NULL; >- time_t endtime; >+ time_t endtime = 0; > cb_outgoing_conn *cnx; > > if ( (rc=cb_forward_operation(pb)) != LDAP_SUCCESS ) { >diff --git a/ldap/servers/plugins/chainingdb/cb_compare.c b/ldap/servers/plugins/chainingdb/cb_compare.c >index 16f6c7b..594c4bb 100644 >--- a/ldap/servers/plugins/chainingdb/cb_compare.c >+++ b/ldap/servers/plugins/chainingdb/cb_compare.c >@@ -67,7 +67,7 @@ chaining_back_compare ( Slapi_PBlock *pb ) > const char *dn = NULL; > Slapi_DN *sdn = NULL; > char *cnxerrbuf=NULL; >- time_t endtime; >+ time_t endtime = 0; > cb_outgoing_conn *cnx; > > if ( LDAP_SUCCESS != (rc=cb_forward_operation(pb) )) { >diff --git a/ldap/servers/plugins/chainingdb/cb_delete.c b/ldap/servers/plugins/chainingdb/cb_delete.c >index 87a69a2..09972b2 100644 >--- a/ldap/servers/plugins/chainingdb/cb_delete.c >+++ b/ldap/servers/plugins/chainingdb/cb_delete.c >@@ -66,7 +66,7 @@ chaining_back_delete ( Slapi_PBlock *pb ) > Slapi_DN *sdn = NULL; > char *matched_msg, *error_msg; > char *cnxerrbuf=NULL; >- time_t endtime; >+ time_t endtime = 0; > cb_outgoing_conn *cnx; > > if ( LDAP_SUCCESS != (rc=cb_forward_operation(pb) )) { >diff --git a/ldap/servers/plugins/chainingdb/cb_modify.c b/ldap/servers/plugins/chainingdb/cb_modify.c >index aa914b9..06e6b82 100644 >--- a/ldap/servers/plugins/chainingdb/cb_modify.c >+++ b/ldap/servers/plugins/chainingdb/cb_modify.c >@@ -69,7 +69,7 @@ chaining_back_modify ( Slapi_PBlock *pb ) > Slapi_DN *sdn = NULL; > char *matched_msg, *error_msg; > char *cnxerrbuf=NULL; >- time_t endtime; >+ time_t endtime = 0; > cb_outgoing_conn *cnx; > > if ( LDAP_SUCCESS != (rc=cb_forward_operation(pb) )) { >diff --git a/ldap/servers/plugins/chainingdb/cb_modrdn.c b/ldap/servers/plugins/chainingdb/cb_modrdn.c >index b6b882b..1ce6c60 100644 >--- a/ldap/servers/plugins/chainingdb/cb_modrdn.c >+++ b/ldap/servers/plugins/chainingdb/cb_modrdn.c >@@ -62,16 +62,13 @@ chaining_back_modrdn ( Slapi_PBlock *pb ) > char **referrals=NULL; > LDAPMessage *res; > char *matched_msg, *error_msg; >- char *newdn = NULL; >- const char *pdn = NULL; > char *ndn = NULL; > Slapi_DN *sdn = NULL; >- Slapi_DN *psdn = NULL; > int deleteoldrdn = 0; > Slapi_DN *newsuperior = NULL; > char *newrdn = NULL; > char * cnxerrbuf=NULL; >- time_t endtime; >+ time_t endtime = 0; > cb_outgoing_conn *cnx; > > if ( LDAP_SUCCESS != (rc=cb_forward_operation(pb) )) { >@@ -90,36 +87,13 @@ chaining_back_modrdn ( Slapi_PBlock *pb ) > } > > slapi_pblock_get( pb, SLAPI_MODRDN_TARGET_SDN, &sdn ); >+ /* newrdn is passed to ldap_rename, which does not require case-ignored >+ * newrdn. */ > slapi_pblock_get( pb, SLAPI_MODRDN_NEWRDN, &newrdn ); > slapi_pblock_get( pb, SLAPI_MODRDN_NEWSUPERIOR_SDN, &newsuperior ); > slapi_pblock_get( pb, SLAPI_MODRDN_DELOLDRDN, &deleteoldrdn ); > > ndn = (char *)slapi_sdn_get_ndn(sdn); >- >- /* >- * Construct the new dn >- */ >- psdn = slapi_sdn_new(); >- slapi_sdn_get_parent(sdn, psdn); >- pdn = slapi_sdn_get_ndn(psdn); >- >- if ( pdn ) { >- /* parent + rdn + separator(s) + null */ >- newdn = slapi_ch_smprintf("%s,%s", newrdn, pdn); >- } else { >- newdn = slapi_ch_strdup( newrdn ); >- } >- slapi_sdn_free(&psdn); >- >- /* >- * Make sure the current backend is managing >- * the new dn. We won't support moving entries >- * across backend this way. >- * Done in the front-end. >- */ >- >- slapi_ch_free((void **)&newdn); >- > if (cb->local_acl && !cb->associated_be_is_disabled) { > /* > * Check local acls >diff --git a/ldap/servers/plugins/chainingdb/cb_search.c b/ldap/servers/plugins/chainingdb/cb_search.c >index 92eb2ea..a27e767 100644 >--- a/ldap/servers/plugins/chainingdb/cb_search.c >+++ b/ldap/servers/plugins/chainingdb/cb_search.c >@@ -77,7 +77,7 @@ chainingdb_build_candidate_list ( Slapi_PBlock *pb ) > char **referrals=NULL; > char *cnxerrbuf=NULL; > time_t endbefore=0; >- time_t endtime; >+ time_t endtime = 0; > cb_outgoing_conn *cnx; > > slapi_pblock_get( pb, SLAPI_BACKEND, &be ); >@@ -459,7 +459,7 @@ chainingdb_next_search_entry ( Slapi_PBlock *pb ) > char **referrals=NULL; > cb_backend_instance * cb=NULL; > Slapi_Backend * be; >- time_t endtime; >+ time_t endtime = 0; > > matched_msg=error_msg=NULL; > >diff --git a/ldap/servers/plugins/referint/referint.c b/ldap/servers/plugins/referint/referint.c >index 195ff2b..4db5d6d 100644 >--- a/ldap/servers/plugins/referint/referint.c >+++ b/ldap/servers/plugins/referint/referint.c >@@ -300,8 +300,7 @@ referint_postop_modrdn( Slapi_PBlock *pb ) > }else if(delay == 0){ > /* no delay */ > /* call function to update references to entry */ >- rc = update_integrity(argv, sdn, newrdn, >- newsuperior, logChanges, txn); >+ rc = update_integrity(argv, sdn, newrdn, newsuperior, logChanges, txn); > }else{ > /* write the entry to integrity log */ > writeintegritylog(argv[1], sdn, newrdn, newsuperior); >@@ -418,6 +417,7 @@ _update_one_per_mod(Slapi_DN *entrySDN, /* DN of the searched entry */ > } > /* newRDN and superior are already normalized. */ > newDN = slapi_ch_smprintf("%s,%s", newRDN, superior); >+ slapi_dn_ignore_case(newDN); > /* > * Compare the modified dn with the value of > * the target attribute of referint to find out >@@ -596,7 +596,9 @@ _update_all_per_mod(Slapi_DN *entrySDN, /* DN of the searched entry */ > /* no need to free superior */ > superior = slapi_dn_find_parent(origDN); > } >+ /* newRDN and superior are already normalized. */ > newDN = slapi_ch_smprintf("%s,%s", newRDN, superior); >+ slapi_dn_ignore_case(newDN); > /* > * Compare the modified dn with the value of > * the target attribute of referint to find out >diff --git a/ldap/servers/plugins/uiduniq/7bit.c b/ldap/servers/plugins/uiduniq/7bit.c >index 3e0b921..3509044 100644 >--- a/ldap/servers/plugins/uiduniq/7bit.c >+++ b/ldap/servers/plugins/uiduniq/7bit.c >@@ -606,8 +606,8 @@ preop_modrdn(Slapi_PBlock *pb) > > /* NOTE: strdup on the rdn, since it will be freed when > * the entry is freed */ >- >- slapi_entry_set_dn(e, slapi_ch_strdup(rdn)); >+ /* slapi_entry_set_normdn expects rdn normalized, but not decapitalized */ >+ slapi_entry_set_normdn(e, slapi_ch_strdup(rdn)); > > err = slapi_entry_add_rdn_values(e); > if (err) >diff --git a/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c b/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c >index 4eba4ed..c602a1c 100644 >--- a/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c >+++ b/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c >@@ -497,7 +497,8 @@ entryrdn_rename_subtree(backend *be, > if (newsrdn && slapi_rdn_get_rdn(newsrdn)) { > /* if the new RDN value is identical to the old RDN, > * we don't have to do "rename" */ >- if (strcmp(slapi_rdn_get_nrdn(newsrdn), slapi_rdn_get_nrdn(&oldsrdn))) { >+ /* Don't miss the case changes, too. */ >+ if (strcmp(slapi_rdn_get_rdn(newsrdn), slapi_rdn_get_rdn(&oldsrdn))) { > /* did not match; let's rename it */ > mynewsrdn = newsrdn; > } >diff --git a/ldap/servers/slapd/modrdn.c b/ldap/servers/slapd/modrdn.c >index a7bb1a6..c270ed5 100644 >--- a/ldap/servers/slapd/modrdn.c >+++ b/ldap/servers/slapd/modrdn.c >@@ -191,7 +191,6 @@ do_modrdn( Slapi_PBlock *pb ) > slapi_ch_free_string( &rawnewsuperior ); > goto free_and_return; > } >- slapi_dn_ignore_case( newrdn ); > slapi_ch_free_string( &rawnewrdn ); > > if (rawnewsuperior) { >@@ -218,6 +217,8 @@ do_modrdn( Slapi_PBlock *pb ) > */ > parent = slapi_dn_parent(slapi_sdn_get_ndn(&sdn)); > newdn = slapi_ch_smprintf("%s,%s", newrdn, parent); >+ /* slapi_sdn_init_normdn_passin expects normalized but NOT >+ * decapitalized dn */ > slapi_sdn_init_normdn_passin(&snewdn, newdn); /* newdn is normalized */ > if (0 == slapi_sdn_compare(&sdn, snewsuperior) || > 0 == slapi_sdn_compare(&snewdn, snewsuperior)) { >@@ -560,6 +561,7 @@ op_shared_rename(Slapi_PBlock *pb, int passin_args) > } > > /* check if created attributes are used in the new RDN */ >+ /* check_rdn_for_created_attrs ignores the cases */ > if (check_rdn_for_created_attrs((const char *)newrdn)) { > send_ldap_result(pb, LDAP_INVALID_DN_SYNTAX, NULL, "invalid attribute in RDN", 0, NULL); > goto free_and_return_nolock; >@@ -607,6 +609,8 @@ op_shared_rename(Slapi_PBlock *pb, int passin_args) > * appropriate one, or send a referral to our "referral server" > * if we don't hold it. > */ >+ /* slapi_mapping_tree_select_and_check ignores the case of newdn >+ * which is generated using newrdn above. */ > if ((err = slapi_mapping_tree_select_and_check(pb, newdn, &be, &referral, errorbuf)) != LDAP_SUCCESS) > { > send_ldap_result(pb, err, NULL, errorbuf, 0, NULL); >@@ -707,6 +711,7 @@ free_and_return_nolock: > } else { > slapi_pblock_get(pb, SLAPI_MODRDN_TARGET_SDN, &sdn); > slapi_sdn_free(&sdn); >+ /* get newrdn to free the string */ > slapi_pblock_get(pb, SLAPI_MODRDN_NEWRDN, &newrdn); > slapi_ch_free_string(&newrdn); > slapi_pblock_get(pb, SLAPI_MODRDN_NEWSUPERIOR_SDN, &newsuperiorsdn); >-- >1.7.7.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 821542
: 584480