diff -up autofs-5.0.1/modules/lookup_hosts.c.quote-exports-fix autofs-5.0.1/modules/lookup_hosts.c --- autofs-5.0.1/modules/lookup_hosts.c.quote-exports-fix 2007-12-15 13:23:34.000000000 +0900 +++ autofs-5.0.1/modules/lookup_hosts.c 2007-12-15 13:24:20.000000000 +0900 @@ -172,10 +172,11 @@ int lookup_mount(struct autofs_point *ap */ if (*name == '/') { pthread_cleanup_push(cache_lock_cleanup, mc); - mapent = alloca(strlen(me->mapent) + 1); - mapent_len = sprintf(mapent, me->mapent); + mapent_len = strlen(me->mapent); + mapent = alloca(mapent_len + 1); + if (mapent) + strcpy(mapent, me->mapent); pthread_cleanup_pop(0); - mapent[mapent_len] = '\0'; } cache_unlock(mc); diff -up autofs-5.0.1/modules/parse_sun.c.quote-exports-fix autofs-5.0.1/modules/parse_sun.c --- autofs-5.0.1/modules/parse_sun.c.quote-exports-fix 2007-12-15 13:23:45.000000000 +0900 +++ autofs-5.0.1/modules/parse_sun.c 2007-12-15 13:24:20.000000000 +0900 @@ -873,7 +873,7 @@ static int parse_mapent(const char *ent, } if (!validate_location(loc)) { - warn(logopt, MODPREFIX "invalid location"); + warn(logopt, MODPREFIX "invalid location %s", loc); free(myoptions); free(loc); return 0; @@ -1338,6 +1338,23 @@ int parse_mount(struct autofs_point *ap, int loclen; int l; + /* + * If this is an offset belonging to a multi-mount entry + * it's already been parsed (above) and any option string + * has already been stripped so just use the remainder. + */ + if (*name == '/' && + (me = cache_lookup_distinct(mc, name)) && me->multi) { + loc = strdup(p); + if (!loc) { + free(options); + warn(ap->logopt, MODPREFIX "out of memory"); + return 1; + } + loclen = strlen(p); + goto mount_it; + } + l = chunklen(p, check_colon(p)); loc = dequote(p, l, ap->logopt); if (!loc) { @@ -1355,9 +1372,9 @@ int parse_mount(struct autofs_point *ap, } if (!validate_location(loc)) { + warn(ap->logopt, MODPREFIX "invalid location %s", loc); free(loc); free(options); - warn(ap->logopt, MODPREFIX "invalid location"); return 1; } @@ -1381,10 +1398,11 @@ int parse_mount(struct autofs_point *ap, } if (!validate_location(ent)) { + warn(ap->logopt, + MODPREFIX "invalid location %s", loc); free(ent); free(loc); free(options); - warn(ap->logopt, MODPREFIX "invalid location"); return 1; } @@ -1418,7 +1436,7 @@ int parse_mount(struct autofs_point *ap, MODPREFIX "entry %s is empty!", name); return 1; } - +mount_it: debug(ap->logopt, MODPREFIX "core of entry: options=%s, loc=%.*s", options, loclen, loc);