1 autofs-5.0.4 - renew sasl creds upon reconnect fail
3 From: Ian Kent <raven@themaw.net>
5 If a server re-connect fails it could be due to the authentication
6 credentail having timed out. So we need to dispose of this and retry
7 the connection including refreshing re-authenticating.
11 modules/lookup_ldap.c | 17 +++++++++++++++++
12 2 files changed, 18 insertions(+), 0 deletions(-)
15 diff --git a/CHANGELOG b/CHANGELOG
16 index b093451..7dee674 100644
20 - use CLOEXEC flag for setmntent also.
21 - fix hosts map use after free.
22 - fix uri list locking (again).
23 +- check for stale SASL credentials upon connect fail.
25 4/11/2008 autofs-5.0.4
26 -----------------------
27 diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c
28 index b6784e1..bee97ae 100644
29 --- a/modules/lookup_ldap.c
30 +++ b/modules/lookup_ldap.c
31 @@ -675,6 +675,13 @@ static LDAP *do_reconnect(unsigned logopt, struct lookup_context *ctxt)
33 if (ctxt->server || !ctxt->uris) {
34 ldap = do_connect(logopt, ctxt->server, ctxt);
36 + /* Dispose of the sasl authentication connection and try again. */
38 + autofs_sasl_dispose(ctxt);
39 + ldap = connect_to_server(logopt, ctxt->server, ctxt);
45 @@ -682,6 +689,16 @@ static LDAP *do_reconnect(unsigned logopt, struct lookup_context *ctxt)
47 uris_mutex_unlock(ctxt);
48 ldap = do_connect(logopt, this->uri, ctxt);
51 + * Dispose of the sasl authentication connection and try the
52 + * current server again before trying other servers in the list.
55 + autofs_sasl_dispose(ctxt);
56 + ldap = connect_to_server(logopt, this->uri, ctxt);