summaryrefslogtreecommitdiffstats
path: root/lib/ldaputil
Commit message (Collapse)AuthorAgeFilesLines
* fix compiler warnings - unused vars/funcs, invalid castsRich Megginson2010-09-011-212/+0
| | | | | | | | | 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!)
* implement slapi_ldap_explode_dn and slapi_ldap_explode_rdnRich Megginson2010-08-311-2/+2
| | | | | | | | | | | | The DS has some problems with the openldap versions of these functions: 1) They are deprecated - should use the str2[r]dn and [r]dn2str and the bv versions of those functions instead 2) They escape utf-8 and other values in the strings - the mozldap functions do not do this 3) They handle double quoted strings, but they remove the quotes - our code expects the quotes to be left in place Until we fix our DN handling, and get rid of the double quoted DNs, we just use the mozldap versions of these functions.
* Bug 611790 - fix coverify Defect Type: Null pointer dereferences issues ↵Endi S. Dewata2010-08-231-0/+1
| | | | | | | | | 11940 - 12166 https://bugzilla.redhat.com/show_bug.cgi?id=611790 Resolves: bug 611790 Bug description: Fix coverify Defect Type: Null pointer dereferences issues 11940 - 12166 Fix description: Catch possible NULL pointer in ldapu_cert_mapfn_default().
* Bug 616500 - fix coverity Defect Type: Resource leaks issuesNoriko Hosoi2010-08-2012-2297/+0
| | | | | | | | | | | | | CID 12094 - 12136 https://bugzilla.redhat.com/show_bug.cgi?id=616500 coverity 12125 Comment: This function (ldapu_certinfo_save) is not used - just get rid of it Removing unused functions from lib/ldaputil/certmap.c ldapu_certinfo_save, ldapu_certinfo_modify, ldapu_certinfo_delete Also, removing obsolete test codes: lib/ldaputil/utest.
* Bug 616500 - fix coverify Defect Type: Resource leaks issues CID 12094 - 12136Endi S. Dewata2010-08-201-15/+41
| | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=616500 Resolves: bug 616500 Bug description: fix coverify Defect Type: Resource leaks issues CID 12122, 12123, 12126 description: Fixed resource leaks in ldapu_list_copy(), ldapu_propval_copy(), and ldapu_cert_to_user().
* Bug 617630 - fix coverify Defect Type: Resource leaks issues CID 12052 - 12093Endi S. Dewata2010-08-191-10/+20
| | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=617630 Resolves: bug 617630 Bug description: fix coverify Defect Type: Resource leaks issues CID 12068, 12069. description: dbinfo_to_certinfo() has been modified to release unused resources when error occurs.
* Bug 614242 - C99/ANSI C++ related compile errors on HP-UXRich Megginson2010-07-141-1/+1
| | | | | | | | | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=614242 Resolves: bug 614242 Bug Description: C99/ANSI C++ related compile errors on HP-UX Reviewed by: rmeggins Branch: HEAD Fix Description: In lib/ldaputil/vtable.c, a global static struct is declared and initialized to {}. I see gcc allows this, and aCC does also but only with -AA ("newly supported ANSI C++ Standard features"). In ldap/servers/slapd/tools/ldclt/ldclt.c, an array size is set using a variable, which I think is legal in C99. Since the size is not computed, and this is the only place C99 is taken advantage of, this can be changed to a then I would instead add the -AC99 compiler flag for HP-UX. Platforms tested: HP-UX Flag Day: no Doc impact: no Patch submitted by: Ulf Weltman <ulf.weltman@hp.com>
* 609255 - fix coverity Defect Type: Memory - illegal accesses issuesNoriko Hosoi2010-07-071-0/+1
| | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=609255 12291 USE_AFTER_FREE Triaged Unassigned Bug Minor Fix Required dbconf_read_default_dbinfo_sub() ds/lib/ldaputil/dbconf.c Comment: should never happen - should always break out of the loop at 504 with a valid db_info - but we should set db_info = NULL after line 505 just to make sure
* Change default branding to 389 - remove lite codeRich Megginson2009-08-116-25/+25
| | | | | | | | | | | | | | | | | | | 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 supportRich Megginson2009-07-075-1714/+12
| | | | | | | | | | 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 Description: Need to address 64-bit compiler warnings - part 1Rich Megginson2008-10-083-2/+10
| | | | | | | | | | | | | | | | | | | | | Reviewed by: nhosoi (Thanks!) Fix Description: The intptr_t and uintptr_t are types which are defined as integer types that are the same size as the pointer (void *) type. On the platforms we currently support, this is the same as long and unsigned long, respectively (ILP32 and LP64). However, intptr_t and uintptr_t are more portable. These can be used to assign a value passed as a void * to get an integer value, then "cast down" to an int or PRBool, and vice versa. This seems to be a common idiom in other applications where values must be passed as void *. For the printf/scanf formats, there is a standard header called inttypes.h which defines formats to use for various 64 bit quantities, so that you don't need to figure out if you have to use %lld or %ld for a 64-bit value - you just use PRId64 which is set to the correct value. I also assumed that size_t is defined as the same size as a pointer so I used the PRIuPTR format macro for size_t. I removed many unused variables and some unused functions. I put parentheses around assignments in conditional expressions to tell the compiler not to complain about them. I cleaned up some #defines that were defined more than once. I commented out some unused goto labels. Some of our header files shared among several source files define static variables. I made it so that those variables are not defined unless a macro is set in the source file. This avoids a lot of unused variable warnings. I added some return values to functions that were declared as returning a value but did not return a value. In all of these cases no one was checking the return value anyway. I put explicit parentheses around cases like this: expr || expr && expr - the && has greater precedence than the ||. The compiler complains because it wants you to make sure you mean expr || (expr && expr), not (expr || expr) && expr. I cleaned up several places where the compiler was complaining about possible use of uninitialized variables. There are still a lot of these cases remaining. There are a lot of warnings like this: lib/ldaputil/certmap.c:1279: warning: dereferencing type-punned pointer will break strict-aliasing rules These are due to our use of void ** to pass in addresses of addresses of structures. Many of these are calls to slapi_ch_free, but many are not - they are cases where we do not know what the type is going to be and may have to cast and modify the structure or pointer. I started replacing the calls to slapi_ch_free with slapi_ch_free_string, but there are many many more that need to be fixed. The dblayer code also contains a fix for https://bugzilla.redhat.com/show_bug.cgi?id=463991 - instead of checking for dbenv->foo_handle to see if a db "feature" is enabled, instead check the flags passed to open the dbenv. This works for bdb 4.2 through bdb 4.7 and probably other releases as well. Platforms tested: RHEL5 x86_64, Fedora 8 i386 Flag Day: no Doc impact: no
* Resolves: #188320Noriko Hosoi2007-10-183-12/+6
| | | | Summary: HP-UX: warnings reported by the HP-UX compiler
* Resolves: #237040Noriko Hosoi2007-04-191-96/+0
| | | | Summary: Remove obsolete makefiles
* Resolves: #214533Noriko Hosoi2006-11-1019-0/+95
| | | | | | | | | | 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: #214728Noriko Hosoi2006-11-101-1/+1
| | | | | Summary: Cleaning up obsolete macros in the build Changes: eliminated macro LDAPDB_THREAD_SAFE (Comment #11)
* Resolves: #214728Noriko Hosoi2006-11-101-29/+0
| | | | | Summary: Cleaning up obsolete macros in the build Changes: eliminated macro NSPR20 (Comment #8)
* Bug: 206527Rich Megginson2006-09-151-10/+1
| | | | | | | | Description: Enable rpmbuild of directory server Fix Description: RELDIR is not defined in lib/ldaputil/Makefile, so just remove the certmap.conf packaging from there and add it to ldap/cm/Makefile The perldap packaging has changed for internal builds as well. Tested on: Solaris
* Bug: 206527Rich Megginson2006-09-151-1/+10
| | | | | | | | | | | | | | | Description: Enable rpmbuild of directory server Fix Description: You can set env. vars. to override all of the LIB and INCLUDE paths with the make -e flag. I moved all of the external component packaging stuff into the packageDirectory target of ldap/cm/Makefile, and moved the "packaging" of the internal files into the releaseDirectory target. So the releaseDirectory target will now copy all of the ldapserver binaries and runtime files into their correct places under RELDIR, which is then used to create the rpm. There were a couple of other places that needed to change the way a particular file was packaged in order ot make sure it was packaged in the core ds and not as an external component. Tested on: RHEL4 Reviewed by: nhosoi (Thanks!)
* Bug(s) fixed: 186280Rich Megginson2006-04-113-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-1930-30/+90
|
* HP-UX IPF Porting changesNathan Kinder2005-04-181-0/+4
|
* 155068 - Added license to source filesNathan Kinder2005-04-1530-0/+900
|
* [Bug 146919] Directory Server rebrandingNoriko Hosoi2005-03-257-28/+28
| | | | | | | | | | 1) Brandx -> Fedora 2) Pick up new internal component set (Admin SDK, Setup SDK, Admin Server) 3) Use JRE from the Admin Server package 4) Docs a) Componentize Docs b) Rebrand Docs c) Drop packaging Administration Guide in the external version
* clean up sprintf usage and many other flawfinder issues; clean up compiler ↵Rich Megginson2005-03-054-38/+8
| | | | warnings on Linux; remove pam_passthru from DS 7.1
* 149951 - Updated source code copyrightsNathan Kinder2005-02-2830-60/+60
|
* addedRich Megginson2005-02-071-0/+1
|
* remove references to ldapserver from makefiles; use BUILD_ROOT instead of ↵Rich Megginson2005-01-282-8/+7
| | | | MCOM_ROOT and NSROOT; BUILD_ROOT is now the ldapserver directory rather than its parent
* Moving NSCP Directory Server from DirectoryBranch to TRUNK, initial drop. ↵ldapserver7xcvsadm2005-01-2130-0/+8832
(foxworth)