From 55fe875a44bd63de766d4fbdb91bcc26be146a21 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 5 Nov 2004 22:53:35 +0000 Subject: r3563: During a typical logon a modern workstation makes a lot of anonymous session setups on its way to open a pipe. This gets rid of many round-trips to the LDAP server during logon by setting up the server_info_guest once and not asking the LDAP server and nss every time. Make sure that the ldap connection is reopened in the child. (I did not look at the sql backends.) Volker (This used to be commit 3298f6105e6a88c9390cac02245c8f2eee1e5046) --- source3/passdb/passdb.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'source3/passdb') diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c index 743978919b..74ac8fa865 100644 --- a/source3/passdb/passdb.c +++ b/source3/passdb/passdb.c @@ -2215,6 +2215,28 @@ uint32 init_buffer_from_sam_v2 (uint8 **buf, const SAM_ACCOUNT *sampass, BOOL si return (buflen); } +BOOL pdb_copy_sam_account(const SAM_ACCOUNT *src, SAM_ACCOUNT **dst) +{ + BOOL result; + uint8 *buf; + int len; + + if ((*dst == NULL) && (!NT_STATUS_IS_OK(pdb_init_sam(dst)))) + return False; + + len = init_buffer_from_sam_v2(&buf, src, False); + + if (len == -1) + return False; + + result = init_sam_from_buffer_v2(*dst, buf, len); + (*dst)->methods = src->methods; + + free(buf); + + return result; +} + /********************************************************************** **********************************************************************/ -- cgit