diff --git a/CHANGELOG b/CHANGELOG
index f8260b1..be50aad 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -44,6 +44,7 @@
 - fix schema selection in LDAP schema discovery.
 - update negative mount timeout handling.
 - fix large group handling (Ryan Thomas).
+- fix for dynamic logging breaking non-sasl build (Guillaume Rousse)
 
 18/06/2007 autofs-5.0.2
 -----------------------
diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c
index bad48bb..93a1b40 100644
--- a/modules/lookup_ldap.c
+++ b/modules/lookup_ldap.c
@@ -579,7 +579,9 @@ static LDAP *do_reconnect(unsigned logopt, struct lookup_context *ctxt)
 		list_add_tail(&this->list, ctxt->uri);
 	}
 
+#ifdef WITH_SASL
 	autofs_sasl_done(ctxt);
+#endif
 
 	/* Current server failed connect, try the rest */
 	ldap = find_server(logopt, ctxt);