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 148976 Details for
Bug 225352
CLA: resurrected value uses case of former value
[?]
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]
fix proposal, compares Slapi_Value arrays and fix the case
diff-225352-1.txt (text/plain), 3.31 KB, created by
Ulf Weltman
on 2007-03-01 01:03:45 UTC
(
hide
)
Description:
fix proposal, compares Slapi_Value arrays and fix the case
Filename:
MIME Type:
Creator:
Ulf Weltman
Created:
2007-03-01 01:03:45 UTC
Size:
3.31 KB
patch
obsolete
>Index: ldap/ns/netsite/ldap/servers/slapd/entrywsi.c >=================================================================== >RCS file: /repository/source/ldap/ns/netsite/ldap/servers/slapd/entrywsi.c,v >retrieving revision 1.1.1.4 >diff -U8 -r1.1.1.4 entrywsi.c >--- entrywsi.c 2004/08/19 21:17:42 1.1.1.4 >+++ entrywsi.c 2007/03/01 00:36:40 >@@ -5,16 +5,17 @@ > * END COPYRIGHT BLOCK **/ > > /* entrywsi.c - routines for dealing with entries... With State Information */ > > #include "slap.h" > #include "slapi-plugin.h" > > static void resolve_attribute_state(Slapi_Entry *e, Slapi_Attr *a, int attribute_state); >+static void match_vals_and_replace_case(Slapi_Attr *a, Slapi_Value **target, Slapi_Value **source); > > static int > entry_present_value_to_deleted_value(Slapi_Attr *a, Slapi_Value *v) > { > Slapi_Value *r= valueset_remove_value(a, &a->a_present_values, v); > if(r!=NULL) > { > slapi_valueset_add_value_ext(&a->a_deleted_values, r, SLAPI_VALUE_FLAG_PASSIN); >@@ -463,16 +464,22 @@ > valueset_remove_valuearray(&a->a_deleted_values, a, valuestoadd, SLAPI_VALUE_FLAG_IGNOREERROR,&deletedvalues); /* JCM Check return code */ > if(deletedvalues!=NULL && deletedvalues[0]!=NULL) > { > /* Some of the values to be added were on the deleted list */ > Slapi_Value **v= NULL; > Slapi_ValueSet vs; > /* Add each deleted value to the present list */ > valuearray_update_csn(deletedvalues,CSN_TYPE_VALUE_UPDATED,csn); >+ >+ /* The value was found in the deleted list, but the case of >+ the deleted value may be different; check and replace >+ with the case requested by the client if needed */ >+ match_vals_and_replace_case(a, deletedvalues, valuestoadd); >+ > valueset_add_valuearray_ext(&a->a_present_values, deletedvalues, SLAPI_VALUE_FLAG_PASSIN); > /* Remove the deleted values from the values to add */ > valueset_set_valuearray_passin(&vs,valuestoadd); > valueset_remove_valuearray(&vs, a, deletedvalues, SLAPI_VALUE_FLAG_IGNOREERROR, &v); > valuestoadd= valueset_get_valuearray(&vs); > valuearray_free(&v); > slapi_ch_free((void **)&deletedvalues); > } >@@ -1144,8 +1151,38 @@ > { > resolve_attribute_state_single_valued(e,a,attribute_state); > } > else > { > resolve_attribute_state_multi_valued(e,a,attribute_state); > } > } >+ >+/* Uses the syntax-aware slapi_value_compare() to find intersections in >+ the two value arrays, and then a case-sensitive compare on intersections to >+ see if they still match - if not, fix the case to match the source list */ >+static void match_vals_and_replace_case(Slapi_Attr *a, Slapi_Value **targetlist, Slapi_Value **sourcelist) >+{ >+ int i=0, ii; >+ long attr_flags_saved; >+ >+ attr_flags_saved = a->a_flags; >+ while( targetlist[i] ) { >+ /* This performs a syntax-aware value search in the value array */ >+ ii = valuearray_find( a, sourcelist, targetlist[i] ); >+ if( ii != -1 ) { >+ /* Now do a case-sensitive comparison */ >+ a->a_flags |= SLAPI_ATTR_FLAG_CMP_BITBYBIT; >+ if( slapi_value_compare( a, targetlist[i], sourcelist[ii] ) != 0 ) { >+ /* Replace the value with the value which has desired case, >+ slapi_value_set_berval frees the existing value */ >+ slapi_value_set_berval( targetlist[i], >+ slapi_value_get_berval( sourcelist[ii] ) ); >+ } >+ /* Unset the flag that forces case-sensitivity */ >+ a->a_flags = attr_flags_saved; >+ } >+ i++; >+ } >+ return; >+} >+
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 225352
: 148976