]> git.pld-linux.org Git - packages/autofs.git/blame - autofs-5.0.4-always-read-file-maps-fix.patch
- updated to 5.0.5, nfy.
[packages/autofs.git] / autofs-5.0.4-always-read-file-maps-fix.patch
CommitLineData
e5fd101c
PS
1autofs-5.0.4 - always read file maps fix
2
3From: Ian Kent <raven@themaw.net>
4
5If map instances are present for a map source then either we have
6plus included entries or we are looking through a list of nsswitch
7sources. In either case we cannot avoid reading through the map
8because we must preserve the key lookup order over multiple sources.
9But also, we can't know if a source instance has been changed since
10the last time we checked it until we preform a lookup against it.
11So, in this case a lookup within the internal cache cannot be relied
12upon to find the key we're looking for. At least, when we get to the
13file source instance itself, the lookup for the key will be done from
14the cache.
15---
16
17 CHANGELOG | 1 +
18 modules/lookup_file.c | 17 ++++++++++++++---
19 2 files changed, 15 insertions(+), 3 deletions(-)
20
21
22diff --git a/CHANGELOG b/CHANGELOG
23index aab3209..da7ecbf 100644
24--- a/CHANGELOG
25+++ b/CHANGELOG
26@@ -31,6 +31,7 @@
27 - fix double free in expire_proc().
28 - another easy alloca replacements fix.
29 - add LSB init script parameter block.
30+- fix file map lookup when reading included or nsswitch sources.
31
32 4/11/2008 autofs-5.0.4
33 -----------------------
34diff --git a/modules/lookup_file.c b/modules/lookup_file.c
35index ec78090..bd30bc5 100644
36--- a/modules/lookup_file.c
37+++ b/modules/lookup_file.c
38@@ -998,9 +998,20 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void *
39
40 cache_readlock(mc);
41 me = cache_lookup_first(mc);
42- if (me && st.st_mtime <= me->age)
43- goto do_cache_lookup;
44- else
45+ if (me && st.st_mtime <= me->age) {
46+ /*
47+ * If any map instances are present for this source
48+ * then either we have plus included entries or we
49+ * are looking through the list of nsswitch sources.
50+ * In either case we cannot avoid reading through the
51+ * map because we must preserve the key order over
52+ * multiple sources. But also, we can't know, at this
53+ * point, if a source instance has been changed since
54+ * the last time we checked it.
55+ */
56+ if (!source->instance)
57+ goto do_cache_lookup;
58+ } else
59 source->stale = 1;
60
61 me = cache_lookup_distinct(mc, key);
This page took 0.085127 seconds and 4 git commands to generate.