aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Kent <raven@themaw.net>2021-05-28 18:31:08 +0800
committerIan Kent <raven@themaw.net>2021-05-31 08:21:33 +0800
commita7c25903f76b6c5326185daca1642467bdf7ed54 (patch)
tree2868e227a14827ba8a96c8ab8360009f93206b8b
parent26a458b14161bc629ae198754e7e6cd2d3c09b9a (diff)
downloadautofs-a7c25903f76b6c5326185daca1642467bdf7ed54.tar.gz
autofs-5.1.7 - fix lookup_prune_one_cache() refactoring change
Commit 256963d6b (autofs-5.1.7 - refactor lookup_prune_one_cache() a bit) changed the position of the getting the next enumeration map entry but failed to update a couple of other locations that assume the next map entry has been set. Under certain fairly common conditions this leads to an infinite loop. Signed-off-by: Ian Kent <raven@themaw.net>
-rw-r--r--CHANGELOG1
-rw-r--r--daemon/lookup.c5
2 files changed, 5 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 51e7767e..698cc27a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -69,6 +69,7 @@
- fix amd section mounts map reload.
- fix dandling symlink creation if nis support is not available.
- dont use AUTOFS_DEV_IOCTL_CLOSEMOUNT.
+- fix lookup_prune_one_cache() refactoring change.
25/01/2021 autofs-5.1.7
- make bind mounts propagation slave by default.
diff --git a/daemon/lookup.c b/daemon/lookup.c
index 3e9722e4..0b281f83 100644
--- a/daemon/lookup.c
+++ b/daemon/lookup.c
@@ -1379,6 +1379,7 @@ void lookup_prune_one_cache(struct autofs_point *ap, struct mapent_cache *mc, ti
if (!key || strchr(key, '*')) {
if (key)
free(key);
+ me = cache_enumerate(mc, me);
continue;
}
@@ -1386,6 +1387,7 @@ void lookup_prune_one_cache(struct autofs_point *ap, struct mapent_cache *mc, ti
if (!path) {
warn(ap->logopt, "can't malloc storage for path");
free(key);
+ me = cache_enumerate(mc, me);
continue;
}
@@ -1413,9 +1415,10 @@ void lookup_prune_one_cache(struct autofs_point *ap, struct mapent_cache *mc, ti
}
if (!valid &&
is_mounted(path, MNTS_REAL)) {
- debug(ap->logopt, "prune posponed, %s mounted", path);
+ debug(ap->logopt, "prune postponed, %s mounted", path);
free(key);
free(path);
+ me = cache_enumerate(mc, me);
continue;
}
if (valid)