autofs-5.0.9 - check for non existent negative entries in lookup_ghost() From: Ian Kent Map entries that have been created in the cache due to a negative lookup but don't exist in the map source shouldn't have directories created. In fact map entries that are negative shouldn't have directories created at all since they should have neen created befor the entry became negative. --- CHANGELOG | 1 + daemon/lookup.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 5cc1506..8d0d56c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,7 @@ ======================= - fix mistake in assignment. - add amd map format parser. +- check for non existent negative entries in lookup_ghost(). 28/03/2014 autofs-5.0.9 ======================= diff --git a/daemon/lookup.c b/daemon/lookup.c index 999be9d..9f96830 100644 --- a/daemon/lookup.c +++ b/daemon/lookup.c @@ -716,6 +716,14 @@ int lookup_ghost(struct autofs_point *ap, const char *root) cache_readlock(mc); me = cache_enumerate(mc, NULL); while (me) { + /* + * Map entries that have been created in the cache + * due to a negative lookup shouldn't have directories + * created if they haven't already been created. + */ + if (!me->mapent) + goto next; + if (!strcmp(me->key, "*")) goto next;