Description: add back support for credentialcache option
 The patchset to let openldap handle SASL authentication accidentally dropped
 support for the credentialcache option in autofs_ldap_auto.conf.
Author: Andreas Hasenack <andreas@canonical.com>
Forwarded: https://www.spinics.net/lists/autofs/msg02582.html
Last-Update: 2023-05-24
--- a/modules/lookup_ldap.c	2023-05-16 21:02:41.263345786 +0000
+++ b/modules/lookup_ldap.c	2023-05-16 21:02:47.807520735 +0000
@@ -601,7 +601,10 @@
 		debug(logopt, MODPREFIX "autofs_sasl_bind returned %d", rv);
 #else
 		if (ctxt->sasl_mech && !strncmp(ctxt->sasl_mech, "GSSAPI", 6)) {
-			rv = sasl_do_kinit(logopt, ctxt);
+            if (ctxt->client_cc)
+                rv = sasl_do_kinit_ext_cc(logopt, ctxt);
+            else
+			    rv = sasl_do_kinit(logopt, ctxt);
 			if (rv != 0)
 				return 0;
 			sasl_flags = LDAP_SASL_QUIET;
