summaryrefslogtreecommitdiff
path: root/lib/ldb/modules
AgeCommit message (Collapse)AuthorFilesLines
2024-04-23ldb:sort: generalise both-NULL check to equality checkDouglas Bagnall1-1/+1
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15625 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-04-23ldb:sort: check that elements have valuesDouglas Bagnall1-1/+11
We assume no values is unlikely, since we have been dereferencing ->values[0] forever, with no known reports of trouble. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15625 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-04-23ldb:mod:sort: rearrange NULL checksDouglas Bagnall1-5/+8
There are further changes coming here. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15625 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-12-14lib: Use talloc_asprintf_addbuf() in rdn_name_add()Volker Lendecke1-2/+2
Add implicit NULL checks Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-12-14lib: Fix whitespaceVolker Lendecke1-6/+6
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-07-27CVE-2022-32746 ldb: Make use of functions for appending to an ldb_messageJoseph Sutton1-18/+4
This aims to minimise usage of the error-prone pattern of searching for a just-added message element in order to make modifications to it (and potentially finding the wrong element). BUG: https://bugzilla.samba.org/show_bug.cgi?id=15009 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2022-07-27CVE-2022-32746 ldb:rdn_name: Use LDB_FLAG_MOD_TYPE() for flags equality checkJoseph Sutton1-1/+1
Now unrelated flags will no longer affect the result. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15009 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2020-06-13ldb/mod/paged_searches: cope with NULL control dataDouglas Bagnall1-2/+2
We won't get NULL data over ldap, but it can be set via 'local_oid:'. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2020-05-04CVE-2020-10700: ldb: Always use ldb_next_request() in ASQ moduleAndrew Bartlett1-9/+3
We want to keep going down the module stack, and not start from the top again. ASQ is above the ACL modules, but below paged_results and we do not wish to re-trigger that work. Thanks to Andrei Popa <andrei.popa@next-gen.ro> for finding, reporting and working with us to diagnose this issue! BUG: https://bugzilla.samba.org/show_bug.cgi?id=14331 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-05-09ldb modules: paged_search checks control is not NULL (CID 241355)Douglas Bagnall1-0/+5
It is unlikely to be NULL, since we're in the callback. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2018-12-21paged results: new paged results module using GUID listAaron Haslett1-445/+0
Replacing paged results module to use GUID list instead of storing result list in memory, in order to improve memory performance. Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-05-15lib: Hold at most 10 outstanding paged result cookiesVolker Lendecke1-0/+22
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13362 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue May 15 09:37:21 CEST 2018 on sn-devel-144
2018-05-15lib: Put "results_store" into a doubly linked listVolker Lendecke1-20/+5
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13362 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2016-12-01ldb: Cope with a->name being *Andrew Bartlett1-4/+4
The default schema when loaded from the DB will have a name of *, not NULL. This feature is rarely used, and was incompatible with the rdn_name module until now. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-12-01ldb:rdn_name: add support for LDB_CONTROL_RECALCULATE_RDN_OID on ldb_modify()Stefan Metzmacher1-0/+141
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12399 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-12-01ldb:rdn_name: normalize rdn_name in rdn_rename_callback()Stefan Metzmacher1-0/+10
We already do that on 'add'. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12399 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-22sort: enable custom behaviour on critical controlGarming Sam1-0/+2
The sort module should simply return unsorted results when a sort is unsupported but not critical. A similar custom behaviour should be expected with VLV pagination when it is enabled. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-03-09ldb sort: allow sorting on attributes not returned in searchDouglas Bagnall1-2/+42
The attribute is added to the search request, then peeled off again before the sort module passes the results on. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-09ldb paged_results: quieten a warning.Douglas Bagnall1-2/+2
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2013-10-22ldb: Fix CID 240798 Uninitialized pointer readVolker Lendecke1-1/+1
Not called right now, because nobody tries multiple sort attributes. But if someone did, build_response would have looked at the uninitialized controls. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Oct 22 03:28:20 CEST 2013 on sn-devel-104
2013-10-10ldb:rdn_name: reject 'distinguishedName' depending of the MOD flagsStefan Metzmacher1-2/+8
This is what Windows 2008 R2 returns: LDB_MOD_ADD => LDB_ERR_UNWILLING_TO_PERFORM LDB_MOD_REPLACE => LDB_ERR_CONSTRAINT_VIOLATION LDB_MOD_DEL => LDB_ERR_UNWILLING_TO_PERFORM Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2011-07-05ldb: make ldb a top level library for Samba 4.0Andrew Bartlett6-0/+2200
Signed-off-by: Andrew Tridgell <tridge@samba.org>