From b3e62493253e2f45224c9b69928765adc52b257e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Busse?= Date: Sat, 29 May 2021 02:13:50 +0200 Subject: [PATCH] ldap: Bind and fetch on client init --- ldap.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ldap.go b/ldap.go index 83b30ac..f93a035 100644 --- a/ldap.go +++ b/ldap.go @@ -90,6 +90,15 @@ func (l *Ldap) InitClient() (err error) { log.Fatal(err) return err } + + err = l.Client.Bind(l.username, l.password) + if err != nil { + log.Fatal(err) + } + if err := l.UpdateZones(); err != nil { + return err + } + defer l.Client.Close() return nil