summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* fix typos in Makefile.am, acctpolicy schemaacctpolicyRich Megginson2010-10-013-3/+3
| | | | Fixed some typos and copy/paste errors in Makefile.am and acctpolicy schema
* add support for global inactivity limitRich Megginson2010-10-013-8/+42
| | | | | | | | if the attribute accountInactivityLimit is specified in the global config entry cn=config,cn=Account Policy Plugin,cn=plugins,cn=config, it will be the default inactivity limit - if there is an account policy specified by acctPolicySubentry, that one will take precedence over the global policy
* do not register pre/post op plugins if disabledRich Megginson2010-10-011-0/+8
| | | | | | the main init function is responsible for looking to see if it is enabled and should not do any further processing, including registering the pre/post op plugins, if it is disabled
* fix pblock memory leakRich Megginson2010-10-011-28/+11
| | | | | acct_record_login() should use and destroy the pblock locally - it does not need to be passed in from the calling function
* add the account policy plugin and related server code, schema, and configRich Megginson2010-10-0124-21012/+32693
| | | | | | | | | | | Add the account policy plugin and related server code, schema, and config A new switch to configure has been added --enable-acctpolicy - this is enabled by default - so the plugin and the schema will be built and installed by default the plugin will be in dse.ldif, but will be disabled by default The original contribution had some minor problems with the schema and config entries - these have been cleaned up The original contribution had a few memory leaks - these have been cleaned up
* openldap ber_init will assert if the bv->bv_val is NULLRich Megginson2010-10-0112-13/+50
| | | | | | | | | | Have to ensure that all usage of ber_init in the server checks to see if the bv->bv_val is non-NULL before using ber_init, and return the appropriate error if it is NULL Also fixed a problem in dna_extend_exop - would not send the ldap result to the client in certain error conditions Reviewed by: nhosoi (Thanks!) Tested on: RHEL5 x86_64
* Bug 522055 - Scope check for managed attribute failsNathan Kinder2010-10-011-1/+2
| | | | | | | | | | | When using the linked attribute plug-in, an entry that is renamed that is outside of the scope of the plug-in will cause the forward links in other entries to be updated if they contain a managed attribute type. We need to check if the new DN of the renamed entry is within the scope of the configured linked attributes before updating forward links.
* Bug 635987 - Incorrect sub scope search result with ACL containing ldap:///selfNoriko Hosoi2010-09-241-5/+9
| | | | | | | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=635987 Description: This commit made for the bug 635987 introduced a bug to replication. commit 8ac525e5ac997378f4f2a386e9b96568c8d66db5 Author: Noriko Hosoi <nhosoi@redhat.com> Date: Tue Sep 21 15:12:07 2010 -0700 subtree_candidates (ldbm_search.c) If you do have a tombstone filter, descendants will be NULL, and idl_intersection of candidates and descendents will wipe out all of the candidates, leaving just the one entry, e->ep_id. Changed to call idl_intersection only when the filter is not for tombstone or entryrdn_get_noancestorid (false, by default).
* Bug 630091 - (cov#11973) Array overrun in libaccessNathan Kinder2010-09-241-4/+10
| | | | | | | | When going through the exceptions table in libaccess, we don't check if we are at the last pair of elements in the array before incrementing to the next pair. This patch adds checks to see if we are at the last pair of elements and avoids the increment if necessary.
* Bug 634561 - Server crushes when using Windows Sync AgreementRich Megginson2010-09-234-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=634561 Resolves: bug 634561 Bug Description: Server crushes when using Windows Sync Agreement Reviewed by: ??? Branch: master Fix Description: The regular replication protocol and the windows sync protocol have two completely different struct repl_connection. They are almost the same, almost identical fields, but they are different. When additional fields were added to the struct repl_connection, not at the end of the structure, and identical changes were not made to the struct repl_connection in windows_connection.c, the structures got out of sync. The authors tried to anticipate this condition by providing windows_ versions of all of the conn_ functions. We were not using the windows_ versions of these functions in all places in the winsync code. The fix is to use the windows_ versions of these functions throughout the winsync code, and to make the struct repl_connection the same size up through the char *plain field. If additional fields are added to either structure at the end, this problem should not occur in the future. Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no (cherry picked from commit 4bd78323d0bb1299a19e0ed1feebc79ff997c92f)
* Bug 606920 - anonymous resource limit- nstimelimit -Noriko Hosoi2010-09-221-12/+24
| | | | | | | | | | | also applied to "cn=directory manager" https://bugzilla.redhat.com/show_bug.cgi?id=606920 Description: Client side sizelimit / timelimit request should be honoured by the Directory Manager, too. Changing the time/ sizelimit evaluation so that if client side request exists, the value is set even if the bind user is the directory manager.
* Bug 635987 - Incorrect sub scope search result withNoriko Hosoi2010-09-211-6/+4
| | | | | | | | | | | | | ACL containing ldap:///self https://bugzilla.redhat.com/show_bug.cgi?id=635987 Description: When a basedn has no descendants, the code to take an intersection of idl (which was returned from the filter search -- filter_candidates) and the basedn was skipped in subtree_candidates (ldbm_search.c). Regardless of descendants, the intersection should be taken for the idl and a tree starting with the basedn. Note: This bug was introduced with entryrdn.
* Bug 630092 - Coverity #11992,11993: Resource leaks issuesEndi Sukma Dewata2010-09-201-0/+4
| | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=630092 Description: The acl_Parse() has been modified to release newacls and newaclv when an error occurs.
* 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#12068) Resource leak in certmap codeNathan Kinder2010-09-171-0/+1
| | | | | | The ldapu_propval_list_free() function was freeing the nodes in the list, but not the list itself. We need to free the list itself after all of the nodes have been freed.
* 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 630091 - (cov#12209) Use of uninitialized pointer in libaccessNathan Kinder2010-09-151-2/+1
| | | | | | | It looks like aclpvt is only initialized before use if __cplusplus or lint are defined. I see no harm in always initializing aclpvt to NULL, which will guarantee that we don't use an uninitialized pointer.
* 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#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#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.