acl_read: Fix regression caused by db15fcfa899e1fe4d6994f68ceb299921b8aa6f1 for empty...
authorGarming Sam <garming@catalyst.net.nz>
Tue, 12 Mar 2019 21:52:19 +0000 (10:52 +1300)
committerKarolin Seeger <kseeger@samba.org>
Tue, 2 Apr 2019 09:10:54 +0000 (09:10 +0000)
commit868356cf36566636cfce5ee28c1a38055dd38ce8
tree6816a0911cfc0d9c56f0308d631b14af921265a4
parent286b80cb7a3b7da8bb381786521931c14fed3383
acl_read: Fix regression caused by db15fcfa899e1fe4d6994f68ceb299921b8aa6f1 for empty lists

The original code never dereferenced attrs and only added "*" if attrs
was NULL (not if attrs[0] was NULL).

This causes significant performance issues with the new paged_results
module introduced for 4.10 as the initial GUID search requests no
attributes. This GUID search turns into a search for "*" and ends up
allocating memory for the entire database.

This never appears to cause changes in the final result set, only
intermediate processing.

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

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Mar 29 18:37:29 UTC 2019 on sn-devel-144

(cherry picked from commit a2b1970a37836e46d6c9eb6bda9bd20185de96ce)
selftest/knownfail.d/dsdb [deleted file]
source4/dsdb/samdb/ldb_modules/acl_read.c