summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Bug 630097 - (cov#15473) NULL dereference in ResHashCreate()Nathan Kinder2010-09-151-2/+2
| | | | | | | If there is a problem allocating pResHash, we jump to the error label. The error label then dereferences pResHash to do a deep free, but it doesn't check if pResHash is NULL first. We need to check if pResHash is NULL before dereferencing it.
* Bug 630097 - (cov#11964) Remove dead code from libaccessNathan Kinder2010-09-151-196/+0
| | | | | | | | The libaccess library has some dead functions it it. One of these functions was flagged as having a NULL pointer dereference issue by Coverity. The problem function is unused, so it should be removed. There are also a number of other unused functions in the same source file that should be removed.
* Bug 630097 - (cov#11946) NULL dereference in ResHashCreate()Nathan Kinder2010-09-151-1/+1
| | | | | | | | If we jump to the error label due to an error allocating memory for pResHash->treelist, we try to do a free of pResHash->treelist->vlist without checking if pResHash->treelist is NULL. We need to perform this NULL check before dereferencing pResHash->treelist.
* Bug 690090 - (cov#11974) Remove additional unused ACL functionsNathan Kinder2010-09-091-131/+0
| | | | | | There are a few more unused ACL functions to remove. One of these unused functions is causing coverity to report an error about memory corruption.
* Bug 630090 - (cov#11974) Remove unused ACL functionsNathan Kinder2010-09-092-644/+3
| | | | | | | | | | | | | Coverity flagged a memory corruption issue in an old unused ACL function. It is best to just remove these unused functions. The functions removed are: ACL_ParseFile ACL_WriteFile ACL_WriteString ACL_Decompose acl_to_str_* acl_decompose_*
* fix compiler warnings - unused vars/funcs, invalid castsRich Megginson2010-09-0111-345/+6
| | | | | | | | | 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-3/+18
| | | | | | | | | 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 ResHashCreate().
* 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 611790 - fix coverify Defect Type: Null pointer dereferences issues ↵Noriko Hosoi2010-08-231-4/+12
| | | | | | | | | | 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: Use the right pointer in LASIpAddPattern(). coverity ID: 11945
* Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues ↵Endi S. Dewata2010-08-231-8/+6
| | | | | | | | | 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 acl_usr_cache_insert().
* Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues ↵Endi S. Dewata2010-08-232-0/+7
| | | | | | | | | 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 LASDnsBuild().
* 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 coverity Defect Type: Resource leaks issues CID 12094 - 12136Noriko Hosoi2010-08-201-48/+0
| | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=616500 coverity ID 12135 Comment: Getting rid of unused functions fopen_l and fclose_l from lib/libadmin/util.c.
* Bug 616500 - fix coverity Defect Type: Resource leaks issues CID 12094 - 12136Noriko Hosoi2010-08-201-7/+10
| | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=616500 coverity ID 12131 Comment: ACL_AuthInfoSetDbname(lib/libaccess/register.cpp) -- free dbtype in the error cases.
* Bug 616500 - fix coverify Defect Type: Resource leaks issues CID 12094 - 12136Endi S. Dewata2010-08-201-5/+16
| | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=616500 Resolves: bug 616500 Bug description: fix coverify Defect Type: Resource leaks issues CID 12136 description: Fixed resource leaks in XP_MakeStringProperties().
* Bug 616500 - fix coverify Defect Type: Resource leaks issues CID 12094 - 12136Endi S. Dewata2010-08-201-0/+2
| | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=616500 Resolves: bug 616500 Bug description: fix coverify Defect Type: Resource leaks issues CID 12133, 12134 description: Fixed resource leaks in helpJavaScriptForTopic() and helpJavaScript().
* Bug 616500 - fix coverify Defect Type: Resource leaks issues CID 12094 - 12136Endi S. Dewata2010-08-201-0/+2
| | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=616500 Resolves: bug 616500 Bug description: fix coverify Defect Type: Resource leaks issues CID 12132 description: Fixed resource leaks in output_alert().
* 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 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053Endi S. Dewata2010-08-191-0/+2
| | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=619122 Resolves: bug 619122 Bug description: fix coverify Defect Type: Resource leaks issues CID 11976. description: The ACLEvalBuildContext() has been modified to release curauthplist when an error occurs.
* Bug 622903 - fix coverity Defect Type: Code maintainability issuesNoriko Hosoi2010-08-111-9/+23
| | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=622903 Comment: The result of PR_HashTableAdd() should be checked for NULL value. Applied the change to all the PR_HashTableAdd calls in this file lib/libaccess/register.cpp.
* 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-0738-4207/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=609255 12241 Triaged Unassigned Bug Minor Fix Required delete_acl_from_file(char *, char *…) ds/lib/libaccess/acltools.cpp 12242 UNINIT Triaged Unassigned Bug Minor Fix Required get_acl_from_file(char *, char *, ACLListHandle **…) ds/lib/libaccess/acltools.cpp 12243 UNINIT Triaged Unassigned Bug Minor Fix Required ACL_FileGetNameList() ds/lib/libaccess/acltools.cpp 12244 UNINIT Triaged Unassigned Bug Minor Fix Required ACL_FileGetNameList() ds/lib/libaccess/acltools.cpp 12245 UNINIT Triaged Unassigned Bug Minor Fix Required rename_acl_in_file(char *, char *, char *…) ds/lib/libaccess/acltools.cpp 12246 UNINIT Triaged Unassigned Bug Minor Fix Required append_acl_to_file(char *, char *, char *…) ds/lib/libaccess/acltools.cpp 12247 UNINIT Triaged Unassigned Bug Minor Fix Required append_acl_to_file(char *, char *, char *…) ds/lib/libaccess/acltools.cpp Comment: ACL_FileRenameAcl, ACL_FileDeleteAcl, ACL_FileGetAcl, ACL_FileSetAcl, ACL_FileMergeAcl, ACL_FileMergeFile and their helper functions are not used. These functions and their helper functions plus libaccess test programs under the directory ./utest are eliminated.
* 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
* 609255 - fix coverity Defect Type: Memory - illegal accesses issuesNoriko Hosoi2010-07-071-2/+6
| | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=609255 12300 USE_AFTER_FREE Triaged Unassigned Bug Minor Fix Required append_acl_to_file(char *, char *, char *…) ds/lib/libaccess/acltools.cpp Comment: this code is not used any more. The fix is to have open_file_buf set *buf to NULL after freeing
* Bug 611850 - fix coverity Defect Type: Error handling issuesRich Megginson2010-07-061-104/+0
| | | | | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=611850 Resolves: bug 611850 Bug Description: fix coverity Defect Type: Error handling issues Reviewed by: nhosoi (Thanks!) Branch: HEAD Fix Description: Check the error return from the functions. In some cases, I was able to figure out that the calling function should perform additional error handling (return early, goto error label), but in general the code just logs an appropriate error message and continues. I was able to get rid of some more libacl code. I removed an unused variable from modify.c Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no
* Bug 610276 - fix coverity Defect Type: API usage errors issuesRich Megginson2010-07-062-2/+9
| | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=610276 Resolves: bug 610276 Bug Description: fix coverity Defect Type: API usage errors issues Reviewed by: nhosoi (Thanks!) Branch: HEAD Fix Description: Must call va_end after calling va_start. Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no
* Bug 610177 - fix coverity Defect Type: Uninitialized variables issuesRich Megginson2010-07-061-1015/+0
| | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=610177 Resolves: bug 610177 Bug Description: fix coverity Defect Type: Uninitialized variables issues Reviewed by: nhosoi (Thanks!) Branch: HEAD Fix Description: Initialize variables to 0, NULL, or an appropriate error code. Got rid of the unused lexer code. Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no
* Bug 609590 - fix coverity Defect Type: Memory - corruptions issuesRich Megginson2010-07-011-0/+1
| | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=609590 Resolves: bug 609590 Bug Description: fix coverity Defect Type: Memory - corruptions issues Reviewed by: nhosoi (Thanks!) Branch: HEAD Fix Description: To avoid a potential double free, set ipaddrs to NULL after freeing it. Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no
* Bug 609590 - fix coverity Defect Type: Memory - corruptions issuesRich Megginson2010-07-011-1/+2
| | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=609590 Resolves: bug 609590 Bug Description: fix coverity Defect Type: Memory - corruptions issues Reviewed by: nhosoi (Thanks!) Branch: HEAD Fix Description: Do not allow pt->pt_sizendx to be == PLMAXSIZENDX Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no
* problems linking with -z defsRich Megginson2010-02-257-1276/+14
| | | | | | | | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=506206 Resolves: bug 506206 Bug Description: problems linking with -z defs Reviewed by: nhosoi (Thanks!) Branch: HEAD Fix Description: Some platforms (debian) and some build checking tools (rpmlint, others) link with -z defs to look for any undefined references at link time. We had several of these in various directory server objects. 1) all of the plugins need to link against libslapd.la 2) most of the plugins need to link against ldapcsdk and nspr 3) the pwdstorage plugin needs to link against LIBCRYPT, which is platform dependent 4) various other link fixes Platforms tested: RHEL5 x86_64 Flag Day: yes - autotool file changes Doc impact: no
* 518112 rhds 81 el53 64b ns-slapd seg faultNoriko Hosoi2009-09-232-14/+24
| | | | | | | | | | | | | | | | | | Fixing the contention over LAS_cookie. Considering the case 2 threads try to evaluate the IP/DNS aci almost at the same time, one comes in first and creates context in the critical section (between ACL_CritEnter and ACL_CritExit); another thread sees *LAS_cookie is non NULL and assumes the context is already made. But it could be half baked then since the second thread does not respect the critical section. This patch is putting the line assigning *LAS_cookie to context into the critical section, which prevents for the second thread to pick up the half baked *LAS_cookie. Fix proposed in the comment#19 by Rich Megginson is included, as well: Because what if *LAS_cookie is set to a valid value after the first if() test and before the call to ACL_CritEnter(); ? There is similar code in LASIpEval() too.
* Change default branding to 389 - remove lite codeRich Megginson2009-08-117-31/+31
| | | | | | | | | | | | | | | | | | | 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-0713-2820/+13
| | | | | | | | | | 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-0811-25/+23
| | | | | | | | | | | | | | | | | | | | | 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: #237040Noriko Hosoi2007-11-304-466/+0
| | | | | | | Summary: Remove obsolete makefiles Description: removing leftover makefiles in the lib directory ./lib/base/Makefile ./lib/libaccess/Makefile ./lib/libadmin/Makefile ./lib/libsi18n/Makefile
* Resolves: #188320Noriko Hosoi2007-10-189-111/+15
| | | | Summary: HP-UX: warnings reported by the HP-UX compiler
* Resolves: #237356Noriko Hosoi2007-04-271-225/+0
| | | | | Summary: Move DS Admin Code into Admin Server (Comment #9) Description: Cleaning up unused code
* Resolves: #237356Noriko Hosoi2007-04-271-2/+0
| | | | | | | Summary: Move DS Admin Code into Admin Server (Comment #4,#6) Description: .DSGW is already a separated module "dsgw"; Removing from ldapserver. .Removing the independency from lib/libsi18n/gsslapd.h
* Resolves: #237356Noriko Hosoi2007-04-277-1765/+0
| | | | | Summary: Move DS Admin Code into Admin Server (Comment #3) Description: Cleaning up NT code
* Resolves: #237040Noriko Hosoi2007-04-191-96/+0
| | | | Summary: Remove obsolete makefiles
* Resolves: #214533Noriko Hosoi2006-11-10110-0/+550
| | | | | | | | | | 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-6/+6
| | | | | Summary: Cleaning up obsolete macros in the build Changes: eliminated macro MCC_HTTPD (Comment #14)
* 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-105-55/+0
| | | | | Summary: Cleaning up obsolete macros in the build Changes: eliminated macro NSPR20 (Comment #8)
* Resolves: #214728Noriko Hosoi2006-11-101-8/+3
| | | | | Summary: Cleaning up obsolete macros in the build Changes: eliminated macro NET_SSL (Comment #5)
* Resolves: #214728Noriko Hosoi2006-11-101-2/+0
| | | | | Summary: Cleaning up obsolete macros in the build Changes: eliminated macro NS_DS (Comment #2, #3)
* Resolves: 214682Nathan Kinder2006-11-081-1/+1
| | | | Summary: Fixed usage of PL_strncpyz that was causing DNS-based ACIs to behave incorrectly.
* 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