]> git.pld-linux.org Git - packages/autofs.git/blame - autofs-5.0.2-quote-exports.patch
- rel.1, lets try
[packages/autofs.git] / autofs-5.0.2-quote-exports.patch
CommitLineData
3d551623
PG
1diff --git a/CHANGELOG b/CHANGELOG
2index 2ce58b4..903e619 100644
3--- a/CHANGELOG
4+++ b/CHANGELOG
5@@ -7,6 +7,7 @@
6 - change random multiple server selection option name to be consistent
7 with existing downstream version 4 naming.
8 - fix mount point directory creation for bind mounts.
9+- add 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 a9a4c75..1f8fa15 100644
15--- a/modules/lookup_hosts.c
16+++ b/modules/lookup_hosts.c
17@@ -215,7 +215,7 @@ done:
18 if (mapent) {
19 int len = strlen(mapent) + 1;
20
21- len += strlen(name) + 2*strlen(exp->ex_dir) + 3;
22+ len += strlen(name) + 2*(strlen(exp->ex_dir) + 2) + 3;
23 mapent = realloc(mapent, len);
24 if (!mapent) {
25 char *estr;
26@@ -224,10 +224,11 @@ done:
27 rpc_exports_free(exp);
28 return NSS_STATUS_UNAVAIL;
29 }
30- strcat(mapent, " ");
31+ strcat(mapent, " \"");
32 strcat(mapent, exp->ex_dir);
33+ strcat(mapent, "\"");
34 } else {
35- int len = 2*strlen(exp->ex_dir) + strlen(name) + 3;
36+ int len = 2*(strlen(exp->ex_dir) + 2) + strlen(name) + 3;
37
38 mapent = malloc(len);
39 if (!mapent) {
40@@ -237,12 +238,15 @@ done:
41 rpc_exports_free(exp);
42 return NSS_STATUS_UNAVAIL;
43 }
44- strcpy(mapent, exp->ex_dir);
45+ strcpy(mapent, "\"");
46+ strcat(mapent, exp->ex_dir);
47+ strcat(mapent, "\"");
48 }
49- strcat(mapent, " ");
50+ strcat(mapent, " \"");
51 strcat(mapent, name);
52 strcat(mapent, ":");
53 strcat(mapent, exp->ex_dir);
54+ strcat(mapent, "\"");
55
56 exp = exp->ex_next;
57 }
58@@ -260,13 +264,9 @@ done:
59 cache_update(mc, source, name, mapent, now);
60 cache_unlock(mc);
61
62- debug(LOGOPT_ANY, "source wait");
63-
64 master_source_current_wait(ap->entry);
65 ap->entry->current = source;
66
67- debug(LOGOPT_ANY, "do parse_mount");
68-
69 ret = ctxt->parse->parse_mount(ap, name, name_len,
70 mapent, ctxt->parse->context);
71 free(mapent);
This page took 0.061958 seconds and 4 git commands to generate.