Hello community,

here is the log from the commit of package ldb for openSUSE:Factory checked in 
at 2020-05-29 21:13:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ldb (Old)
 and      /work/SRC/openSUSE:Factory/.ldb.new.3606 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ldb"

Fri May 29 21:13:13 2020 rev:49 rq:807782 version:2.1.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/ldb/ldb.changes  2020-05-01 11:08:21.907196580 
+0200
+++ /work/SRC/openSUSE:Factory/.ldb.new.3606/ldb.changes        2020-05-29 
21:13:17.190317666 +0200
@@ -1,0 +2,5 @@
+Wed May 20 14:05:18 UTC 2020 - David Mulder <david.mul...@suse.com>
+
+ldb: Bump version to 2.1.3; (bso#14330)
+
+-------------------------------------------------------------------

Old:
----
  ldb-2.1.2.tar.asc
  ldb-2.1.2.tar.gz

New:
----
  ldb-2.1.3.tar.asc
  ldb-2.1.3.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ldb.spec ++++++
--- /var/tmp/diff_new_pack.R83NvF/_old  2020-05-29 21:13:18.058320282 +0200
+++ /var/tmp/diff_new_pack.R83NvF/_new  2020-05-29 21:13:18.062320294 +0200
@@ -57,7 +57,7 @@
 %endif
 
 URL:            https://ldb.samba.org/
-Version:        2.1.2
+Version:        2.1.3
 Release:        0
 Summary:        An LDAP-like embedded database
 License:        LGPL-3.0-or-later

++++++ ldb-2.1.2.tar.gz -> ldb-2.1.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ldb-2.1.2/ABI/ldb-2.1.3.sigs 
new/ldb-2.1.3/ABI/ldb-2.1.3.sigs
--- old/ldb-2.1.2/ABI/ldb-2.1.3.sigs    1970-01-01 01:00:00.000000000 +0100
+++ new/ldb-2.1.3/ABI/ldb-2.1.3.sigs    2020-05-19 12:10:40.000000000 +0200
@@ -0,0 +1,283 @@
+ldb_add: int (struct ldb_context *, const struct ldb_message *)
+ldb_any_comparison: int (struct ldb_context *, void *, ldb_attr_handler_t, 
const struct ldb_val *, const struct ldb_val *)
+ldb_asprintf_errstring: void (struct ldb_context *, const char *, ...)
+ldb_attr_casefold: char *(TALLOC_CTX *, const char *)
+ldb_attr_dn: int (const char *)
+ldb_attr_in_list: int (const char * const *, const char *)
+ldb_attr_list_copy: const char **(TALLOC_CTX *, const char * const *)
+ldb_attr_list_copy_add: const char **(TALLOC_CTX *, const char * const *, 
const char *)
+ldb_base64_decode: int (char *)
+ldb_base64_encode: char *(TALLOC_CTX *, const char *, int)
+ldb_binary_decode: struct ldb_val (TALLOC_CTX *, const char *)
+ldb_binary_encode: char *(TALLOC_CTX *, struct ldb_val)
+ldb_binary_encode_string: char *(TALLOC_CTX *, const char *)
+ldb_build_add_req: int (struct ldb_request **, struct ldb_context *, 
TALLOC_CTX *, const struct ldb_message *, struct ldb_control **, void *, 
ldb_request_callback_t, struct ldb_request *)
+ldb_build_del_req: int (struct ldb_request **, struct ldb_context *, 
TALLOC_CTX *, struct ldb_dn *, struct ldb_control **, void *, 
ldb_request_callback_t, struct ldb_request *)
+ldb_build_extended_req: int (struct ldb_request **, struct ldb_context *, 
TALLOC_CTX *, const char *, void *, struct ldb_control **, void *, 
ldb_request_callback_t, struct ldb_request *)
+ldb_build_mod_req: int (struct ldb_request **, struct ldb_context *, 
TALLOC_CTX *, const struct ldb_message *, struct ldb_control **, void *, 
ldb_request_callback_t, struct ldb_request *)
+ldb_build_rename_req: int (struct ldb_request **, struct ldb_context *, 
TALLOC_CTX *, struct ldb_dn *, struct ldb_dn *, struct ldb_control **, void *, 
ldb_request_callback_t, struct ldb_request *)
+ldb_build_search_req: int (struct ldb_request **, struct ldb_context *, 
TALLOC_CTX *, struct ldb_dn *, enum ldb_scope, const char *, const char * const 
*, struct ldb_control **, void *, ldb_request_callback_t, struct ldb_request *)
+ldb_build_search_req_ex: int (struct ldb_request **, struct ldb_context *, 
TALLOC_CTX *, struct ldb_dn *, enum ldb_scope, struct ldb_parse_tree *, const 
char * const *, struct ldb_control **, void *, ldb_request_callback_t, struct 
ldb_request *)
+ldb_casefold: char *(struct ldb_context *, TALLOC_CTX *, const char *, size_t)
+ldb_casefold_default: char *(void *, TALLOC_CTX *, const char *, size_t)
+ldb_check_critical_controls: int (struct ldb_control **)
+ldb_comparison_binary: int (struct ldb_context *, void *, const struct ldb_val 
*, const struct ldb_val *)
+ldb_comparison_fold: int (struct ldb_context *, void *, const struct ldb_val 
*, const struct ldb_val *)
+ldb_connect: int (struct ldb_context *, const char *, unsigned int, const char 
**)
+ldb_control_to_string: char *(TALLOC_CTX *, const struct ldb_control *)
+ldb_controls_except_specified: struct ldb_control **(struct ldb_control **, 
TALLOC_CTX *, struct ldb_control *)
+ldb_debug: void (struct ldb_context *, enum ldb_debug_level, const char *, ...)
+ldb_debug_add: void (struct ldb_context *, const char *, ...)
+ldb_debug_end: void (struct ldb_context *, enum ldb_debug_level)
+ldb_debug_set: void (struct ldb_context *, enum ldb_debug_level, const char *, 
...)
+ldb_delete: int (struct ldb_context *, struct ldb_dn *)
+ldb_dn_add_base: bool (struct ldb_dn *, struct ldb_dn *)
+ldb_dn_add_base_fmt: bool (struct ldb_dn *, const char *, ...)
+ldb_dn_add_child: bool (struct ldb_dn *, struct ldb_dn *)
+ldb_dn_add_child_fmt: bool (struct ldb_dn *, const char *, ...)
+ldb_dn_add_child_val: bool (struct ldb_dn *, const char *, struct ldb_val)
+ldb_dn_alloc_casefold: char *(TALLOC_CTX *, struct ldb_dn *)
+ldb_dn_alloc_linearized: char *(TALLOC_CTX *, struct ldb_dn *)
+ldb_dn_canonical_ex_string: char *(TALLOC_CTX *, struct ldb_dn *)
+ldb_dn_canonical_string: char *(TALLOC_CTX *, struct ldb_dn *)
+ldb_dn_check_local: bool (struct ldb_module *, struct ldb_dn *)
+ldb_dn_check_special: bool (struct ldb_dn *, const char *)
+ldb_dn_compare: int (struct ldb_dn *, struct ldb_dn *)
+ldb_dn_compare_base: int (struct ldb_dn *, struct ldb_dn *)
+ldb_dn_copy: struct ldb_dn *(TALLOC_CTX *, struct ldb_dn *)
+ldb_dn_escape_value: char *(TALLOC_CTX *, struct ldb_val)
+ldb_dn_extended_add_syntax: int (struct ldb_context *, unsigned int, const 
struct ldb_dn_extended_syntax *)
+ldb_dn_extended_filter: void (struct ldb_dn *, const char * const *)
+ldb_dn_extended_syntax_by_name: const struct ldb_dn_extended_syntax *(struct 
ldb_context *, const char *)
+ldb_dn_from_ldb_val: struct ldb_dn *(TALLOC_CTX *, struct ldb_context *, const 
struct ldb_val *)
+ldb_dn_get_casefold: const char *(struct ldb_dn *)
+ldb_dn_get_comp_num: int (struct ldb_dn *)
+ldb_dn_get_component_name: const char *(struct ldb_dn *, unsigned int)
+ldb_dn_get_component_val: const struct ldb_val *(struct ldb_dn *, unsigned int)
+ldb_dn_get_extended_comp_num: int (struct ldb_dn *)
+ldb_dn_get_extended_component: const struct ldb_val *(struct ldb_dn *, const 
char *)
+ldb_dn_get_extended_linearized: char *(TALLOC_CTX *, struct ldb_dn *, int)
+ldb_dn_get_ldb_context: struct ldb_context *(struct ldb_dn *)
+ldb_dn_get_linearized: const char *(struct ldb_dn *)
+ldb_dn_get_parent: struct ldb_dn *(TALLOC_CTX *, struct ldb_dn *)
+ldb_dn_get_rdn_name: const char *(struct ldb_dn *)
+ldb_dn_get_rdn_val: const struct ldb_val *(struct ldb_dn *)
+ldb_dn_has_extended: bool (struct ldb_dn *)
+ldb_dn_is_null: bool (struct ldb_dn *)
+ldb_dn_is_special: bool (struct ldb_dn *)
+ldb_dn_is_valid: bool (struct ldb_dn *)
+ldb_dn_map_local: struct ldb_dn *(struct ldb_module *, void *, struct ldb_dn *)
+ldb_dn_map_rebase_remote: struct ldb_dn *(struct ldb_module *, void *, struct 
ldb_dn *)
+ldb_dn_map_remote: struct ldb_dn *(struct ldb_module *, void *, struct ldb_dn 
*)
+ldb_dn_minimise: bool (struct ldb_dn *)
+ldb_dn_new: struct ldb_dn *(TALLOC_CTX *, struct ldb_context *, const char *)
+ldb_dn_new_fmt: struct ldb_dn *(TALLOC_CTX *, struct ldb_context *, const char 
*, ...)
+ldb_dn_remove_base_components: bool (struct ldb_dn *, unsigned int)
+ldb_dn_remove_child_components: bool (struct ldb_dn *, unsigned int)
+ldb_dn_remove_extended_components: void (struct ldb_dn *)
+ldb_dn_replace_components: bool (struct ldb_dn *, struct ldb_dn *)
+ldb_dn_set_component: int (struct ldb_dn *, int, const char *, const struct 
ldb_val)
+ldb_dn_set_extended_component: int (struct ldb_dn *, const char *, const 
struct ldb_val *)
+ldb_dn_update_components: int (struct ldb_dn *, const struct ldb_dn *)
+ldb_dn_validate: bool (struct ldb_dn *)
+ldb_dump_results: void (struct ldb_context *, struct ldb_result *, FILE *)
+ldb_error_at: int (struct ldb_context *, int, const char *, const char *, int)
+ldb_errstring: const char *(struct ldb_context *)
+ldb_extended: int (struct ldb_context *, const char *, void *, struct 
ldb_result **)
+ldb_extended_default_callback: int (struct ldb_request *, struct ldb_reply *)
+ldb_filter_attrs: int (struct ldb_context *, const struct ldb_message *, const 
char * const *, struct ldb_message *)
+ldb_filter_from_tree: char *(TALLOC_CTX *, const struct ldb_parse_tree *)
+ldb_get_config_basedn: struct ldb_dn *(struct ldb_context *)
+ldb_get_create_perms: unsigned int (struct ldb_context *)
+ldb_get_default_basedn: struct ldb_dn *(struct ldb_context *)
+ldb_get_event_context: struct tevent_context *(struct ldb_context *)
+ldb_get_flags: unsigned int (struct ldb_context *)
+ldb_get_opaque: void *(struct ldb_context *, const char *)
+ldb_get_root_basedn: struct ldb_dn *(struct ldb_context *)
+ldb_get_schema_basedn: struct ldb_dn *(struct ldb_context *)
+ldb_global_init: int (void)
+ldb_handle_get_event_context: struct tevent_context *(struct ldb_handle *)
+ldb_handle_new: struct ldb_handle *(TALLOC_CTX *, struct ldb_context *)
+ldb_handle_use_global_event_context: void (struct ldb_handle *)
+ldb_handler_copy: int (struct ldb_context *, void *, const struct ldb_val *, 
struct ldb_val *)
+ldb_handler_fold: int (struct ldb_context *, void *, const struct ldb_val *, 
struct ldb_val *)
+ldb_init: struct ldb_context *(TALLOC_CTX *, struct tevent_context *)
+ldb_ldif_message_redacted_string: char *(struct ldb_context *, TALLOC_CTX *, 
enum ldb_changetype, const struct ldb_message *)
+ldb_ldif_message_string: char *(struct ldb_context *, TALLOC_CTX *, enum 
ldb_changetype, const struct ldb_message *)
+ldb_ldif_parse_modrdn: int (struct ldb_context *, const struct ldb_ldif *, 
TALLOC_CTX *, struct ldb_dn **, struct ldb_dn **, bool *, struct ldb_dn **, 
struct ldb_dn **)
+ldb_ldif_read: struct ldb_ldif *(struct ldb_context *, int (*)(void *), void *)
+ldb_ldif_read_file: struct ldb_ldif *(struct ldb_context *, FILE *)
+ldb_ldif_read_file_state: struct ldb_ldif *(struct ldb_context *, struct 
ldif_read_file_state *)
+ldb_ldif_read_free: void (struct ldb_context *, struct ldb_ldif *)
+ldb_ldif_read_string: struct ldb_ldif *(struct ldb_context *, const char **)
+ldb_ldif_write: int (struct ldb_context *, int (*)(void *, const char *, ...), 
void *, const struct ldb_ldif *)
+ldb_ldif_write_file: int (struct ldb_context *, FILE *, const struct ldb_ldif 
*)
+ldb_ldif_write_redacted_trace_string: char *(struct ldb_context *, TALLOC_CTX 
*, const struct ldb_ldif *)
+ldb_ldif_write_string: char *(struct ldb_context *, TALLOC_CTX *, const struct 
ldb_ldif *)
+ldb_load_modules: int (struct ldb_context *, const char **)
+ldb_map_add: int (struct ldb_module *, struct ldb_request *)
+ldb_map_delete: int (struct ldb_module *, struct ldb_request *)
+ldb_map_init: int (struct ldb_module *, const struct ldb_map_attribute *, 
const struct ldb_map_objectclass *, const char * const *, const char *, const 
char *)
+ldb_map_modify: int (struct ldb_module *, struct ldb_request *)
+ldb_map_rename: int (struct ldb_module *, struct ldb_request *)
+ldb_map_search: int (struct ldb_module *, struct ldb_request *)
+ldb_match_message: int (struct ldb_context *, const struct ldb_message *, 
const struct ldb_parse_tree *, enum ldb_scope, bool *)
+ldb_match_msg: int (struct ldb_context *, const struct ldb_message *, const 
struct ldb_parse_tree *, struct ldb_dn *, enum ldb_scope)
+ldb_match_msg_error: int (struct ldb_context *, const struct ldb_message *, 
const struct ldb_parse_tree *, struct ldb_dn *, enum ldb_scope, bool *)
+ldb_match_msg_objectclass: int (const struct ldb_message *, const char *)
+ldb_mod_register_control: int (struct ldb_module *, const char *)
+ldb_modify: int (struct ldb_context *, const struct ldb_message *)
+ldb_modify_default_callback: int (struct ldb_request *, struct ldb_reply *)
+ldb_module_call_chain: char *(struct ldb_request *, TALLOC_CTX *)
+ldb_module_connect_backend: int (struct ldb_context *, const char *, const 
char **, struct ldb_module **)
+ldb_module_done: int (struct ldb_request *, struct ldb_control **, struct 
ldb_extended *, int)
+ldb_module_flags: uint32_t (struct ldb_context *)
+ldb_module_get_ctx: struct ldb_context *(struct ldb_module *)
+ldb_module_get_name: const char *(struct ldb_module *)
+ldb_module_get_ops: const struct ldb_module_ops *(struct ldb_module *)
+ldb_module_get_private: void *(struct ldb_module *)
+ldb_module_init_chain: int (struct ldb_context *, struct ldb_module *)
+ldb_module_load_list: int (struct ldb_context *, const char **, struct 
ldb_module *, struct ldb_module **)
+ldb_module_new: struct ldb_module *(TALLOC_CTX *, struct ldb_context *, const 
char *, const struct ldb_module_ops *)
+ldb_module_next: struct ldb_module *(struct ldb_module *)
+ldb_module_popt_options: struct poptOption **(struct ldb_context *)
+ldb_module_send_entry: int (struct ldb_request *, struct ldb_message *, struct 
ldb_control **)
+ldb_module_send_referral: int (struct ldb_request *, char *)
+ldb_module_set_next: void (struct ldb_module *, struct ldb_module *)
+ldb_module_set_private: void (struct ldb_module *, void *)
+ldb_modules_hook: int (struct ldb_context *, enum ldb_module_hook_type)
+ldb_modules_list_from_string: const char **(struct ldb_context *, TALLOC_CTX 
*, const char *)
+ldb_modules_load: int (const char *, const char *)
+ldb_msg_add: int (struct ldb_message *, const struct ldb_message_element *, 
int)
+ldb_msg_add_empty: int (struct ldb_message *, const char *, int, struct 
ldb_message_element **)
+ldb_msg_add_fmt: int (struct ldb_message *, const char *, const char *, ...)
+ldb_msg_add_linearized_dn: int (struct ldb_message *, const char *, struct 
ldb_dn *)
+ldb_msg_add_steal_string: int (struct ldb_message *, const char *, char *)
+ldb_msg_add_steal_value: int (struct ldb_message *, const char *, struct 
ldb_val *)
+ldb_msg_add_string: int (struct ldb_message *, const char *, const char *)
+ldb_msg_add_value: int (struct ldb_message *, const char *, const struct 
ldb_val *, struct ldb_message_element **)
+ldb_msg_canonicalize: struct ldb_message *(struct ldb_context *, const struct 
ldb_message *)
+ldb_msg_check_string_attribute: int (const struct ldb_message *, const char *, 
const char *)
+ldb_msg_copy: struct ldb_message *(TALLOC_CTX *, const struct ldb_message *)
+ldb_msg_copy_attr: int (struct ldb_message *, const char *, const char *)
+ldb_msg_copy_shallow: struct ldb_message *(TALLOC_CTX *, const struct 
ldb_message *)
+ldb_msg_diff: struct ldb_message *(struct ldb_context *, struct ldb_message *, 
struct ldb_message *)
+ldb_msg_difference: int (struct ldb_context *, TALLOC_CTX *, struct 
ldb_message *, struct ldb_message *, struct ldb_message **)
+ldb_msg_element_compare: int (struct ldb_message_element *, struct 
ldb_message_element *)
+ldb_msg_element_compare_name: int (struct ldb_message_element *, struct 
ldb_message_element *)
+ldb_msg_element_equal_ordered: bool (const struct ldb_message_element *, const 
struct ldb_message_element *)
+ldb_msg_find_attr_as_bool: int (const struct ldb_message *, const char *, int)
+ldb_msg_find_attr_as_dn: struct ldb_dn *(struct ldb_context *, TALLOC_CTX *, 
const struct ldb_message *, const char *)
+ldb_msg_find_attr_as_double: double (const struct ldb_message *, const char *, 
double)
+ldb_msg_find_attr_as_int: int (const struct ldb_message *, const char *, int)
+ldb_msg_find_attr_as_int64: int64_t (const struct ldb_message *, const char *, 
int64_t)
+ldb_msg_find_attr_as_string: const char *(const struct ldb_message *, const 
char *, const char *)
+ldb_msg_find_attr_as_uint: unsigned int (const struct ldb_message *, const 
char *, unsigned int)
+ldb_msg_find_attr_as_uint64: uint64_t (const struct ldb_message *, const char 
*, uint64_t)
+ldb_msg_find_common_values: int (struct ldb_context *, TALLOC_CTX *, struct 
ldb_message_element *, struct ldb_message_element *, uint32_t)
+ldb_msg_find_duplicate_val: int (struct ldb_context *, TALLOC_CTX *, const 
struct ldb_message_element *, struct ldb_val **, uint32_t)
+ldb_msg_find_element: struct ldb_message_element *(const struct ldb_message *, 
const char *)
+ldb_msg_find_ldb_val: const struct ldb_val *(const struct ldb_message *, const 
char *)
+ldb_msg_find_val: struct ldb_val *(const struct ldb_message_element *, struct 
ldb_val *)
+ldb_msg_new: struct ldb_message *(TALLOC_CTX *)
+ldb_msg_normalize: int (struct ldb_context *, TALLOC_CTX *, const struct 
ldb_message *, struct ldb_message **)
+ldb_msg_remove_attr: void (struct ldb_message *, const char *)
+ldb_msg_remove_element: void (struct ldb_message *, struct ldb_message_element 
*)
+ldb_msg_rename_attr: int (struct ldb_message *, const char *, const char *)
+ldb_msg_sanity_check: int (struct ldb_context *, const struct ldb_message *)
+ldb_msg_sort_elements: void (struct ldb_message *)
+ldb_next_del_trans: int (struct ldb_module *)
+ldb_next_end_trans: int (struct ldb_module *)
+ldb_next_init: int (struct ldb_module *)
+ldb_next_prepare_commit: int (struct ldb_module *)
+ldb_next_read_lock: int (struct ldb_module *)
+ldb_next_read_unlock: int (struct ldb_module *)
+ldb_next_remote_request: int (struct ldb_module *, struct ldb_request *)
+ldb_next_request: int (struct ldb_module *, struct ldb_request *)
+ldb_next_start_trans: int (struct ldb_module *)
+ldb_op_default_callback: int (struct ldb_request *, struct ldb_reply *)
+ldb_options_copy: const char **(TALLOC_CTX *, const char **)
+ldb_options_find: const char *(struct ldb_context *, const char **, const char 
*)
+ldb_options_get: const char **(struct ldb_context *)
+ldb_pack_data: int (struct ldb_context *, const struct ldb_message *, struct 
ldb_val *, uint32_t)
+ldb_parse_control_from_string: struct ldb_control *(struct ldb_context *, 
TALLOC_CTX *, const char *)
+ldb_parse_control_strings: struct ldb_control **(struct ldb_context *, 
TALLOC_CTX *, const char **)
+ldb_parse_tree: struct ldb_parse_tree *(TALLOC_CTX *, const char *)
+ldb_parse_tree_attr_replace: void (struct ldb_parse_tree *, const char *, 
const char *)
+ldb_parse_tree_copy_shallow: struct ldb_parse_tree *(TALLOC_CTX *, const 
struct ldb_parse_tree *)
+ldb_parse_tree_walk: int (struct ldb_parse_tree *, int (*)(struct 
ldb_parse_tree *, void *), void *)
+ldb_qsort: void (void * const, size_t, size_t, void *, ldb_qsort_cmp_fn_t)
+ldb_register_backend: int (const char *, ldb_connect_fn, bool)
+ldb_register_extended_match_rule: int (struct ldb_context *, const struct 
ldb_extended_match_rule *)
+ldb_register_hook: int (ldb_hook_fn)
+ldb_register_module: int (const struct ldb_module_ops *)
+ldb_rename: int (struct ldb_context *, struct ldb_dn *, struct ldb_dn *)
+ldb_reply_add_control: int (struct ldb_reply *, const char *, bool, void *)
+ldb_reply_get_control: struct ldb_control *(struct ldb_reply *, const char *)
+ldb_req_get_custom_flags: uint32_t (struct ldb_request *)
+ldb_req_is_untrusted: bool (struct ldb_request *)
+ldb_req_location: const char *(struct ldb_request *)
+ldb_req_mark_trusted: void (struct ldb_request *)
+ldb_req_mark_untrusted: void (struct ldb_request *)
+ldb_req_set_custom_flags: void (struct ldb_request *, uint32_t)
+ldb_req_set_location: void (struct ldb_request *, const char *)
+ldb_request: int (struct ldb_context *, struct ldb_request *)
+ldb_request_add_control: int (struct ldb_request *, const char *, bool, void *)
+ldb_request_done: int (struct ldb_request *, int)
+ldb_request_get_control: struct ldb_control *(struct ldb_request *, const char 
*)
+ldb_request_get_status: int (struct ldb_request *)
+ldb_request_replace_control: int (struct ldb_request *, const char *, bool, 
void *)
+ldb_request_set_state: void (struct ldb_request *, int)
+ldb_reset_err_string: void (struct ldb_context *)
+ldb_save_controls: int (struct ldb_control *, struct ldb_request *, struct 
ldb_control ***)
+ldb_schema_attribute_add: int (struct ldb_context *, const char *, unsigned 
int, const char *)
+ldb_schema_attribute_add_with_syntax: int (struct ldb_context *, const char *, 
unsigned int, const struct ldb_schema_syntax *)
+ldb_schema_attribute_by_name: const struct ldb_schema_attribute *(struct 
ldb_context *, const char *)
+ldb_schema_attribute_fill_with_syntax: int (struct ldb_context *, TALLOC_CTX 
*, const char *, unsigned int, const struct ldb_schema_syntax *, struct 
ldb_schema_attribute *)
+ldb_schema_attribute_remove: void (struct ldb_context *, const char *)
+ldb_schema_attribute_remove_flagged: void (struct ldb_context *, unsigned int)
+ldb_schema_attribute_set_override_handler: void (struct ldb_context *, 
ldb_attribute_handler_override_fn_t, void *)
+ldb_schema_set_override_GUID_index: void (struct ldb_context *, const char *, 
const char *)
+ldb_schema_set_override_indexlist: void (struct ldb_context *, bool)
+ldb_search: int (struct ldb_context *, TALLOC_CTX *, struct ldb_result **, 
struct ldb_dn *, enum ldb_scope, const char * const *, const char *, ...)
+ldb_search_default_callback: int (struct ldb_request *, struct ldb_reply *)
+ldb_sequence_number: int (struct ldb_context *, enum ldb_sequence_type, 
uint64_t *)
+ldb_set_create_perms: void (struct ldb_context *, unsigned int)
+ldb_set_debug: int (struct ldb_context *, void (*)(void *, enum 
ldb_debug_level, const char *, va_list), void *)
+ldb_set_debug_stderr: int (struct ldb_context *)
+ldb_set_default_dns: void (struct ldb_context *)
+ldb_set_errstring: void (struct ldb_context *, const char *)
+ldb_set_event_context: void (struct ldb_context *, struct tevent_context *)
+ldb_set_flags: void (struct ldb_context *, unsigned int)
+ldb_set_modules_dir: void (struct ldb_context *, const char *)
+ldb_set_opaque: int (struct ldb_context *, const char *, void *)
+ldb_set_require_private_event_context: void (struct ldb_context *)
+ldb_set_timeout: int (struct ldb_context *, struct ldb_request *, int)
+ldb_set_timeout_from_prev_req: int (struct ldb_context *, struct ldb_request 
*, struct ldb_request *)
+ldb_set_utf8_default: void (struct ldb_context *)
+ldb_set_utf8_fns: void (struct ldb_context *, void *, char *(*)(void *, void 
*, const char *, size_t))
+ldb_setup_wellknown_attributes: int (struct ldb_context *)
+ldb_should_b64_encode: int (struct ldb_context *, const struct ldb_val *)
+ldb_standard_syntax_by_name: const struct ldb_schema_syntax *(struct 
ldb_context *, const char *)
+ldb_strerror: const char *(int)
+ldb_string_to_time: time_t (const char *)
+ldb_string_utc_to_time: time_t (const char *)
+ldb_timestring: char *(TALLOC_CTX *, time_t)
+ldb_timestring_utc: char *(TALLOC_CTX *, time_t)
+ldb_transaction_cancel: int (struct ldb_context *)
+ldb_transaction_cancel_noerr: int (struct ldb_context *)
+ldb_transaction_commit: int (struct ldb_context *)
+ldb_transaction_prepare_commit: int (struct ldb_context *)
+ldb_transaction_start: int (struct ldb_context *)
+ldb_unpack_data: int (struct ldb_context *, const struct ldb_val *, struct 
ldb_message *)
+ldb_unpack_data_flags: int (struct ldb_context *, const struct ldb_val *, 
struct ldb_message *, unsigned int)
+ldb_unpack_get_format: int (const struct ldb_val *, uint32_t *)
+ldb_val_dup: struct ldb_val (TALLOC_CTX *, const struct ldb_val *)
+ldb_val_equal_exact: int (const struct ldb_val *, const struct ldb_val *)
+ldb_val_map_local: struct ldb_val (struct ldb_module *, void *, const struct 
ldb_map_attribute *, const struct ldb_val *)
+ldb_val_map_remote: struct ldb_val (struct ldb_module *, void *, const struct 
ldb_map_attribute *, const struct ldb_val *)
+ldb_val_string_cmp: int (const struct ldb_val *, const char *)
+ldb_val_to_time: int (const struct ldb_val *, time_t *)
+ldb_valid_attr_name: int (const char *)
+ldb_vdebug: void (struct ldb_context *, enum ldb_debug_level, const char *, 
va_list)
+ldb_wait: int (struct ldb_handle *, enum ldb_wait_type)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ldb-2.1.2/ABI/pyldb-util-2.1.3.sigs 
new/ldb-2.1.3/ABI/pyldb-util-2.1.3.sigs
--- old/ldb-2.1.2/ABI/pyldb-util-2.1.3.sigs     1970-01-01 01:00:00.000000000 
+0100
+++ new/ldb-2.1.3/ABI/pyldb-util-2.1.3.sigs     2020-05-19 12:10:40.000000000 
+0200
@@ -0,0 +1,3 @@
+pyldb_Dn_FromDn: PyObject *(struct ldb_dn *)
+pyldb_Object_AsDn: bool (TALLOC_CTX *, PyObject *, struct ldb_context *, 
struct ldb_dn **)
+pyldb_check_type: bool (PyObject *, const char *)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ldb-2.1.2/ldb_mdb/ldb_mdb.c 
new/ldb-2.1.3/ldb_mdb/ldb_mdb.c
--- old/ldb-2.1.2/ldb_mdb/ldb_mdb.c     2020-01-31 11:25:36.000000000 +0100
+++ new/ldb-2.1.3/ldb_mdb/ldb_mdb.c     2020-05-19 12:10:40.000000000 +0200
@@ -641,6 +641,23 @@
                return LDB_ERR_PROTOCOL_ERROR;
        }
 
+       /*
+        * Clear out any stale readers
+        */
+       {
+               int stale = 0;
+               mdb_reader_check(lmdb->env, &stale);
+               if (stale > 0) {
+                       ldb_debug(
+                               lmdb->ldb,
+                               LDB_DEBUG_ERROR,
+                               "LMDB Stale readers, deleted (%d)",
+                               stale);
+               }
+       }
+
+
+
        ltx_head = lmdb_private_trans_head(lmdb);
 
        tx_parent = lmdb_trans_get_tx(ltx_head);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ldb-2.1.2/tests/ldb_lmdb_free_list_test.c 
new/ldb-2.1.3/tests/ldb_lmdb_free_list_test.c
--- old/ldb-2.1.2/tests/ldb_lmdb_free_list_test.c       1970-01-01 
01:00:00.000000000 +0100
+++ new/ldb-2.1.3/tests/ldb_lmdb_free_list_test.c       2020-05-19 
12:10:40.000000000 +0200
@@ -0,0 +1,661 @@
+/*
+ * Copyright (C) Catalyst.Net Ltd 2020
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+/*
+ * Tests confirming lmdb's handling of the free space list in the presence
+ * of active and stale readers.  A stale reader is a process that opens a
+ * read lock and then exits without releasing the lock.
+ *
+ * lmdb uses MVCC to maintain databased consistency, new copies of updated
+ * records are written to the database. The old entries are only
+ * reused when they are no longer referenced in a read transaction.
+ *
+ * The tests all update a single record multiple times
+ *
+ * If there is a read transaction or a stale reader lmdb will report
+ * out of space.
+ *
+ * If no read transaction and no stale reader, lmdb reclaims space from the
+ * free list.
+ */
+
+/*
+ * from cmocka.c:
+ * These headers or their equivalents should be included prior to
+ * including
+ * this header file.
+ *
+ * #include <stdarg.h>
+ * #include <stddef.h>
+ * #include <setjmp.h>
+ *
+ * This allows test applications to use custom definitions of C standard
+ * library functions and types.
+ *
+ */
+
+#include <stdarg.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <setjmp.h>
+#include <cmocka.h>
+
+#include <errno.h>
+#include <unistd.h>
+#include <talloc.h>
+#include <tevent.h>
+#include <ldb.h>
+#include <ldb_module.h>
+#include <ldb_private.h>
+#include <string.h>
+#include <ctype.h>
+
+#include <sys/wait.h>
+
+#include "ldb_tdb/ldb_tdb.h"
+#include "ldb_key_value/ldb_kv.h"
+
+#define DEFAULT_BE "mdb"
+
+#ifndef TEST_BE
+#define TEST_BE DEFAULT_BE
+#endif /* TEST_BE */
+
+const int RECORD_SIZE = 6144;
+const int ITERATIONS = 3;
+
+struct test_ctx {
+       struct tevent_context *ev;
+       struct ldb_context *ldb;
+
+       const char *dbfile;
+       const char *lockfile; /* lockfile is separate */
+
+       const char *dbpath;
+};
+
+static void unlink_old_db(struct test_ctx *test_ctx)
+{
+       int ret;
+
+       errno = 0;
+       ret = unlink(test_ctx->lockfile);
+       if (ret == -1 && errno != ENOENT) {
+               fail();
+       }
+
+       errno = 0;
+       ret = unlink(test_ctx->dbfile);
+       if (ret == -1 && errno != ENOENT) {
+               fail();
+       }
+}
+
+static int noconn_setup(void **state)
+{
+       struct test_ctx *test_ctx;
+
+       test_ctx = talloc_zero(NULL, struct test_ctx);
+       assert_non_null(test_ctx);
+
+       test_ctx->ev = tevent_context_init(test_ctx);
+       assert_non_null(test_ctx->ev);
+
+       test_ctx->ldb = ldb_init(test_ctx, test_ctx->ev);
+       assert_non_null(test_ctx->ldb);
+
+       test_ctx->dbfile = talloc_strdup(test_ctx, "lmdb_free_list_test.ldb");
+       assert_non_null(test_ctx->dbfile);
+
+       test_ctx->lockfile =
+           talloc_asprintf(test_ctx, "%s-lock", test_ctx->dbfile);
+       assert_non_null(test_ctx->lockfile);
+
+       test_ctx->dbpath =
+           talloc_asprintf(test_ctx, TEST_BE "://%s", test_ctx->dbfile);
+       assert_non_null(test_ctx->dbpath);
+
+       unlink_old_db(test_ctx);
+       *state = test_ctx;
+       return 0;
+}
+
+static int noconn_teardown(void **state)
+{
+       struct test_ctx *test_ctx =
+           talloc_get_type_abort(*state, struct test_ctx);
+
+       unlink_old_db(test_ctx);
+       talloc_free(test_ctx);
+       return 0;
+}
+
+static int setup(void **state)
+{
+       struct test_ctx *test_ctx;
+       int ret;
+       struct ldb_ldif *ldif;
+       const char *index_ldif = "dn: @INDEXLIST\n"
+                                "@IDXGUID: objectUUID\n"
+                                "@IDX_DN_GUID: GUID\n"
+                                "\n";
+       /*
+        * Use a 64KiB DB for this test
+        */
+       const char *options[] = {"lmdb_env_size:65536", NULL};
+
+       noconn_setup((void **)&test_ctx);
+
+       ret = ldb_connect(test_ctx->ldb, test_ctx->dbpath, 0, options);
+       assert_int_equal(ret, 0);
+
+       while ((ldif = ldb_ldif_read_string(test_ctx->ldb, &index_ldif))) {
+               ret = ldb_add(test_ctx->ldb, ldif->msg);
+               assert_int_equal(ret, LDB_SUCCESS);
+       }
+       *state = test_ctx;
+       return 0;
+}
+
+static int teardown(void **state)
+{
+       struct test_ctx *test_ctx =
+           talloc_get_type_abort(*state, struct test_ctx);
+       noconn_teardown((void **)&test_ctx);
+       return 0;
+}
+
+static struct ldb_kv_private *get_ldb_kv(struct ldb_context *ldb)
+{
+       void *data = NULL;
+       struct ldb_kv_private *ldb_kv = NULL;
+
+       data = ldb_module_get_private(ldb->modules);
+       assert_non_null(data);
+
+       ldb_kv = talloc_get_type(data, struct ldb_kv_private);
+       assert_non_null(ldb_kv);
+
+       return ldb_kv;
+}
+
+static int parse(struct ldb_val key, struct ldb_val data, void *private_data)
+{
+       struct ldb_val *read = private_data;
+
+       /* Yes, we leak this.  That is OK */
+       read->data = talloc_size(NULL, data.length);
+       assert_non_null(read->data);
+
+       memcpy(read->data, data.data, data.length);
+       read->length = data.length;
+       return LDB_SUCCESS;
+}
+
+/*
+ * This test has the same structure as the test_free_list_read_lock
+ * except the parent process does not keep the read lock open while the
+ * child process is performing an update.
+ */
+static void test_free_list_no_read_lock(void **state)
+{
+       int ret;
+       struct test_ctx *test_ctx =
+           talloc_get_type_abort(*state, struct test_ctx);
+       struct ldb_kv_private *ldb_kv = get_ldb_kv(test_ctx->ldb);
+       struct ldb_val key;
+       struct ldb_val val;
+
+       const char *KEY1 = "KEY01";
+
+       /*
+        * Pipes etc to co-ordinate the processes
+        */
+       int to_child[2];
+       int to_parent[2];
+       char buf[2];
+       pid_t pid;
+       size_t i;
+
+       TALLOC_CTX *tmp_ctx;
+       tmp_ctx = talloc_new(test_ctx);
+       assert_non_null(tmp_ctx);
+
+       ret = pipe(to_child);
+       assert_int_equal(ret, 0);
+       ret = pipe(to_parent);
+       assert_int_equal(ret, 0);
+       /*
+        * Now fork a new process
+        */
+
+       pid = fork();
+       if (pid == 0) {
+               /*
+                * Child process
+                */
+
+               struct ldb_context *ldb = NULL;
+               close(to_child[1]);
+               close(to_parent[0]);
+
+               /*
+                * Wait for the parent to get ready.
+                */
+               ret = read(to_child[0], buf, 2);
+               assert_int_equal(ret, 2);
+
+               ldb = ldb_init(test_ctx, test_ctx->ev);
+               assert_non_null(ldb);
+
+               ret = ldb_connect(ldb, test_ctx->dbpath, 0, NULL);
+               assert_int_equal(ret, LDB_SUCCESS);
+
+               ldb_kv = get_ldb_kv(ldb);
+               assert_non_null(ldb_kv);
+               /*
+                * Add a record to the database
+                */
+               key.data = (uint8_t *)talloc_strdup(tmp_ctx, KEY1);
+               key.length = strlen(KEY1) + 1;
+               val.data = talloc_zero_size(tmp_ctx, RECORD_SIZE);
+               assert_non_null(val.data);
+               memset(val.data, 'x', RECORD_SIZE);
+               val.length = RECORD_SIZE;
+               /*
+                * Do more iterations than when a read lock, stale reader
+                * active to confirm that the space is being re-used.
+                */
+               for (i = 0; i < ITERATIONS * 10; i++) {
+                       ret = ldb_kv->kv_ops->begin_write(ldb_kv);
+                       assert_int_equal(ret, LDB_SUCCESS);
+
+                       ret = ldb_kv->kv_ops->store(ldb_kv, key, val, 0);
+                       assert_int_equal(ret, LDB_SUCCESS);
+
+                       ret = ldb_kv->kv_ops->finish_write(ldb_kv);
+                       assert_int_equal(ret, LDB_SUCCESS);
+               }
+
+               /*
+                * Signal the parent that we've done the updates
+                */
+               ret = write(to_parent[1], "GO", 2);
+               assert_int_equal(ret, 2);
+               exit(0);
+       }
+
+       close(to_child[0]);
+       close(to_parent[1]);
+
+       /*
+        * Begin a read transaction
+        */
+       ret = ldb_kv->kv_ops->lock_read(test_ctx->ldb->modules);
+       assert_int_equal(ret, LDB_SUCCESS);
+
+       /*
+        * Now close it
+        */
+       ret = ldb_kv->kv_ops->unlock_read(test_ctx->ldb->modules);
+       assert_int_equal(ret, LDB_SUCCESS);
+
+       /*
+        * Signal the child process
+        */
+       ret = write(to_child[1], "GO", 2);
+       assert_int_equal(2, ret);
+
+       /*
+        * Wait for the child process to update the record
+        */
+       ret = read(to_parent[0], buf, 2);
+       assert_int_equal(2, ret);
+
+       /*
+        * Begin a read transaction
+        */
+       ret = ldb_kv->kv_ops->lock_read(test_ctx->ldb->modules);
+       assert_int_equal(ret, LDB_SUCCESS);
+       /*
+        * read the record
+        * and close the transaction
+        */
+       key.data = (uint8_t *)talloc_strdup(tmp_ctx, KEY1);
+       key.length = strlen(KEY1) + 1;
+
+       ret = ldb_kv->kv_ops->fetch_and_parse(ldb_kv, key, parse, &val);
+       assert_int_equal(ret, LDB_SUCCESS);
+
+       ret = ldb_kv->kv_ops->unlock_read(test_ctx->ldb->modules);
+       assert_int_equal(ret, LDB_SUCCESS);
+
+       close(to_child[1]);
+       close(to_parent[0]);
+       TALLOC_FREE(tmp_ctx);
+}
+
+/*
+ * This test has the same structure as the test_free_list_read_lock
+ * except the parent process keeps the read lock open while the
+ * child process is performing an update.
+ */
+static void test_free_list_read_lock(void **state)
+{
+       int ret;
+       struct test_ctx *test_ctx =
+           talloc_get_type_abort(*state, struct test_ctx);
+       struct ldb_kv_private *ldb_kv = get_ldb_kv(test_ctx->ldb);
+       struct ldb_val key;
+       struct ldb_val val;
+
+       const char *KEY1 = "KEY01";
+
+       /*
+        * Pipes etc to co-ordinate the processes
+        */
+       int to_child[2];
+       int to_parent[2];
+       char buf[2];
+       pid_t pid;
+       size_t i;
+
+       TALLOC_CTX *tmp_ctx;
+       tmp_ctx = talloc_new(test_ctx);
+       assert_non_null(tmp_ctx);
+
+       ret = pipe(to_child);
+       assert_int_equal(ret, 0);
+       ret = pipe(to_parent);
+       assert_int_equal(ret, 0);
+       /*
+        * Now fork a new process
+        */
+
+       pid = fork();
+       if (pid == 0) {
+               /*
+                * Child process
+                */
+
+               struct ldb_context *ldb = NULL;
+               close(to_child[1]);
+               close(to_parent[0]);
+
+               /*
+                * Wait for the transaction to start
+                */
+               ret = read(to_child[0], buf, 2);
+               assert_int_equal(ret, 2);
+
+               ldb = ldb_init(test_ctx, test_ctx->ev);
+               assert_non_null(ldb);
+
+               ret = ldb_connect(ldb, test_ctx->dbpath, 0, NULL);
+               assert_int_equal(ret, LDB_SUCCESS);
+
+               ldb_kv = get_ldb_kv(ldb);
+               assert_non_null(ldb_kv);
+               /*
+                * Add a record to the database
+                */
+               key.data = (uint8_t *)talloc_strdup(tmp_ctx, KEY1);
+               key.length = strlen(KEY1) + 1;
+               val.data = talloc_zero_size(tmp_ctx, RECORD_SIZE);
+               assert_non_null(val.data);
+               memset(val.data, 'x', RECORD_SIZE);
+               val.length = RECORD_SIZE;
+               for (i = 0; i < ITERATIONS; i++) {
+                       ret = ldb_kv->kv_ops->begin_write(ldb_kv);
+                       assert_int_equal(ret, 0);
+                       ret = ldb_kv->kv_ops->store(ldb_kv, key, val, 0);
+                       if (ret == LDB_ERR_BUSY && i > 0) {
+                               int rc = ldb_kv->kv_ops->abort_write(ldb_kv);
+                               assert_int_equal(rc, LDB_SUCCESS);
+                               break;
+                       }
+                       assert_int_equal(ret, LDB_SUCCESS);
+                       ret = ldb_kv->kv_ops->finish_write(ldb_kv);
+                       assert_int_equal(ret, LDB_SUCCESS);
+               }
+               assert_int_equal(ret, LDB_ERR_BUSY);
+               assert_int_not_equal(i, 0);
+
+               /*
+                * Begin a read transaction
+                */
+               ret = ldb_kv->kv_ops->lock_read(ldb->modules);
+               assert_int_equal(ret, LDB_SUCCESS);
+               /*
+                * read the record
+                * and close the transaction
+                */
+               key.data = (uint8_t *)talloc_strdup(tmp_ctx, KEY1);
+               key.length = strlen(KEY1) + 1;
+
+               ret = ldb_kv->kv_ops->fetch_and_parse(ldb_kv, key, parse, &val);
+               assert_int_equal(ret, LDB_SUCCESS);
+
+               ret = ldb_kv->kv_ops->unlock_read(ldb->modules);
+               assert_int_equal(ret, LDB_SUCCESS);
+
+               /*
+                * Signal the the parent that we've done the update
+                */
+               ret = write(to_parent[1], "GO", 2);
+               assert_int_equal(ret, 2);
+               exit(0);
+       }
+
+       close(to_child[0]);
+       close(to_parent[1]);
+
+       /*
+        * Begin a read transaction
+        */
+       ret = ldb_kv->kv_ops->lock_read(test_ctx->ldb->modules);
+       assert_int_equal(ret, LDB_SUCCESS);
+
+       /*
+        * Signal the child process
+        */
+       ret = write(to_child[1], "GO", 2);
+       assert_int_equal(ret, 2);
+
+       /*
+        * Wait for the child process to update the record
+        */
+       ret = read(to_parent[0], buf, 2);
+       assert_int_equal(ret, 2);
+
+       /*
+        * read the record
+        * and close the transaction
+        */
+       key.data = (uint8_t *)talloc_strdup(tmp_ctx, KEY1);
+       key.length = strlen(KEY1) + 1;
+
+       ret = ldb_kv->kv_ops->fetch_and_parse(ldb_kv, key, parse, &val);
+       assert_int_equal(ret, LDB_ERR_NO_SUCH_OBJECT);
+       ret = ldb_kv->kv_ops->unlock_read(test_ctx->ldb->modules);
+       assert_int_equal(ret, 0);
+
+       close(to_child[1]);
+       close(to_parent[0]);
+       TALLOC_FREE(tmp_ctx);
+}
+
+/*
+ * This tests forks a child process that opens a read lock and then
+ * exits. This results in a stale reader entry in the lmdb lock file.
+ */
+static void test_free_list_stale_reader(void **state)
+{
+       int ret;
+       struct test_ctx *test_ctx =
+           talloc_get_type_abort(*state, struct test_ctx);
+       struct ldb_kv_private *ldb_kv = get_ldb_kv(test_ctx->ldb);
+       struct ldb_val key;
+       struct ldb_val val;
+
+       const char *KEY1 = "KEY01";
+
+       /*
+        * Pipes etc to co-ordinate the processes
+        */
+       int to_child[2];
+       int to_parent[2];
+       char buf[2];
+       pid_t pid;
+       size_t i;
+
+       TALLOC_CTX *tmp_ctx;
+       tmp_ctx = talloc_new(test_ctx);
+       assert_non_null(tmp_ctx);
+
+       ret = pipe(to_child);
+       assert_int_equal(ret, 0);
+       ret = pipe(to_parent);
+       assert_int_equal(ret, 0);
+       /*
+        * Now fork a new process
+        */
+
+       pid = fork();
+       if (pid == 0) {
+               /*
+                * Child process
+                */
+
+               struct ldb_context *ldb = NULL;
+               close(to_child[1]);
+               close(to_parent[0]);
+
+               /*
+                * Wait for the parent to get ready
+                */
+               ret = read(to_child[0], buf, 2);
+               assert_int_equal(ret, 2);
+
+               ldb = ldb_init(test_ctx, test_ctx->ev);
+               assert_non_null(ldb);
+
+               ret = ldb_connect(ldb, test_ctx->dbpath, 0, NULL);
+               assert_int_equal(ret, LDB_SUCCESS);
+
+               ldb_kv = get_ldb_kv(ldb);
+               assert_non_null(ldb_kv);
+
+               /*
+                * Begin a read transaction
+                */
+               ret = ldb_kv->kv_ops->lock_read(ldb->modules);
+               assert_int_equal(ret, LDB_SUCCESS);
+
+               /*
+                * Now exit with out releasing the read lock
+                * this will result in a stale entry in the
+                * read lock table.
+                */
+
+               exit(0);
+       }
+
+       close(to_child[0]);
+       close(to_parent[1]);
+
+       /*
+        * Tell the child to start
+        */
+       ret = write(to_child[1], "GO", 2);
+       assert_int_equal(ret, 2);
+
+       close(to_child[1]);
+       close(to_parent[0]);
+
+       /*
+        * Now wait for the child process to complete
+        */
+       waitpid(pid, NULL, 0);
+
+       /*
+        * Add a record to the database
+        */
+       key.data = (uint8_t *)talloc_strdup(tmp_ctx, KEY1);
+       key.length = strlen(KEY1) + 1;
+       val.data = talloc_zero_size(tmp_ctx, RECORD_SIZE);
+       assert_non_null(val.data);
+       memset(val.data, 'x', RECORD_SIZE);
+       val.length = RECORD_SIZE;
+       for (i = 0; i < ITERATIONS; i++) {
+               ret = ldb_kv->kv_ops->begin_write(ldb_kv);
+               assert_int_equal(ret, LDB_SUCCESS);
+
+               ret = ldb_kv->kv_ops->store(ldb_kv, key, val, 0);
+               if (ret == LDB_ERR_BUSY && i > 0) {
+                       int rc = ldb_kv->kv_ops->abort_write(ldb_kv);
+                       assert_int_equal(rc, LDB_SUCCESS);
+                       break;
+               }
+               assert_int_equal(ret, LDB_SUCCESS);
+
+               ret = ldb_kv->kv_ops->finish_write(ldb_kv);
+               assert_int_equal(ret, LDB_SUCCESS);
+       }
+       /*
+        * We now do an explicit clear of stale readers at the start of a
+        * write transaction so should not get LDB_ERR_BUSY any more
+        * assert_int_equal(ret, LDB_ERR_BUSY);
+        */
+       assert_int_equal(ret, LDB_SUCCESS);
+       assert_int_not_equal(i, 0);
+
+       /*
+        * Begin a read transaction
+        */
+       ret = ldb_kv->kv_ops->lock_read(test_ctx->ldb->modules);
+       assert_int_equal(ret, LDB_SUCCESS);
+       /*
+        * read the record
+        * and close the transaction
+        */
+       key.data = (uint8_t *)talloc_strdup(tmp_ctx, KEY1);
+       key.length = strlen(KEY1) + 1;
+
+       ret = ldb_kv->kv_ops->fetch_and_parse(ldb_kv, key, parse, &val);
+       assert_int_equal(ret, LDB_SUCCESS);
+
+       ret = ldb_kv->kv_ops->unlock_read(test_ctx->ldb->modules);
+       assert_int_equal(ret, LDB_SUCCESS);
+
+       TALLOC_FREE(tmp_ctx);
+}
+
+int main(int argc, const char **argv)
+{
+       const struct CMUnitTest tests[] = {
+           cmocka_unit_test_setup_teardown(
+               test_free_list_no_read_lock, setup, teardown),
+           cmocka_unit_test_setup_teardown(
+               test_free_list_read_lock, setup, teardown),
+           cmocka_unit_test_setup_teardown(
+               test_free_list_stale_reader, setup, teardown),
+       };
+
+       return cmocka_run_group_tests(tests, NULL, NULL);
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ldb-2.1.2/wscript new/ldb-2.1.3/wscript
--- old/ldb-2.1.2/wscript       2020-04-22 12:50:43.000000000 +0200
+++ new/ldb-2.1.3/wscript       2020-05-19 12:10:40.000000000 +0200
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 APPNAME = 'ldb'
-VERSION = '2.1.2'
+VERSION = '2.1.3'
 
 import sys, os
 
@@ -551,6 +551,11 @@
                              deps='cmocka ldb',
                              install=False)
 
+            bld.SAMBA_BINARY('ldb_lmdb_free_list_test',
+                             source='tests/ldb_lmdb_free_list_test.c',
+                             cflags='-DTEST_BE=\"mdb\" -DTEST_LMDB=1',
+                             deps='cmocka ldb',
+                             install=False)
             #
             # We rely on the versions of the ldb_key_value functions included
             # in ldb_key_value_sub_txn_test.c taking priority over the versions
@@ -630,7 +635,8 @@
                      # fit > 4G of data into the DB), it would fill up the 
disk on
                      # many of our test instances
                      'ldb_mdb_kv_ops_test',
-                     'ldb_key_value_sub_txn_mdb_test']
+                     'ldb_key_value_sub_txn_mdb_test',
+                     'ldb_lmdb_free_list_test']
     else:
         test_exes += ['ldb_no_lmdb_test']
 



Reply via email to