summaryrefslogtreecommitdiffstats
path: root/ldap
Commit message (Collapse)AuthorAgeFilesLines
* Bug 630092 - Coverity #11985: Resource leaks issuesEndi Sukma Dewata2010-09-171-0/+1
| | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=630092 Description: The str2simple() has been modified to release unqstr when an error occurs.
* Bug 630092 - Coverity #12003: Resource leaks issuesEndi Sukma Dewata2010-09-171-0/+1
| | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=630092 Description: The cos_cache_add_defn() has been modified to release theDef when an error occurs.
* Bug 630092 - Coverity #12000: Resource leaks issuesEndi Sukma Dewata2010-09-171-2/+2
| | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=630092 Description: The plugin_setup() has been modified to release the value before it returns.
* Bug 630092 - Coverity #11991: Resource leaks issuesEndi Sukma Dewata2010-09-171-3/+1
| | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=630092 Description: The acllas__client_match_URL() has been modified to release the hostport before it returns.
* Bug 630092 - (cov#12105) Resource leak in pwdscheme config codeNathan Kinder2010-09-171-1/+1
| | | | | We don't free new_scheme if the password encode function is not set. We need to free new_scheme in this error case.
* Bug 630092 - (cov#12116) Resource leak in ldclt codeNathan Kinder2010-09-171-5/+13
| | | | | | There is a chance that we leak the memory pointed to by the new variable if we never have one of the ldclt contexts point to it. We need to jump to the error label in this case to free the memory.
* Bug 630092 - Coverity #15497: Resource leaks issuesEndi Sukma Dewata2010-09-171-0/+1
| | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=630092 Description: The moddn_rename_children() has been modified to release child_entry_copies before it returns.
* Bug 630092 - Coverity #15490: Resource leaks issuesEndi Sukma Dewata2010-09-171-0/+1
| | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=630092 Description: The import_producer() has been modified to release ep when an error occured.
* Bug 630092 - Coverity #15487: Resource leaks issuesEndi Sukma Dewata2010-09-171-0/+2
| | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=630092 Description: The index_set_entry_to_fifo() has been modified to release ep when the job is aborted.
* Bug 630092 - Coverity #15485: Resource leaks issuesEndi Sukma Dewata2010-09-171-0/+1
| | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=630092 Description: The _entryrdn_delete_key() has been modified to release tmpsrdn when an error occurs.
* Bug 630092 - Coverity #15484: Resource leaks issuesEndi Sukma Dewata2010-09-171-0/+1
| | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=630092 Description: The bulk_import_queue() has been modified to release ep when an error occurs.
* Bug 630092 - Coverity #15483: Resource leaks issuesEndi Sukma Dewata2010-09-171-0/+4
| | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=630092 Description: The _entryrdn_index_read() has been modified to release tmpsrdn when an error occurs.
* Bug 630092 - Coverity #15482: Resource leaks issuesEndi Sukma Dewata2010-09-171-0/+2
| | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=630092 Description: The windows_search_local_entry_by_uniqueid() has been modified to release the memory allocated for local_subtree.
* Bug 630092 - Coverity #15481: Resource leaks issuesEndi Sukma Dewata2010-09-171-4/+2
| | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=630092 Description: The acquire_replica() has been modified to release current_csn before it returns.
* Bug 630092 - Coverity #15479: Resource leaks issuesEndi Sukma Dewata2010-09-171-1/+8
| | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=630092 Description: The mep_pre_op() is correctly allocating and releasing smods during modify operation. However, the "else" clause on line 1517 theoretically allows other operations to enter and cause resource leak. The code has been modified to reject other operations from operating against the config entries.
* Bug 630092 - Coverity #15478: Resource leaks issuesEndi Sukma Dewata2010-09-171-3/+3
| | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=630092 Description: The mep_pre_op() has been modified to release config_copy before it goes out of scope by moving mep_free_config_entry() out of the switch statement.
* Bug 630092 - Coverity #12117: Resource leaks issuesEndi Sukma Dewata2010-09-171-1/+2
| | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=630092 Description: The putvalue() has been modified to release b64 using freeEnc64() before it returns.
* Bug 630097 - (cov#15477) NULL dereference in ACL plug-in codeNathan Kinder2010-09-151-0/+6
| | | | | | | | We need to check if aclpb is NULL before dereferencing it. The proper thing to do here is to make aclplugin_preop_common() return an error to the LDAP client and to return 1 since the whole purpose of this function is to initialize the aclpb. Doing this will avoid the NULL dereference.
* Bug 630097 - (cov#11938) NULL dereference in mmldifNathan Kinder2010-09-151-1/+1
| | | | | | There is a chance that a can be NULL, which we then dereference within the else block. We should not execute the else block if a is NULL.
* Bug 558099 - Enhancement request: Log more information about the search ↵Noriko Hosoi2010-09-159-3/+49
| | | | | | | | | | | | | | | | | result being a paged one https://bugzilla.redhat.com/show_bug.cgi?id=558099 Description: searched entry count is logged in the access log as (nentries=<num>). When RFC 2696 page results control is passed, the nentries logs the page size instead of the total searched count. andrey.ivanov@polytechnique.fr proposed to log the control info as follows: [..] conn=# op=#RESULT err=0 tag=101 nentries=# etime=0 notes=P This patch implemented the spec. Also, there was a bug regarding unindexed note "notes=U" when the paged results control is received. Only the first page logs it, but not the rest. The bug was fixed.
* Bug 625014 - SubTree Renames: ModRDN operation fails and the server hangs if ↵Noriko Hosoi2010-09-151-2/+46
| | | | | | | | | the entry is moved to "under" the same DN. https://bugzilla.redhat.com/show_bug.cgi?id=625014 Description: adding a check if the newsuperior is the entry itself or its descendent. If it is, modrdn returns LDAP_UNWILLING_TO_PERFORM.
* Bug 630097 - (cov#15509) NULL dereference in idsktuneNathan Kinder2010-09-151-0/+5
| | | | | | If strdup() fails, the cmd variable will be NULL. We dereference it without checking it strdup() was successful. We should check if cmd is NULL before dereferencing it.
* Bug 630097 - (cov#15507,15508) NULL dereference in entryrdn codeNathan Kinder2010-09-151-2/+5
| | | | | | | | In entryrdn_compare_dups(), we dereference the a and b parameters when initializing the elem_a and elem_b variables. We later perform NULL checks on both a and b, but a NULL would have triggered a crash. We should not dereference a or b until after the NULL checks are performed.
* Bug 630097 - (cov#15506) NULL dereference in dblayer codeNathan Kinder2010-09-151-4/+4
| | | | | | | | The first parameter of dblayer_set_env_debugging() is dereferenced inside of that function without NULL checking. We pass the env variable to this function without first checking if it is NULL. We should move the existing NULL check of env up to the top of the dblayer_copy_file_keybybey() function.
* Bug 630097 - (cov#15505) NULL dereference in memberOf codeNathan Kinder2010-09-151-1/+7
| | | | | | | | The config parameter is dereferenced before checking if it is NULL early in memberof_modop_one_replace_r(). Later in the function, we first check if config is NULL before dereferencing it. We should check if config is NULL at the beginning of the function and bail out before we dereference it.
* Bug 630097 - (cov#15465) Null dereference in USN codeNathan Kinder2010-09-151-1/+1
| | | | | | | At the end of the for loop, be will be NULL if we never find a valid be->be_usn_counter. This will cause us to dereference a NULL pointer at the next if statement after the for loop. We need to check if be is NULL before dereferencing it.
* Bug 630097 - (cov#15464) NULL dereference in repl codeNathan Kinder2010-09-151-1/+1
| | | | | | | | If the attr parameter that is passed to my_ber_scanf_attr() is NULL, we jump to the loser label where we clean up memory we may have allocated. We dereference attr without first checking if it is NULL in this clean-up code. We need to check if attr is NULL before dereferencing it.
* Bug 630097 - (cov#15463) Remove NULL check in referint pluginNathan Kinder2010-09-151-3/+1
| | | | | | | | | | | | Coverity believes that search_result_pb can be NULL since we check if it is NULL before freeing the internal search results. If this was true, there would be a NULL dereference issue when we call slapi_pblock_get(). We are guaranteed that search_result_pb is non-NULL after slapi_pblock_new() is called since the server would exit if it was unable to allocate memory. We should remove the NULL check before freeing the internal search results.
* Bug 630097 - (cov#15462) NULL dereference in mep_modrdn_post_op()Nathan Kinder2010-09-151-0/+1
| | | | | | | | | | | | | If we fail to fetch the postop entry for a modrdn operation in the Managed Entry Plug-in, we end up passing a NULL pointer to slapi_entry_attr_get_charptr(). This function dereferences the entry without checking if it is NULL first. The mep_modrdn_post_op() function should just return if we are unable to fetch the postop entry. I believe that this issue could trigger a crash when chain-on-update is configured and a modrdn operation is chained. There is no postop entry in this case.
* Bug 630097 - (cov#15461) Remove unnecessary NULL check in DNANathan Kinder2010-09-151-1/+1
| | | | | | | | It is not necessary to check if config_entry->types is NULL since it is guaranteed to be non-NULL by dna_parse_config_entry() when it creates config_entry. Coverity thinks that a NULL derefence is possible since we are checking if config_entry->types is NULL. We should remove this NULL check.
* Bug 630097 - (cov#15460) NULL deference in ACL URL codeNathan Kinder2010-09-151-2/+2
| | | | | | When parsing a URL without a host or port present, we can dereference a NULL pointer. We need to check if hostport is NULL before dereferencing it.
* Bug 630097 - (cov#12182,12183) NULL dereference in import codeNathan Kinder2010-09-151-2/+2
| | | | | | The entry pointer that is passed to slapi_entry_attr_find() is dereferenced by that function without a check for NULL. We should check if ep->ep_entry is NULL before calling slapi_entry_attr_find().
* Bug 630097 - (cov#12148) NULL dereference in ruvInit()Nathan Kinder2010-09-151-3/+5
| | | | | | We need to check if ruv is NULL before dereferencing it. The assertion will not help us here in an optimized build, so an explicit NULL check will keep us from crashing.
* Bug 630097 - (cov#12143) NULL dereference in cos cache codeNathan Kinder2010-09-151-2/+8
| | | | | The tmpDn pointer is deferenced before checking if it is NULL. We need to check if it is NULL first.
* Bug 630097 - (cov#11938) NULL dereference in mmldifNathan Kinder2010-09-151-1/+1
| | | | | | | There is a chance that we can deference a NULL pointer in the mmldif code. If "(numb > tot_b)" is true, it is not guaranteed that "a" is non-NULL. We need to check if "a" is NULL before dereferencing it in the "(cmp < 0)" case.
* 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 631862 - crash - delete entries not in cache + referintNoriko Hosoi2010-09-145-50/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=631862 Resolves: bug 631862 Bug Description: crash - delete entries not in cache + referint Reviewed by: rmeggins and nhosoi Branch: master Fix Description: When deleting an entry, the referential integrity (referint) plugin does an internal search to find references to this entry (e.g. in group entries) and removes them. The search code wants to ensure that the entrydn attribute is present in the entry when using entryrdn (subtree rename). The search code sets a flag to tell the id2entry code to add the entrydn attribute if it is not present. However, it was doing this to an entry in the cache, which may be in use by another thread. The solution is to add the entrydn attribute before adding the entry to the cache. In the id2entry code, this is after the entry has been read from the id2entry db successfully, but before the entry is added to the cache. In the LDAP ADD code, this is done when the other computed operational attributes are added to the new entry. In addition to the above fix by rmeggins@redhat.com, following changes are made: 1) entrydn attribute is always added to the entry in memory before putting it in the entry cache, and the attribute is removed before writing the entry to the database. 2) eliminating id2entry_ext, which was introduced to pass flags, but it is no longer needed since only a flag ID2ENTRY_ADD_ENTRYDN was removed. Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no
* Only check modrdn ops for backend/suffix correctness if not the default backendRich Megginson2010-09-131-2/+3
| | | | | | | | | | | | | | | | The function slapi_mapping_tree_select_and_check() is only called for modrdn operations, to make sure we are not attempting to rename a suffix or move an entry from one backend to another. This defeats datainterop plugins that may want to perform some other operation in these cases. If the target suffix/backend is not found, the default backend is used. If the default backend is being used, don't check for all errors, just allow the operation to pass through to the preop plugins. Need to make sure this doesn't cause problems if 1) null suffix is not used - entry really is bogus or doesn't exist 2) null suffix is being used but entry belongs to another null suffix or is really bogus Reviewed by: nhosoi (Thanks!) Tested on: Fedora 14 x86_64
* Bug 633168 - Share backend dbEnv with the replication changelogNoriko Hosoi2010-09-131-0/+29
| | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=633168 Description: previous commit was missing the upgrade script 81changelog.pl
* Bug 633168 - Share backend dbEnv with the replication changelogNoriko Hosoi2010-09-1324-1743/+775
| | | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=633168 Description: * cl5_api.c, cl5_api.h - fetches dbEnv from backend using slapi_back_get_info. - unused macros and DB helper functions and APIs are removed. * cl5_config.c - local changelog DB related config parameters are removed. * Added SLAPI_PLUGIN_BE_PRE_CLOSE_FN and SLAPI_PLUGIN_BE_POST_OPEN_FN to close changelog DB before dbEnv is closed and to open changelog DB after dbEnv is opened, respectively. * Added slapi APIs slapi_back_get_info and slapi_back_set_info to get/set the backend info. * back-ldbm - db2bak[.pl] and bak2db[.pl] backs up and restores the database files including changelog db. - changelog dir is backed up in <backupdir>/.repl_changelog_backup. - underlying implementation ldbm_back_get_info for slapi_back_get_info is added. * Added an upgrade script 81changelog.pl See also: http://directory.fedoraproject.org/wiki/Move_changelog
* agmtlist_shutdown (repl5_agmtlist.c) had an illegal access defect.Noriko Hosoi2010-09-131-3/+5
| | | | | | | Object ro is freed in objset_next_obj and next object is returned if any. After ro is released, it was used to get agreement data. This patch moves the location of objset_next_obj after the agreement data is retrieved.
* Bug 630091 - (cov#15582) Free of uninitialized pointer in attr_index_config()Nathan Kinder2010-09-131-1/+1
| | | | | | In attr_index_config(), if argc or argv are NULL, we jump to the done label. We then try to free attrs, but it was never initialized. We need to initialize attrs to NULL.
* Bug 630091 - (cov#15519) Initialize bervals in search_easter_egg()Nathan Kinder2010-09-131-2/+2
| | | | | In search_easter_egg(), we need to initialize the bervals before we pass them to slapi_ldif_parse_line().
* Bug 630091 - (cov#15516,15517) Initialize pointers before attempting to freeNathan Kinder2010-09-131-1/+2
| | | | | | | | If we encounter an error early in ldbm_instance_index_config_modify_callback(), we jump to the out label where we try to free origMatchingRules, but it may not be initialized. The same is true for origIndexTypes. We need to initialize these pointers to NULL.
* Bug 630091 - (cov#15515) Use of uninitialized array in index config codeNathan Kinder2010-09-131-1/+1
| | | | | | | | If we encounter an error early in ldbm_instance_index_config_modify_callback(), we jump to the out label where we free each element of the arglist array. This can happen without initializing the array. We need to initialize arglist before there is any chance to jump to the out label.
* Bug 630091 - (cov#15514) Initialize DBT in entryrdn_get_parent()Nathan Kinder2010-09-131-1/+3
| | | | | | | | In entryrdn_get_parent(), there is a DBT structure that we can use without initializing. If we goto the bail label, we try to free data.data, but data was never initialized. We should clear the memory used by data in the beginning of the function before we have an opportunity to goto bail.
* Bug 630091 - (cov#15513) Fix usage of uninitialized bervalsNathan Kinder2010-09-131-1/+2
| | | | | | We use some uninitialized bervals when the backend code calls slapi_ldif_parse_line(). We should be initializing the bervals to be empty.
* Bug 630091 - (cov#15512) Fix usage of uninitialized bervalsNathan Kinder2010-09-101-2/+2
| | | | | | When the server is built against MozLDAP, we use some uninitialized bervals when the backend code calls slapi_ldif_parse_line(). We should be initializing the bervals to be empty.
* Bug 630094 - (cov#15581) Add missing breaks in agt_mopen_stats()Nathan Kinder2010-09-091-1/+4
| | | | | | | | | | | The switch statements in agt_mopen_stats() are missing breaks to prevent falling through to the next case when the stats file is opened in read-only mode. This looks like it causes the stats file to get opened a second time in read/write mode when ldap-agent attempts to open it in read-only mode. This may leak file descriptors in ldap-agent. We need to add the proper break statements.
* Bug 630094 - (cov#15520) Fix unreachable code issue if perfctrs codeNathan Kinder2010-09-091-3/+4
| | | | | | | | | | | | | The final frees of priv->memory and priv will never be reached since the function returns prior to these calls. It looks as if an "error:" label was removed at some point, as the WIN32 code in this function has goto statements using that label, but the label is not defined. The fix is to add the "error:" label in ifdef blocks for WIN32 that calls the free of priv. The free of priv->memory is not necessary since WIN32 doesn't use it and non-WIN32 builds don't use the error label at all.