Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 130701790bf2d95e902edf16031ff596 > files > 259

autofs-5.0.1-0.rc2.164.el5_8.src.rpm

diff -up autofs-5.0.1/modules/lookup_hosts.c.quote-exports autofs-5.0.1/modules/lookup_hosts.c
--- autofs-5.0.1/modules/lookup_hosts.c.quote-exports	2007-10-18 16:08:23.000000000 +0800
+++ autofs-5.0.1/modules/lookup_hosts.c	2007-10-18 16:08:33.000000000 +0800
@@ -208,7 +208,7 @@ done:
 		if (mapent) {
 			int len = strlen(mapent) + 1;
 
-			len += strlen(name) + 2*strlen(exp->ex_dir) + 3;
+			len += strlen(name) + 2*(strlen(exp->ex_dir) + 2) + 3;
 			mapent = realloc(mapent, len);
 			if (!mapent) {
 				char *estr;
@@ -217,10 +217,11 @@ done:
 				rpc_exports_free(exp);
 				return NSS_STATUS_UNAVAIL;
 			}
-			strcat(mapent, " ");
+			strcat(mapent, " \"");
 			strcat(mapent, exp->ex_dir);
+			strcat(mapent, "\"");
 		} else {
-			int len = 2*strlen(exp->ex_dir) + strlen(name) + 3;
+			int len = 2*(strlen(exp->ex_dir) + 2) + strlen(name) + 3;
 
 			mapent = malloc(len);
 			if (!mapent) {
@@ -230,12 +231,15 @@ done:
 				rpc_exports_free(exp);
 				return NSS_STATUS_UNAVAIL;
 			}
-			strcpy(mapent, exp->ex_dir);
+			strcpy(mapent, "\"");
+			strcat(mapent, exp->ex_dir);
+			strcat(mapent, "\"");
 		}
-		strcat(mapent, " ");
+		strcat(mapent, " \"");
 		strcat(mapent, name);
 		strcat(mapent, ":");
 		strcat(mapent, exp->ex_dir);
+		strcat(mapent, "\"");
 
 		exp = exp->ex_next;
 	}
@@ -253,13 +257,9 @@ done:
 	cache_update(mc, source, name, mapent, now);
 	cache_unlock(mc);
 
-	debug(LOGOPT_ANY, "source wait");
-
 	master_source_current_wait(ap->entry);
 	ap->entry->current = source;
 
-	debug(LOGOPT_ANY, "do parse_mount");
-
 	ret = ctxt->parse->parse_mount(ap, name, name_len,
 				 mapent, ctxt->parse->context);
 	free(mapent);