From 376b2a29d6a5d56be8539beec80540772cda875e Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 16 Jul 2008 11:11:25 +1000 Subject: Don't keep an extra ldb around forever. We just open it to figure out if we need to be a Global Catalog server. Andrew Bartlett (This used to be commit f13572d9e9f1962b637cbd573588184d1459d252) --- source4/ldap_server/ldap_server.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source4/ldap_server') diff --git a/source4/ldap_server/ldap_server.c b/source4/ldap_server/ldap_server.c index 197f84692c..39a55f4420 100644 --- a/source4/ldap_server/ldap_server.c +++ b/source4/ldap_server/ldap_server.c @@ -477,7 +477,7 @@ static NTSTATUS add_socket(struct event_context *event_context, } } - /* Load LDAP database */ + /* Load LDAP database, but only to read our settings */ ldb = samdb_connect(ldap_service, ldap_service->task->event_ctx, lp_ctx, system_session(ldap_service, lp_ctx)); if (!ldb) { @@ -497,6 +497,10 @@ static NTSTATUS add_socket(struct event_context *event_context, } } + /* And once we are bound, free the tempoary ldb, it will + * connect again on each incoming LDAP connection */ + talloc_free(ldb); + return status; } -- cgit