summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-02-26 22:48:42 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:18:12 -0500
commitab6a1df7a6f75637a0f25e02e16847d2441dee6d (patch)
tree638f3a1b050169402079e9557ee2e9f8cb787f19 /source3/rpc_server
parenteccb9b7962a71541651bd63bff1ff85c80e70b77 (diff)
downloadsamba-ab6a1df7a6f75637a0f25e02e16847d2441dee6d.tar.gz
samba-ab6a1df7a6f75637a0f25e02e16847d2441dee6d.tar.bz2
samba-ab6a1df7a6f75637a0f25e02e16847d2441dee6d.zip
r21550: make disp_info_list static to get_samr_dispinfo_by_sid(), add a comment :-)
(This used to be commit fad2ee8aa3e99c31a0632a80b4a64dedb6e01495)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_samr_nt.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index f59ab61509..b7a45267a3 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -64,8 +64,6 @@ typedef struct disp_info {
/* We keep a static list of these by SID as modern clients close down
all resources between each request in a complete enumeration. */
-static DISP_INFO *disp_info_list;
-
struct samr_info {
/* for use by the \PIPE\samr policy */
DOM_SID sid;
@@ -254,6 +252,24 @@ static NTSTATUS access_check_samr_function(uint32 acc_granted, uint32 acc_requir
static DISP_INFO *get_samr_dispinfo_by_sid(DOM_SID *psid)
{
+ /*
+ * We do a static cache for DISP_INFO's here. Explanation can be found
+ * in Jeremy's checkin message to r11793:
+ *
+ * Fix the SAMR cache so it works across completely insane
+ * client behaviour (ie.:
+ * open pipe/open SAMR handle/enumerate 0 - 1024
+ * close SAMR handle, close pipe.
+ * open pipe/open SAMR handle/enumerate 1024 - 2048...
+ * close SAMR handle, close pipe.
+ * And on ad-nausium. Amazing.... probably object-oriented
+ * client side programming in action yet again.
+ * This change should *massively* improve performance when
+ * enumerating users from an LDAP database.
+ * Jeremy.
+ */
+
+ static DISP_INFO *disp_info_list;
TALLOC_CTX *mem_ctx;
DISP_INFO *dpi;