summaryrefslogtreecommitdiffstats
path: root/ldap/servers/slapd/schema.c
Commit message (Collapse)AuthorAgeFilesLines
* Bug 630097 - (cov#11933) Fix NULL dereference in schema codeNathan Kinder2010-09-151-1/+3
| | | | | | | | | | | | There is a possibility of deferencing prevocp when it is NULL the second time through the loop if the first pass was not a standard objectclass definition and tmpocp != curlisthead. I don't think that this issue is possible unless some other thread was able to modify tmpocp->oc_next between where curlisthead is set (schema.c:2654) and where nextocp is set (schema.c:2658) the first time through the loop. That said, I see no harm in checking if prevocp is NULL before attempting to dereference it.
* Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues ↵Endi S. Dewata2010-08-231-1/+15
| | | | | | | | | 12167 - 12199 https://bugzilla.redhat.com/show_bug.cgi?id=610119 Resolves: bug 610119 Bug description: Fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199 Fix description: Catch possible NULL pointer in slapi_entry_schema_check().
* Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues ↵Endi S. Dewata2010-08-201-2/+6
| | | | | | | | | 11892 - 11939 https://bugzilla.redhat.com/show_bug.cgi?id=613056 Resolves: bug 613056 Bug description: Fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939 description: Catch possible NULL pointer in oc_replace_nolock() and schema_replace_objectclasses().
* Bug 595874 - 99user.ldif getting overpopulated389-ds-base-1.2.6.a4Rich Megginson2010-05-261-4/+18
| | | | | | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=595874 Resolves: bug 595874 Bug Description: 99user.ldif getting overpopulated Reviewed by: self Branch: HEAD Fix Description: The schema code was adding X-ORIGIN 'user defined' to all schema elements that had no X-ORIGIN. It should only add user defined to schema elements from the user defined schema file, not to schema defined in standard (read only) schema files. It looks like the code should work fine if the schema element has no origin, so there is no reason to add an origin for schema other than user defined schema. Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no
* 548115 - memory leak in schema reloadNoriko Hosoi2010-02-251-3/+5
| | | | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=548115 Description: dse.c: 1) dse_add_entry_pb is supposed to free the given the schema entry e. Although the function never consumes the entry, it was only freeing it when the entry was added. (If it was merged or rejected, it was not freed.) schema.c: 1) when allocating a work buffer with sizedbuffer_allocate, the space for the NULL termination was not counted. 2) DSE returned from slapi_validate_schema_files must have been freed regardless of the return value.
* Do not use syntax plugins directly for filters, indexingRich Megginson2010-02-171-2/+2
| | | | | | | | | | | 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.
* Change default branding to 389 - remove lite codeRich Megginson2009-08-111-46/+0
| | | | | | | | | | | | | | | | | | | The vendor, brand, and capbrand are set in configure - we should use those everywhere rather than have to run some sort of script over the code to change vendor, brand, version, etc. I've added VENDOR, BRAND, CAPBRAND to the default defines passed to the compiler, and changed the code to use these defines. And instead of the unintuitively named PRODUCTTEXT macro, we should use the already defined PRODUCT_VERSION. This allowed me to get rid of some code. The version was from a generated file called dirver.h which we don't need anymore, and we don't need the perl script dirver.pl which generated it. The vendor string was coming from the dirlite header file. So I also used this as an excuse to get rid of all references to dirlite once and for all (yay!). For the places in plain text files which are not substituted, I just used the generic name Dirsrv or Directory Server instead of having an explicit brand and/or version in there. Reviewed by: nkinder (Thanks!)
* OpenLDAP supportcleanupRich Megginson2009-07-071-1/+1
| | | | | | | | | | These changes allow the server to be built with OpenLDAP (2.4.17+). A brief summary of the changes: * #defines not provided by OpenLDAP were copied into slapi-plugin.h and protected with #ifndef blocks * where it made sense, I created slapi wrapper functions for things like URL and LDIF processing to abstract way the differences in the APIs * I created a new file utf8.c which contains the UTF8 functions from MozLDAP - this is only compiled when using OpenLDAP * I tried to clean up the code - use the _ext versions of LDAP functions everywhere since the older versions should be considered deprecated * I removed some unused code NOTE that this should still be considered a work in progress since it depends on functionality not yet present in a released version of OpenLDAP, for NSS crypto and for the LDIF public API.
* Bug: 181465 - Handle spacing issues in objectClass SUP list.Nathan Kinder2009-05-291-3/+8
| | | | | | | | | Our schema parser requires a space after the opening paran when multiple SUP objectclasses are listed in the definition of an objectclass. The RFCs show that a space is not required. This patch simply removes the requirement that a space be present after the opening paran.
* Added capability to validate syntax of values being added to the database. ↵Nathan Kinder2009-05-081-1/+3
| | | | | | Also added numericstring syntax support. For more details, see the design doc at http://directory.fedoraproject.org/wiki/Syntax_Validation_Design
* Resolves: 474945Nathan Kinder2009-01-211-1/+3
| | | | Summary: Consistently deal with attr syntax info struct ref count when fetcvhing and returning them to the global hashtables.
* Resolves: 480384Nathan Kinder2009-01-191-1/+10
| | | | Summary: Allow attribute aliases to be used as SUP attribute in attributetype definitions.
* Resolves: 445775Nathan Kinder2008-12-041-2/+6
| | | | Summary: Avoid replicating default schema when DESC element is an empty string.
* Resolves: 470918Nathan Kinder2008-11-131-3/+3
| | | | Summary: Made replica_set_updatedn detect value add modify operations properly.
* Resolves: #447353Noriko Hosoi2008-07-151-1/+1
| | | | | | | | | | | | | | | | Summary: RFE: search optimization and single character substring searches Description: extended the substring key to have 3 types: * begin (e.g., *^a) * middle (e.g., *abc) * end (e.g., *xy$) * Usage: turn an index object to extensibleobject and set an integer value as follows: * dn: cn=sn, cn=index, cn=userRoot, cn=ldbm database, cn=plugins, cn=config * objectClass: extensibleObject * nsSubStrBegin: 2 * nsSubStrMiddle: 3 * nsSubStrEnd: 2 * [...]
* Resolves: #437525Noriko Hosoi2008-06-271-28/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: GER: allow GER for non-existing entries Description: [slapd/charray.c] new: charray_merge_nodup -- merge 2 string arrays skipping the duplicates modified: charray_remove -- introduced "freeit" flag. If true, the removed string is freed. (The API is used only in chainingdb. The change is applied to the plugin.) [slapd/opshared.c] modified: check OP_FLAG_GET_EFFECTIVE_RIGHTS in the iterate to support "@<objectclass>". It's needed to do at the location since we have to call acl plugin even when no entries are returned from the search. If no entries are returned and "@<objectclass>" is found in the attribute list, acl effective rights code generates the corresponding template entry. [slapd/pblock.c] place to store gerattrs is added (SLAPI_SEARCH_GERATTRS), where gerattrs is an array of strings which store "...@<objectclass>". [slapd/result.c] moved OP_FLAG_GET_EFFECTIVE_RIGHTS checking to iterate (opshared.c) [slapd/schema.c] new: slapi_schema_list_objectclass_attributes -- return the required and/or allowed attributes belonging to the given objectclass. This is used to support "*" and "+" in the get effective rights. new: slapi_schema_get_superior_name -- return the superior objectclass name of the given objectclass. [slapd/search.c] if "<attr>@<objectclass>" is found in the attribute list, cut the <attr> part out and added to the attrs array (pblock SLAPI_SEARCH_ATTRS) and store the original string to the gerattrs (pblock SLAPI_SEARCH_GERATTRS). [plugin/acl/acleffectiverights.c] modified: _ger_g_permission_granted -- if the requester and the subject user are identical, give "g" permission modified: _ger_parse_control -- replaced strcpy with memmove since strcpy does not guarantee the result of the overlap copy. modified: _ger_get_attrs_rights -- support "*" (all attributes belonging to the object) and "+" (operational attributes). If repeated attributes are found in the given attribute list, they are reduced to one. new: _ger_generate_template_entry -- generate a template entry if "@<objectclass>" is passed. [pluginc/cb/*] adjusted to the updated charray_remove. Please see also this wiki page for the overview and test cases. http://directory.fedoraproject.org/wiki/Get_Effective_Rights_for_non-present_attributes
* Resolves: #436837Noriko Hosoi2008-06-101-8/+8
| | | | | Summary: Dynamically reload schema via task interface (comment #15) Description: fixed the broken function declaration.
* Resolves: #436837Noriko Hosoi2008-06-041-4/+9
| | | | | Summary: Dynamically reload schema via task interface Description: slapi_validate_schema_files: call dse_destroy only when the previous validation was successful.
* Resolves: #436837Noriko Hosoi2008-06-041-464/+712
| | | | | | Summary: Dynamically reload schema via task interface Description: implemented task based schema file reloading (see also http://directory.fedoraproject.org/wiki/Dynamically_Reload_Schema)
* Resolves: #287961Noriko Hosoi2007-09-251-0/+4
| | | | | | Summary: server crashes in schema replication Description: resetting the global linked list head when the first objectclass is removed from the list.
* 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 +
* [207427] parameterizing the hardcoded paths (Comment #15)Noriko Hosoi2006-09-271-1/+5
| | | | phase 1. parameterizing config, schema and ldif directory
* Bug(s) fixed: 186280Rich Megginson2006-04-111-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Bug Description: ldapserver: Close potential security vulnerabilities in CGI code Reviewed by: Nathan, Noriko, and Pete (Thanks!) Fix Description: Clean up usage of sprintf, strcpy, fgets instead of gets, fixed buffer usage, etc., mostly in the CGI code and other user facing code (i.e. setup). Also, Steve Grubb told me about a GCC trick to force it to check printf style varargs functions, to check the format string against the argument string, for type mismatches, missing arguments, and too many arguments. In the CGI form argument parsing code, we needed to be more careful about checking for bad input - good input is supposed to look like this: name=value&name=value&..... &name=value. I don't think the original code was checking properly for something like name&name=value. There was another place where we were not checking to see if a buffer had enough room before appending a string to it. I had to change a couple of functions to allow passing in the size of the buffer. Fixed some issues raised by Noriko and Nathan. Platforms tested: RHEL4 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none
* Fixed licensing typoNathan Kinder2005-04-191-1/+3
|
* 155068 - Added license to source filesNathan Kinder2005-04-151-0/+30
|
* This one is mostly strcpy/strcat checking, checking for null strings before ↵Rich Megginson2005-03-111-1/+6
| | | | strlen, removing some dead code, other odds and ends.
* fix Windows build issuesRich Megginson2005-03-051-1/+2
|
* clean up sprintf usage and many other flawfinder issues; clean up compiler ↵Rich Megginson2005-03-051-14/+8
| | | | warnings on Linux; remove pam_passthru from DS 7.1
* 149951 - Updated source code copyrightsNathan Kinder2005-02-281-2/+2
|
* Moving NSCP Directory Server from DirectoryBranch to TRUNK, initial drop. ↵ldapserver7xcvsadm2005-01-211-0/+4664
(foxworth)