summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/ldap_server/ldap_server.c6
1 files changed, 5 insertions, 1 deletions
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;
}