]> git.pld-linux.org Git - packages/autofs.git/blob - autofs-5.0.4-always-read-file-maps-key-lookup-fixes.patch
- import latest patchset.
[packages/autofs.git] / autofs-5.0.4-always-read-file-maps-key-lookup-fixes.patch
1 autofs-5.0.4 - always read file maps key lookup fixes
2
3 From: Ian Kent <raven@themaw.net>
4
5 Since we always read file maps at start we need to ensure that
6 we return a not found if the key isn't found in the cache. Also,
7 if we're looking through a "multi" map we can't use the cache
8 lookup optimisation because, in this case, there is a single map
9 source shared by the "multi" maps so we may not get correct results
10 from the lookup if a map later in the search has been modified.
11 ---
12
13  CHANGELOG             |    1 +
14  modules/lookup_file.c |   17 +++++++++++------
15  2 files changed, 12 insertions(+), 6 deletions(-)
16
17
18 diff --git a/CHANGELOG b/CHANGELOG
19 index 972ef63..5000f0c 100644
20 --- a/CHANGELOG
21 +++ b/CHANGELOG
22 @@ -48,6 +48,7 @@
23  - improve manual umount recovery.
24  - dont fail on ipv6 address when adding host.
25  - always read file maps multi map fix.
26 +- always read file maps key lookup fixes.
27  
28  4/11/2008 autofs-5.0.4
29  -----------------------
30 diff --git a/modules/lookup_file.c b/modules/lookup_file.c
31 index bd30bc5..a4ca39d 100644
32 --- a/modules/lookup_file.c
33 +++ b/modules/lookup_file.c
34 @@ -1003,13 +1003,15 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void *
35                          * If any map instances are present for this source
36                          * then either we have plus included entries or we
37                          * are looking through the list of nsswitch sources.
38 -                        * In either case we cannot avoid reading through the
39 -                        * map because we must preserve the key order over
40 -                        * multiple sources. But also, we can't know, at this
41 -                        * point, if a source instance has been changed since
42 -                        * the last time we checked it.
43 +                        * In either case, or if it's a "multi" source, we
44 +                        * cannot avoid reading through the map because we
45 +                        * must preserve the key order over multiple sources
46 +                        * or maps. But also, we can't know, at this point,
47 +                        * if a source instance has been changed since the
48 +                        * last time we checked it.
49                          */
50 -                       if (!source->instance)
51 +                       if (!source->instance &&
52 +                           source->type && strcmp(source->type, "multi"))
53                                 goto do_cache_lookup;
54                 } else
55                         source->stale = 1;
56 @@ -1055,6 +1057,9 @@ do_cache_lookup:
57         }
58         cache_unlock(mc);
59  
60 +       if (!me)
61 +               return NSS_STATUS_NOTFOUND;
62 +
63         if (!mapent)
64                 return NSS_STATUS_TRYAGAIN;
65  
This page took 0.033551 seconds and 3 git commands to generate.