autofs-5.0.4 - always read file maps key lookup fixes From: Ian Kent Since we always read file maps at start we need to ensure that we return a not found if the key isn't found in the cache. Also, if we're looking through a "multi" map we can't use the cache lookup optimisation because, in this case, there is a single map source shared by the "multi" maps so we may not get correct results from the lookup if a map later in the search has been modified. --- CHANGELOG | 1 + modules/lookup_file.c | 17 +++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 972ef63..5000f0c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -48,6 +48,7 @@ - improve manual umount recovery. - dont fail on ipv6 address when adding host. - always read file maps multi map fix. +- always read file maps key lookup fixes. 4/11/2008 autofs-5.0.4 ----------------------- diff --git a/modules/lookup_file.c b/modules/lookup_file.c index bd30bc5..a4ca39d 100644 --- a/modules/lookup_file.c +++ b/modules/lookup_file.c @@ -1003,13 +1003,15 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * * If any map instances are present for this source * then either we have plus included entries or we * are looking through the list of nsswitch sources. - * In either case we cannot avoid reading through the - * map because we must preserve the key order over - * multiple sources. But also, we can't know, at this - * point, if a source instance has been changed since - * the last time we checked it. + * In either case, or if it's a "multi" source, we + * cannot avoid reading through the map because we + * must preserve the key order over multiple sources + * or maps. But also, we can't know, at this point, + * if a source instance has been changed since the + * last time we checked it. */ - if (!source->instance) + if (!source->instance && + source->type && strcmp(source->type, "multi")) goto do_cache_lookup; } else source->stale = 1; @@ -1055,6 +1057,9 @@ do_cache_lookup: } cache_unlock(mc); + if (!me) + return NSS_STATUS_NOTFOUND; + if (!mapent) return NSS_STATUS_TRYAGAIN;