Ian Kent 28f861
diff --git a/modules/lookup_hosts.c b/modules/lookup_hosts.c
Ian Kent 28f861
index a9a4c75..1f8fa15 100644
Ian Kent 28f861
--- a/modules/lookup_hosts.c
Ian Kent 28f861
+++ b/modules/lookup_hosts.c
Ian Kent 28f861
@@ -215,7 +215,7 @@ done:
Ian Kent 28f861
 		if (mapent) {
Ian Kent 28f861
 			int len = strlen(mapent) + 1;
Ian Kent 28f861
 
Ian Kent 28f861
-			len += strlen(name) + 2*strlen(exp->ex_dir) + 3;
Ian Kent 28f861
+			len += strlen(name) + 2*(strlen(exp->ex_dir) + 2) + 3;
Ian Kent 28f861
 			mapent = realloc(mapent, len);
Ian Kent 28f861
 			if (!mapent) {
Ian Kent 28f861
 				char *estr;
Ian Kent 28f861
@@ -224,10 +224,11 @@ done:
Ian Kent 28f861
 				rpc_exports_free(exp);
Ian Kent 28f861
 				return NSS_STATUS_UNAVAIL;
Ian Kent 28f861
 			}
Ian Kent 28f861
-			strcat(mapent, " ");
Ian Kent 28f861
+			strcat(mapent, " \"");
Ian Kent 28f861
 			strcat(mapent, exp->ex_dir);
Ian Kent 28f861
+			strcat(mapent, "\"");
Ian Kent 28f861
 		} else {
Ian Kent 28f861
-			int len = 2*strlen(exp->ex_dir) + strlen(name) + 3;
Ian Kent 28f861
+			int len = 2*(strlen(exp->ex_dir) + 2) + strlen(name) + 3;
Ian Kent 28f861
 
Ian Kent 28f861
 			mapent = malloc(len);
Ian Kent 28f861
 			if (!mapent) {
Ian Kent 28f861
@@ -237,12 +238,15 @@ done:
Ian Kent 28f861
 				rpc_exports_free(exp);
Ian Kent 28f861
 				return NSS_STATUS_UNAVAIL;
Ian Kent 28f861
 			}
Ian Kent 28f861
-			strcpy(mapent, exp->ex_dir);
Ian Kent 28f861
+			strcpy(mapent, "\"");
Ian Kent 28f861
+			strcat(mapent, exp->ex_dir);
Ian Kent 28f861
+			strcat(mapent, "\"");
Ian Kent 28f861
 		}
Ian Kent 28f861
-		strcat(mapent, " ");
Ian Kent 28f861
+		strcat(mapent, " \"");
Ian Kent 28f861
 		strcat(mapent, name);
Ian Kent 28f861
 		strcat(mapent, ":");
Ian Kent 28f861
 		strcat(mapent, exp->ex_dir);
Ian Kent 28f861
+		strcat(mapent, "\"");
Ian Kent 28f861
 
Ian Kent 28f861
 		exp = exp->ex_next;
Ian Kent 28f861
 	}
Ian Kent 28f861
@@ -260,13 +264,9 @@ done:
Ian Kent 28f861
 	cache_update(mc, source, name, mapent, now);
Ian Kent 28f861
 	cache_unlock(mc);
Ian Kent 28f861
 
Ian Kent 28f861
-	debug(LOGOPT_ANY, "source wait");
Ian Kent 28f861
-
Ian Kent 28f861
 	master_source_current_wait(ap->entry);
Ian Kent 28f861
 	ap->entry->current = source;
Ian Kent 28f861
 
Ian Kent 28f861
-	debug(LOGOPT_ANY, "do parse_mount");
Ian Kent 28f861
-
Ian Kent 28f861
 	ret = ctxt->parse->parse_mount(ap, name, name_len,
Ian Kent 28f861
 				 mapent, ctxt->parse->context);
Ian Kent 28f861
 	free(mapent);