]> git.pld-linux.org Git - packages/autofs.git/blame - autofs-5.0.2-quote-exports-fix-fix.patch
- 5.0.3 with few official patches. ldap fixes needed
[packages/autofs.git] / autofs-5.0.2-quote-exports-fix-fix.patch
CommitLineData
3d551623
PG
1diff --git a/CHANGELOG b/CHANGELOG
2index 0fcdfd4..4aa384b 100644
3--- a/CHANGELOG
4+++ b/CHANGELOG
5@@ -54,6 +54,7 @@
6 - expand support for the "%" hack.
7 - fix to quoting for exports gathered by hosts map.
8 - use mount option "nosuid" for "-hosts" map unless "suid" is explicily specified.
9+- second attempt fixing quoting for exports gathered by hosts map.
10
11 18/06/2007 autofs-5.0.2
12 -----------------------
13diff --git a/modules/lookup_hosts.c b/modules/lookup_hosts.c
14index 70b13a7..1ef420e 100644
15--- a/modules/lookup_hosts.c
16+++ b/modules/lookup_hosts.c
17@@ -179,14 +179,9 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void *
18 if (*name == '/') {
19 pthread_cleanup_push(cache_lock_cleanup, mc);
20 mapent_len = strlen(me->mapent);
21- mapent = alloca(mapent_len + 3);
22- if (mapent) {
23- /* Add quotes to keep the parser happy */
24- mapent[0] = '"';
25- strcpy(mapent + 1, me->mapent);
26- mapent[mapent_len + 1] = '"';
27- mapent[mapent_len + 2] = '\0';
28- }
29+ mapent = alloca(mapent_len + 1);
30+ if (mapent)
31+ strcpy(mapent, me->mapent);
32 pthread_cleanup_pop(0);
33 }
34 cache_unlock(mc);
35diff --git a/modules/parse_sun.c b/modules/parse_sun.c
36index 9a97329..a97a7aa 100644
37--- a/modules/parse_sun.c
38+++ b/modules/parse_sun.c
39@@ -878,7 +878,7 @@ static int parse_mapent(const char *ent, char *g_options, char **options, char *
40 }
41
42 if (!validate_location(loc)) {
43- warn(logopt, MODPREFIX "invalid location");
44+ warn(logopt, MODPREFIX "invalid location %s", loc);
45 free(myoptions);
46 free(loc);
47 return 0;
48@@ -913,7 +913,7 @@ static int parse_mapent(const char *ent, char *g_options, char **options, char *
49
50 if (!validate_location(ent_chunk)) {
51 warn(logopt,
52- MODPREFIX "invalid location %s", ent);
53+ MODPREFIX "invalid location %s", ent_chunk);
54 free(ent_chunk);
55 free(myoptions);
56 free(loc);
57@@ -1344,6 +1344,23 @@ int parse_mount(struct autofs_point *ap, const char *name,
58 int loclen;
59 int l;
60
61+ /*
62+ * If this is an offset belonging to a multi-mount entry
63+ * it's already been parsed (above) and any option string
64+ * has already been stripped so just use the remainder.
65+ */
66+ if (*name == '/' &&
67+ (me = cache_lookup_distinct(mc, name)) && me->multi) {
68+ loc = strdup(p);
69+ if (!loc) {
70+ free(options);
71+ warn(ap->logopt, MODPREFIX "out of memory");
72+ return 1;
73+ }
74+ loclen = strlen(p);
75+ goto mount_it;
76+ }
77+
78 l = chunklen(p, check_colon(p));
79 loc = dequote(p, l, ap->logopt);
80 if (!loc) {
81@@ -1361,9 +1378,9 @@ int parse_mount(struct autofs_point *ap, const char *name,
82 }
83
84 if (!validate_location(loc)) {
85+ warn(ap->logopt, MODPREFIX "invalid location %s", loc);
86 free(loc);
87 free(options);
88- warn(ap->logopt, MODPREFIX "invalid location");
89 return 1;
90 }
91
92@@ -1387,10 +1404,11 @@ int parse_mount(struct autofs_point *ap, const char *name,
93 }
94
95 if (!validate_location(ent)) {
96+ warn(ap->logopt,
97+ MODPREFIX "invalid location %s", loc);
98 free(ent);
99 free(loc);
100 free(options);
101- warn(ap->logopt, MODPREFIX "invalid location");
102 return 1;
103 }
104
105@@ -1424,7 +1442,7 @@ int parse_mount(struct autofs_point *ap, const char *name,
106 MODPREFIX "entry %s is empty!", name);
107 return 1;
108 }
109-
110+mount_it:
111 debug(ap->logopt,
112 MODPREFIX "core of entry: options=%s, loc=%.*s",
113 options, loclen, loc);
This page took 0.03805 seconds and 4 git commands to generate.