]> git.pld-linux.org Git - packages/autofs.git/blame - autofs-5.0.4-renew-sasl-creds-upon-reconnect-fail.patch
- updated to 5.0.5, nfy.
[packages/autofs.git] / autofs-5.0.4-renew-sasl-creds-upon-reconnect-fail.patch
CommitLineData
e5fd101c
PS
1autofs-5.0.4 - renew sasl creds upon reconnect fail
2
3From: Ian Kent <raven@themaw.net>
4
5If a server re-connect fails it could be due to the authentication
6credentail having timed out. So we need to dispose of this and retry
7the connection including refreshing re-authenticating.
8---
9
10 CHANGELOG | 1 +
11 modules/lookup_ldap.c | 17 +++++++++++++++++
12 2 files changed, 18 insertions(+), 0 deletions(-)
13
14
15diff --git a/CHANGELOG b/CHANGELOG
16index b093451..7dee674 100644
17--- a/CHANGELOG
18+++ b/CHANGELOG
19@@ -11,6 +11,7 @@
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.
24
25 4/11/2008 autofs-5.0.4
26 -----------------------
27diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c
28index 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)
32
33 if (ctxt->server || !ctxt->uris) {
34 ldap = do_connect(logopt, ctxt->server, ctxt);
35+#ifdef WITH_SASL
36+ /* Dispose of the sasl authentication connection and try again. */
37+ if (!ldap) {
38+ autofs_sasl_dispose(ctxt);
39+ ldap = connect_to_server(logopt, ctxt->server, ctxt);
40+ }
41+#endif
42 return ldap;
43 }
44
45@@ -682,6 +689,16 @@ static LDAP *do_reconnect(unsigned logopt, struct lookup_context *ctxt)
46 this = ctxt->uri;
47 uris_mutex_unlock(ctxt);
48 ldap = do_connect(logopt, this->uri, ctxt);
49+#ifdef WITH_SASL
50+ /*
51+ * Dispose of the sasl authentication connection and try the
52+ * current server again before trying other servers in the list.
53+ */
54+ if (!ldap) {
55+ autofs_sasl_dispose(ctxt);
56+ ldap = connect_to_server(logopt, this->uri, ctxt);
57+ }
58+#endif
59 if (ldap)
60 return ldap;
61
This page took 0.120578 seconds and 4 git commands to generate.