1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 01UPSTREAM_autofs-5.0.4-always-read-file-maps-multi-map-fix.patch
4
## DP: Upstream patch on top of 5.0.4.
7
autofs-5.0.4 - always read file maps multi map fix
9
From: Ian Kent <raven@themaw.net>
11
Since "multi" map entries may contain file maps themselves and we
12
always want to read file maps we need to move the chack of whether
13
to read the map from lookup_nss_read_map() into the individual
14
map type lookup modules.
18
daemon/lookup.c | 14 --------------
19
modules/lookup_hosts.c | 8 ++++++++
20
modules/lookup_ldap.c | 8 ++++++++
21
modules/lookup_nisplus.c | 8 ++++++++
22
modules/lookup_yp.c | 8 ++++++++
23
6 files changed, 33 insertions(+), 14 deletions(-)
26
diff --git a/CHANGELOG b/CHANGELOG
27
index 7e1012f..972ef63 100644
31
- fix incorrect shutdown introduced by library relaod fixes.
32
- improve manual umount recovery.
33
- dont fail on ipv6 address when adding host.
34
+- always read file maps multi map fix.
36
4/11/2008 autofs-5.0.4
37
-----------------------
38
diff --git a/daemon/lookup.c b/daemon/lookup.c
39
index bc94655..9d5a5c8 100644
42
@@ -278,20 +278,6 @@ static int do_read_map(struct autofs_point *ap, struct map_source *map, time_t a
44
master_source_unlock(ap->entry);
46
- /* If we don't need to create directories then there's no use
47
- * reading the map. We just need to test that the map is valid
48
- * for the fail cases to function correctly and to cache the
51
- * We always need to read the whole map for direct mounts in
52
- * order to mount the triggers. We also want to read the whole
53
- * map if it's a file map to avoid potentially lengthy linear
56
- if (strcmp(map->type, "file") &&
57
- !(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT)
58
- return NSS_STATUS_SUCCESS;
61
return NSS_STATUS_SUCCESS;
63
diff --git a/modules/lookup_hosts.c b/modules/lookup_hosts.c
64
index d3ae0e2..a213780 100644
65
--- a/modules/lookup_hosts.c
66
+++ b/modules/lookup_hosts.c
67
@@ -89,6 +89,14 @@ int lookup_read_map(struct autofs_point *ap, time_t age, void *context)
68
ap->entry->current = NULL;
69
master_source_current_signal(ap->entry);
72
+ * If we don't need to create directories then there's no use
73
+ * reading the map. We always need to read the whole map for
74
+ * direct mounts in order to mount the triggers.
76
+ if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT)
77
+ return NSS_STATUS_SUCCESS;
81
status = pthread_mutex_lock(&hostent_mutex);
82
diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c
83
index 8c6a8f2..a847622 100644
84
--- a/modules/lookup_ldap.c
85
+++ b/modules/lookup_ldap.c
86
@@ -2236,6 +2236,14 @@ static int read_one_map(struct autofs_point *ap,
87
ap->entry->current = NULL;
88
master_source_current_signal(ap->entry);
91
+ * If we don't need to create directories then there's no use
92
+ * reading the map. We always need to read the whole map for
93
+ * direct mounts in order to mount the triggers.
95
+ if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT)
96
+ return NSS_STATUS_SUCCESS;
101
diff --git a/modules/lookup_nisplus.c b/modules/lookup_nisplus.c
102
index 0c75905..ae53481 100644
103
--- a/modules/lookup_nisplus.c
104
+++ b/modules/lookup_nisplus.c
105
@@ -180,6 +180,14 @@ int lookup_read_map(struct autofs_point *ap, time_t age, void *context)
106
ap->entry->current = NULL;
107
master_source_current_signal(ap->entry);
110
+ * If we don't need to create directories then there's no use
111
+ * reading the map. We always need to read the whole map for
112
+ * direct mounts in order to mount the triggers.
114
+ if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT)
115
+ return NSS_STATUS_SUCCESS;
119
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cur_state);
120
diff --git a/modules/lookup_yp.c b/modules/lookup_yp.c
121
index ce438e8..208f95e 100644
122
--- a/modules/lookup_yp.c
123
+++ b/modules/lookup_yp.c
124
@@ -322,6 +322,14 @@ int lookup_read_map(struct autofs_point *ap, time_t age, void *context)
125
ap->entry->current = NULL;
126
master_source_current_signal(ap->entry);
129
+ * If we don't need to create directories then there's no use
130
+ * reading the map. We always need to read the whole map for
131
+ * direct mounts in order to mount the triggers.
133
+ if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT)
134
+ return NSS_STATUS_SUCCESS;
137
ypcb_data.source = source;
138
ypcb_data.logopt = logopt;