]> git.pld-linux.org Git - packages/autofs.git/blob - autofs-5.0.4-always-read-file-maps-multi-map-fix.patch
- updated to 5.0.5, nfy.
[packages/autofs.git] / autofs-5.0.4-always-read-file-maps-multi-map-fix.patch
1 autofs-5.0.4 - always read file maps multi map fix
2
3 From: Ian Kent <raven@themaw.net>
4
5 Since "multi" map entries may contain file maps themselves and we
6 always want to read file maps we need to move the chack of whether
7 to read the map from lookup_nss_read_map() into the individual
8 map type lookup modules.
9 ---
10
11  CHANGELOG                |    1 +
12  daemon/lookup.c          |   14 --------------
13  modules/lookup_hosts.c   |    8 ++++++++
14  modules/lookup_ldap.c    |    8 ++++++++
15  modules/lookup_nisplus.c |    8 ++++++++
16  modules/lookup_yp.c      |    8 ++++++++
17  6 files changed, 33 insertions(+), 14 deletions(-)
18
19
20 diff --git a/CHANGELOG b/CHANGELOG
21 index 7e1012f..972ef63 100644
22 --- a/CHANGELOG
23 +++ b/CHANGELOG
24 @@ -47,6 +47,7 @@
25  - fix incorrect shutdown introduced by library relaod fixes.
26  - improve manual umount recovery.
27  - dont fail on ipv6 address when adding host.
28 +- always read file maps multi map fix.
29  
30  4/11/2008 autofs-5.0.4
31  -----------------------
32 diff --git a/daemon/lookup.c b/daemon/lookup.c
33 index bc94655..9d5a5c8 100644
34 --- a/daemon/lookup.c
35 +++ b/daemon/lookup.c
36 @@ -278,20 +278,6 @@ static int do_read_map(struct autofs_point *ap, struct map_source *map, time_t a
37         map->lookup = lookup;
38         master_source_unlock(ap->entry);
39  
40 -       /* If we don't need to create directories then there's no use
41 -        * reading the map. We just need to test that the map is valid
42 -        * for the fail cases to function correctly and to cache the
43 -        * lookup handle.
44 -        *
45 -        * We always need to read the whole map for direct mounts in
46 -        * order to mount the triggers. We also want to read the whole
47 -        * map if it's a file map to avoid potentially lengthy linear
48 -        * file scanning.
49 -        */
50 -       if (strcmp(map->type, "file") &&
51 -           !(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT)
52 -               return NSS_STATUS_SUCCESS;
53 -
54         if (!map->stale)
55                 return NSS_STATUS_SUCCESS;
56  
57 diff --git a/modules/lookup_hosts.c b/modules/lookup_hosts.c
58 index d3ae0e2..a213780 100644
59 --- a/modules/lookup_hosts.c
60 +++ b/modules/lookup_hosts.c
61 @@ -89,6 +89,14 @@ int lookup_read_map(struct autofs_point *ap, time_t age, void *context)
62         ap->entry->current = NULL;
63         master_source_current_signal(ap->entry);
64  
65 +       /*
66 +        * If we don't need to create directories then there's no use
67 +        * reading the map. We always need to read the whole map for
68 +        * direct mounts in order to mount the triggers.
69 +        */
70 +       if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT)
71 +               return NSS_STATUS_SUCCESS;
72 +
73         mc = source->mc;
74  
75         status = pthread_mutex_lock(&hostent_mutex);
76 diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c
77 index 8c6a8f2..a847622 100644
78 --- a/modules/lookup_ldap.c
79 +++ b/modules/lookup_ldap.c
80 @@ -2236,6 +2236,14 @@ static int read_one_map(struct autofs_point *ap,
81         ap->entry->current = NULL;
82         master_source_current_signal(ap->entry);
83  
84 +       /*
85 +        * If we don't need to create directories then there's no use
86 +        * reading the map. We always need to read the whole map for
87 +        * direct mounts in order to mount the triggers.
88 +        */
89 +       if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT)
90 +               return NSS_STATUS_SUCCESS;
91 +
92         sp.ap = ap;
93         sp.age = age;
94  
95 diff --git a/modules/lookup_nisplus.c b/modules/lookup_nisplus.c
96 index 0c75905..ae53481 100644
97 --- a/modules/lookup_nisplus.c
98 +++ b/modules/lookup_nisplus.c
99 @@ -180,6 +180,14 @@ int lookup_read_map(struct autofs_point *ap, time_t age, void *context)
100         ap->entry->current = NULL;
101         master_source_current_signal(ap->entry);
102  
103 +       /*
104 +        * If we don't need to create directories then there's no use
105 +        * reading the map. We always need to read the whole map for
106 +        * direct mounts in order to mount the triggers.
107 +        */
108 +       if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT)
109 +               return NSS_STATUS_SUCCESS;
110 +
111         mc = source->mc;
112  
113         pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cur_state);
114 diff --git a/modules/lookup_yp.c b/modules/lookup_yp.c
115 index ce438e8..208f95e 100644
116 --- a/modules/lookup_yp.c
117 +++ b/modules/lookup_yp.c
118 @@ -322,6 +322,14 @@ int lookup_read_map(struct autofs_point *ap, time_t age, void *context)
119         ap->entry->current = NULL;
120         master_source_current_signal(ap->entry);
121  
122 +       /*
123 +        * If we don't need to create directories then there's no use
124 +        * reading the map. We always need to read the whole map for
125 +        * direct mounts in order to mount the triggers.
126 +        */
127 +       if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT)
128 +               return NSS_STATUS_SUCCESS;
129 +
130         ypcb_data.ap = ap;
131         ypcb_data.source = source;
132         ypcb_data.logopt = logopt;
This page took 0.065497 seconds and 3 git commands to generate.