Blame SOURCES/autofs-5.1.8-dont-fail-on-duplicate-host-export-entry.patch

91594d
autofs-5.1.8 - dont fail on duplicate host export entry
91594d
91594d
From: Ian Kent <raven@themaw.net>
91594d
91594d
If we encounter a duplicate host export entry don't fail, just ignore
91594d
it and return the duplicate.
91594d
91594d
Signed-off-by: Ian Kent <raven@themaw.net>
91594d
---
91594d
 CHANGELOG    |    1 +
91594d
 lib/mounts.c |    6 ++++--
91594d
 2 files changed, 5 insertions(+), 2 deletions(-)
91594d
91594d
--- autofs-5.1.7.orig/CHANGELOG
91594d
+++ autofs-5.1.7/CHANGELOG
91594d
@@ -87,6 +87,7 @@
91594d
 - fix root offset error handling.
91594d
 - fix fix root offset error handling.
91594d
 - fix nonstrict fail handling of last offset mount.
91594d
+- dont fail on duplicate offset entry tree add.
91594d
 
91594d
 25/01/2021 autofs-5.1.7
91594d
 - make bind mounts propagation slave by default.
91594d
--- autofs-5.1.7.orig/lib/mounts.c
91594d
+++ autofs-5.1.7/lib/mounts.c
91594d
@@ -1341,7 +1341,7 @@ static struct tree_node *tree_add_node(s
91594d
 	}
91594d
 
91594d
 	if (!eq)
91594d
-		error(LOGOPT_ANY, "cannot add duplicate entry to tree");
91594d
+		return p;
91594d
 	else {
91594d
 		if (eq < 0)
91594d
 			return tree_add_left(p, ptr);
91594d
@@ -1515,8 +1515,10 @@ static int tree_host_cmp(struct tree_nod
91594d
 	int eq;
91594d
 
91594d
 	eq = strcmp(exp->dir, n_exp->dir);
91594d
-	if (!eq)
91594d
+	if (!eq) {
91594d
+		error(LOGOPT_ANY, "duplicate entry %s ignored", exp->dir);
91594d
 		return 0;
91594d
+	}
91594d
 	return (exp_len < n_exp_len) ? -1 : 1;
91594d
 }
91594d