summaryrefslogtreecommitdiffstats
path: root/ldap/servers/slapd/valueset.c
Commit message (Collapse)AuthorAgeFilesLines
* fix compiler warnings - unused vars/funcs, invalid castsRich Megginson2010-09-011-1/+1
| | | | | | | | | This commit fixes many compiler warnings, mostly for things like unused variables, functions, goto labels. One place was using csngen_free instead of csn_free. A couple of places were using casts incorrectly, and several places needed some casts added. Tested on: RHEL5 x86_64, Fedora 14 x86_64 Reviewed by: nkinder (Thanks!)
* Update to New DN FormatNoriko Hosoi2010-04-261-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix Description: . adding slapi_dn_normalize_ext and its siblings to normalize/validate invalid DNs; deprecating slapi_dn_normalize and its siblings. (dn.c) . replacing slapi_dn_normalize with new corresponding functions. . normalizing hardcoded DNs (e.g., removing spaces around ',') . setting correct DN syntax to nsslapd-suffix, nsslapd-ldapiautodnsuffix, costemplatedn, nsslapd-changelogsuffix, nsBaseDN, nsBindDN . if nsslapd-dn-validate-strict is enabled, incoming DN is examined and rejected if it is invalid. Once approved, the DN is normalized. . fixing compiler warnings and typos. See also: http://directory.fedoraproject.org/wiki/Upgrade_to_New_DN_Format Related bugs: Bug 199923 - subtree search fails to find items under a db containing special characters Bug 567968 - subtree/user level password policy created using 389-ds-console doesn't work. Bug 570107 - The import of LDIFs with base-64 encoded DNs fails, modrdn with non-ASCII new rdn incorrect Bug 570962 - ns-inactivate.pl does not work Bug 572785 - DN syntax: old style of DN <type>="<DN>",<the_rest> is not correctly normalized Bug 573060 - DN normalizer: ESC HEX HEX is not normalized Bug 574167 - An escaped space at the end of the RDN value is not handled correctly
* fix memory leak in attr replace when replacement failsRich Megginson2010-02-241-4/+13
| | | | | | | | | | if replacement of the attribute values fails (e.g. due to duplicate values) the valstoreplace is not freed - the caller expects the valueset_replace function to own the values passed in. The function will now free the values if there was an error In addition, valueset_replace should not free the old values in case of error - it should leave the old values in the attribute Reviewed by: nhosoi (Thanks!)
* Do not use syntax plugins directly for filters, indexingRich Megginson2010-02-171-16/+15
| | | | | | | | | | | There were many places in the server code that directly used the syntax plugin for the attribute. If the attribute schema definition specified a matching rule, we must use that matching rule for matching values of that attribute, filtering that attribute, and generating index keys for values of that attribute. New internal and plugin APIs have been added that use the Slapi_Attr* instead of using the syntax plugin directly. The new API will determine which matching rule to apply based on the schema definition.
* 247413 - Incorrect error on multiple identical value addNoriko Hosoi2010-01-281-1/+3
| | | | | | | | | | | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=247413 [Problem Description] Adding multiple identical values returns "Operations error (LDAP_OPERATIONS_ERROR == 0x1)" instead of "Type or value exists (LDAP_TYPE_OR_VALUE_EXISTS == 0x14)" E.g., dn: ou=test,dc=example,dc=com changetype: modify replace: description description: test description: test modifying entry "ou=test,dc=example,dc=com" ldap_modify: Operations error (1) [Fix Description] API valueset_replace used to override any error from the lower layer with LDAP_OPERATIONS_ERROR. If the error is LDAP_TYPE_OR_VALUE_EXISTS, the error is now returned as is.
* Resolves: bug 458675Rich Megginson2008-08-271-9/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug Description: Memory leaks in valueset code Reviewed by: nkinder,nhosoi (Thanks!) Branch: HEAD Fix Description: The first leak occurs when you are using replication and you add values to an attribute that were previously deleted - that is, the values that you want to add are on the attribute's deleted values list and are being "resurrected". This leak is caused by an improper bit test (foo & bar|baz). The or | has higher precedence and is evaluated first. The fix is to use parentheses (foo & (bar|baz)). Note that this issue was flagged by the compiler gcc with -Wall. The second leak is caused when several values are being added to an attribute, and the list contains non-sequential duplicate values (e.g. foo, bar, baz, foo). The code uses an array of Slapi_Value* called keyvals. When a valid value is found, the Slapi_Value* is moved from keyvals to valuetreep and the keyvals array index is set to NULL. This array is passed to valuearray_free to free the individual Slapi_Value* and the array itself. This works fine in the non-error case because there are no Slapi_Value* elements to free, so it just frees the array. However, in the duplicate value case, some of the elements have already been set to NULL, so those are skipped over by valuearray_free. The fix is to introduce a new function valuearray_free_ext that takes an additional argument which is the array index to start freeing from. That way the non-NULL Slapi_Value* elements can be freed along with the array itself. Platforms tested: RHEL5, Fedora 8 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none
* Resoves: #428929Noriko Hosoi2008-07-021-5/+36
| | | | | | | | | Summary: Directory server is caching string case for attributes with Directorystring syntax even after deletion Description: Introduced a new flag SLAPI_VALUE_FLAG_USENEWVALUE for valueset_remove_valuearr to exchange the value in the deleted value set and the to be added value. With this change, the newly added value is resurrected instead of the original value.
* Resolves: #214533Noriko Hosoi2006-11-101-0/+5
| | | | | | | | | | Summary: configure needs to support --with-fhs (Comment #6) Changes: Added the following include next to the end of the copyright block. + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif +
* Resolves: #199923Noriko Hosoi2006-11-061-0/+30
| | | | | Summary: subtree search fails to find items under a db containing special characters (Comment#16) Description: When dn contains rdn which includes '\\', it was escaped twice to generate a key for entrydn and caused mismatch in forming ancestorid index. It ends up the subtree search fail.
* [Bug 164834] modify/replace allows multiple same valued attributes in an entryNoriko Hosoi2005-08-251-18/+36
| | | | | | | | 1) Eliminated SLAPD_MODUTIL_TREE_THREASHHOLD from attr.c as well as valueset.c. With this change, if an attribute has more than 1 value to add/replace/delete, it creates an AVL tree to check the duplicates. 2) Replace was not checking the duplicated value at all. Added a code to put the attribute values into the AVL tree as being done for add and delete.
* Fixed licensing typoNathan Kinder2005-04-191-1/+3
|
* 155068 - Added license to source filesNathan Kinder2005-04-151-0/+30
|
* 149951 - Updated source code copyrightsNathan Kinder2005-02-281-2/+2
|
* Moving NSCP Directory Server from DirectoryBranch to TRUNK, initial drop. ↵ldapserver7xcvsadm2005-01-211-0/+1303
(foxworth)