CVE-2023-0614 ldb: Make use of ldb_filter_attrs_in_place()
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Sun, 26 Feb 2023 21:31:52 +0000 (10:31 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 5 Apr 2023 02:10:35 +0000 (02:10 +0000)
commitfffea5900172f1df02426ba6ed7ca9b7750ffaf7
treeed02aa5c984e80db57453936f44d2f13c88e0e05
parentf25b1756aacbaabfd75e270cc3fecbf6d17c29fd
CVE-2023-0614 ldb: Make use of ldb_filter_attrs_in_place()

Change all uses of ldb_kv_filter_attrs() to use
ldb_filter_attrs_in_place() instead. This function does less work than
its predecessor, and no longer requires the allocation of a second ldb
message. Some of the work is able to be split out into separate
functions that each accomplish a single task, with a purpose to make the
code clearer.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15270

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/ldb/ldb_key_value/ldb_kv.h
lib/ldb/ldb_key_value/ldb_kv_index.c
lib/ldb/ldb_key_value/ldb_kv_search.c
source4/torture/ldb/ldb.c