1 autofs-5.0.4 - always read file maps multi map fix
3 From: Ian Kent <raven@themaw.net>
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.
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(-)
20 diff --git a/CHANGELOG b/CHANGELOG
21 index 7e1012f..972ef63 100644
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.
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
36 @@ -278,20 +278,6 @@ static int do_read_map(struct autofs_point *ap, struct map_source *map, time_t a
38 master_source_unlock(ap->entry);
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
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
50 - if (strcmp(map->type, "file") &&
51 - !(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT)
52 - return NSS_STATUS_SUCCESS;
55 return NSS_STATUS_SUCCESS;
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);
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.
70 + if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT)
71 + return NSS_STATUS_SUCCESS;
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);
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.
89 + if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT)
90 + return NSS_STATUS_SUCCESS;
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);
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.
108 + if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT)
109 + return NSS_STATUS_SUCCESS;
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);
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.
127 + if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT)
128 + return NSS_STATUS_SUCCESS;
131 ypcb_data.source = source;
132 ypcb_data.logopt = logopt;