s4-lsa: Cache sam.ldb handle in lsa_LookupSids3/LookupNames4
commit33ef89475b09dcdbbad2048c47961a95eb2f1558
authorAndrew Bartlett <abartlet@samba.org>
Wed, 25 Aug 2021 00:03:08 +0000 (25 12:03 +1200)
committerJule Anger <janger@samba.org>
Fri, 10 Sep 2021 14:14:09 +0000 (10 14:14 +0000)
tree55b994172e133da918d5654747785b1fc638cf77
parentbe4f4f4f5942ee1f762e6645e42916f3f6fc7ad6
s4-lsa: Cache sam.ldb handle in lsa_LookupSids3/LookupNames4

Since 5c0345ea9bb34695dcd7be6c913748323bebe937 this
would not have been implicitly cached via the ldb_wrap
cache, due to the recording of the remote IP address
(which is a good thing).

This creates a more explicit and direct correct
cache on the connection.

The common code, including the SCHANNEL check is
placed into a helper function.

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

RN: Fix performance regression in lsa_LookupSids3/LookupNames4 since Samba 4.9 by using an explicit database handle cache

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun Sep  5 03:19:26 UTC 2021 on sn-devel-184

(cherry picked from commit ae57d22e45b33537e9fca5969e9b68abd1ad633f)
source4/rpc_server/lsa/lsa_lookup.c