~ubuntu-branches/ubuntu/raring/autofs5/raring

« back to all changes in this revision

Viewing changes to debian/patches/01UPSTREAM_autofs-5.0.4-always-read-file-maps-multi-map-fix.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Jan Christoph Nordholz
  • Date: 2009-08-28 21:24:14 UTC
  • mfrom: (5.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090828212414-z9xvmo5kdpm26vxv
Tags: 5.0.4-3
* Fix LSB initscript header to use keywords that
  insserv knows about. Closes: #541841.
* Bump Standards version to 3.8.3.
  * Add README.source.

* Upload sponsored by Petter Reinholdtsen.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## 01UPSTREAM_autofs-5.0.4-always-read-file-maps-multi-map-fix.patch
 
3
##
 
4
## DP: Upstream patch on top of 5.0.4.
 
5
 
 
6
@DPATCH@
 
7
autofs-5.0.4 - always read file maps multi map fix
 
8
 
 
9
From: Ian Kent <raven@themaw.net>
 
10
 
 
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.
 
15
---
 
16
 
 
17
 CHANGELOG                |    1 +
 
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(-)
 
24
 
 
25
 
 
26
diff --git a/CHANGELOG b/CHANGELOG
 
27
index 7e1012f..972ef63 100644
 
28
--- a/CHANGELOG
 
29
+++ b/CHANGELOG
 
30
@@ -47,6 +47,7 @@
 
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.
 
35
 
 
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
 
40
--- a/daemon/lookup.c
 
41
+++ b/daemon/lookup.c
 
42
@@ -278,20 +278,6 @@ static int do_read_map(struct autofs_point *ap, struct map_source *map, time_t a
 
43
        map->lookup = lookup;
 
44
        master_source_unlock(ap->entry);
 
45
 
 
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
 
49
-        * lookup handle.
 
50
-        *
 
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
 
54
-        * file scanning.
 
55
-        */
 
56
-       if (strcmp(map->type, "file") &&
 
57
-           !(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT)
 
58
-               return NSS_STATUS_SUCCESS;
 
59
-
 
60
        if (!map->stale)
 
61
                return NSS_STATUS_SUCCESS;
 
62
 
 
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);
 
70
 
 
71
+       /*
 
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.
 
75
+        */
 
76
+       if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT)
 
77
+               return NSS_STATUS_SUCCESS;
 
78
+
 
79
        mc = source->mc;
 
80
 
 
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);
 
89
 
 
90
+       /*
 
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.
 
94
+        */
 
95
+       if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT)
 
96
+               return NSS_STATUS_SUCCESS;
 
97
+
 
98
        sp.ap = ap;
 
99
        sp.age = age;
 
100
 
 
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);
 
108
 
 
109
+       /*
 
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.
 
113
+        */
 
114
+       if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT)
 
115
+               return NSS_STATUS_SUCCESS;
 
116
+
 
117
        mc = source->mc;
 
118
 
 
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);
 
127
 
 
128
+       /*
 
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.
 
132
+        */
 
133
+       if (!(ap->flags & MOUNT_FLAG_GHOST) && ap->type != LKP_DIRECT)
 
134
+               return NSS_STATUS_SUCCESS;
 
135
+
 
136
        ypcb_data.ap = ap;
 
137
        ypcb_data.source = source;
 
138
        ypcb_data.logopt = logopt;