From: Garming Sam Date: Tue, 12 Mar 2019 21:52:19 +0000 (+1300) Subject: acl_read: Fix regression caused by db15fcfa899e1fe4d6994f68ceb299921b8aa6f1 for empty... X-Git-Url: http://git.samba.org/samba.git/?p=sfrench%2Fsamba-autobuild%2F.git;a=commitdiff_plain;h=a2b1970a37836e46d6c9eb6bda9bd20185de96ce 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 Reviewed-by: Andrew Bartlett Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Fri Mar 29 18:37:29 UTC 2019 on sn-devel-144 --- diff --git a/selftest/knownfail.d/dsdb b/selftest/knownfail.d/dsdb deleted file mode 100644 index 7a3a314778b..00000000000 --- a/selftest/knownfail.d/dsdb +++ /dev/null @@ -1 +0,0 @@ -samba4.dsdb.no_attrs diff --git a/source4/dsdb/samdb/ldb_modules/acl_read.c b/source4/dsdb/samdb/ldb_modules/acl_read.c index 5a193e6d925..1e016b970ee 100644 --- a/source4/dsdb/samdb/ldb_modules/acl_read.c +++ b/source4/dsdb/samdb/ldb_modules/acl_read.c @@ -797,9 +797,6 @@ static int aclread_search(struct ldb_module *module, struct ldb_request *req) if (attrs == NULL) { all_attrs = true; attrs = _all_attrs; - } else if (attrs[0] == NULL) { - all_attrs = true; - attrs = _all_attrs; } else if (ldb_attr_in_list(attrs, "*")) { all_attrs = true; }