summaryrefslogtreecommitdiffstats
path: root/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.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!)
* Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues ↵Noriko Hosoi2010-08-231-6/+2
| | | | | | | | | | | | 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: Remove unnecessary NULL pointer checking in attrcrypt_keymgmt_store_key(). coverity ID: 12168
* Update to New DN FormatNoriko Hosoi2010-04-261-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* cleanup build warningsRich Megginson2010-03-081-15/+14
| | | | | | This patch cleans up various build warnings found by compiling the code with -Wall on RHEL5. Reviewed by: nhosoi (Thanks!)
* 548535 - memory leak in attrcryptNoriko Hosoi2010-02-081-1/+27
| | | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=548535 Description: The attrcrypt module maintains the inst_attrcrypt_state_private field in the instance structure (ldbm_instance) to store the private keys. The area and the space for the private keys are allocated in attrcrypt_init which is called from dblayer_instance_start. A backend instance could be closed and restarted multiple times (for instance, in the bulk_import, which is used by the replica initialization), but the area had no chance to be freed. This patch is adding the clean-up code.
* Allow modrdn to move subtree and rename non-leaf nodeNoriko Hosoi2010-01-221-1/+46
| | | | | | | | | | | | | | | | | | | | | | | | | This patch includes - replacing the entrydn index with the entryrdn index - replacing a full DN in each entry in the DB with an RDN - extending Slapi_Entry, entry2str, and str2entry to absorb the changes made on the entry - adding DN/RDN helper functions - adding DN cache - adding a utility and a migration script to convert the DN format database to the RDN format - extending a database dump utility dbscan to support the entryrdn - slapi_dn_syntax_check by nkinder@redhat.com is added to check the dn before modify operations - big fix for 171338 - Enhancement: winsync modrdn not synced In addition to the above, compile warnings and memory leaks found in testing the new feature are fixed. For more details, see the feature design document at: http://directory.fedoraproject.org/wiki/Subtree_Rename and bugzilla at: https://bugzilla.redhat.com/show_bug.cgi?id=171338
* Fails to start if attrcrypt can't unwrap keysRich Megginson2009-08-251-0/+4
| | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=519065 Resolves: 519065 Bug Description: Fails to start if attrcrypt can't unwrap keys Reviewed by: nhosoi (Thanks!) Fix Description: If not using the attrcrypt feature, just return success if the keys could not be unwrapped. Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no
* Fix attrcrypt usage of nsSymmetricKeyRich Megginson2009-07-141-5/+30
| | | | | | | | | | | The current attrcrypt is failing because it attempts to store the encryption symkey in the nsSymmetricKey attribute. This attribute is not defined in the schema, so it defaults to DirectoryString syntax. Storing the value then fails syntax validation because the binary values in the key do not conform to DirectoryString. The code was poorly designed to handle and report errors of this nature. The real fix is to add nsSymmetricKey as a BINARY syntax attribute. I also cleaned up the error detection and reporting for this case. Reviewed by: nkinder (Thanks!)
* Reduce noise reported by valgrindRich Megginson2009-07-141-4/+9
| | | | | | | | | | | | | | | | | | | valgrind is a very useful tool - however, the directory server produces a lot of false positives that have to be suppressed in order to get to the useful information. These patches attempt to reduce some of that noise. 1) aclparse - should calculate the length of the string _after_ trimming the spaces 2) something about random number generation causes some of the bits to be uninitialized, and valgrind doesn't like it - this patch doesn't eliminate the error, just reduces it 3) use initialized memory when generating hashes - also remove "magic numbers" 4) bin.c - slapi_value_get_string must not be used with unterminated (binary) values 5) we get these odd valgrind reports from deep within bdb about invalid reads and uninitialized memory - I thought perhaps because we were initializing DBT structures with = {0} which the bdb docs says is not sufficient - they recommend memset or bzero 6) There are some small memory leaks during attrcrypt initialization and in error cases 7) error message in ldif2ldbm.c was attempting to print the Slapi_DN structure rather than getting the char *dn 8) After we call NSS_Initialize, we must call the NSS shutdown functions to clean up the caches and other data structures, otherwise NSS will leak memory. This is harmless since it happens at exit, but valgrind reports hundreds of memory leaks. The solution is to make sure we go through a single exit point after NSS_Initialize. This means many places that just called exit() must instead return with a real return value. This mostly affected main.c, detach.c, and a couple of other places called during startup. 9) minor memory leaks in mapping tree initialization 10) sasl_map.c - should not call this in referral mode 11) minor memory leaks during ssl init Reviewed by: nkinder, nhosoi (Thanks!)
* Resolves: bug 460381FedoraDirSvr_1_1_2_RC_20080828FedoraDirSvr_1_1_2_RCRich Megginson2008-08-271-1/+6
| | | | | | | | | | | | Bug Description: various valgrind reported startup memory leaks Reviewed by: nhosoi (Thanks!) Files: see diff Branch: HEAD Fix Description: These memory leaks are not serious, but they do create a lot of noise in valgrind. Platforms tested: RHEL5, Fedora 8 Flag Day: no Doc impact: no
* Resolves: #339031Noriko Hosoi2007-10-191-1/+1
| | | | Summary: Solaris: warnings reported by the Solaris compiler
* Resolves: #188320Noriko Hosoi2007-10-181-7/+7
| | | | Summary: HP-UX: warnings reported by the HP-UX compiler
* 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 +
* Bug(s) fixed: 186280Rich Megginson2006-04-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
|
* fixed spacingRich Megginson2005-03-281-2/+2
|
* Bug(s) fixed: 152030Rich Megginson2005-03-241-0/+8
| | | | | | | | | | | Bug Description: Various valgrind reported problems. Mostly not serious, but a few which could cause bad leaks in certain situations. Reviewed by: Rob and David (Thanks!) Fix Description: Mostly added frees where needed, or moved things around to make sure the proper free was called. I also fixed the formatting/spacing. Platforms tested: RHEL3 Flag Day: no Doc impact: No. QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none
* clean up sprintf usage and many other flawfinder issues; clean up compiler ↵Rich Megginson2005-03-051-8/+3
| | | | warnings on Linux; remove pam_passthru from DS 7.1
* 149951 - Updated source code copyrightsNathan Kinder2005-02-281-1/+1
|
* Moving NSCP Directory Server from DirectoryBranch to TRUNK, initial drop. ↵ldapserver7xcvsadm2005-01-211-0/+870
(foxworth)