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

229406
autofs-5.1.8 - dont fail on duplicate host export entry
229406
229406
From: Ian Kent <raven@themaw.net>
229406
229406
If we encounter a duplicate host export entry don't fail, just ignore
229406
it and return the duplicate.
229406
229406
Signed-off-by: Ian Kent <raven@themaw.net>
229406
---
229406
 CHANGELOG    |    1 +
229406
 lib/mounts.c |    6 ++++--
229406
 2 files changed, 5 insertions(+), 2 deletions(-)
229406
229406
--- autofs-5.1.4.orig/CHANGELOG
229406
+++ autofs-5.1.4/CHANGELOG
229406
@@ -85,6 +85,7 @@
229406
 - fix double quoting of ampersand in auto.smb as well.
229406
 - fix root offset error handling.
229406
 - fix nonstrict fail handling of last offset mount.
229406
+- dont fail on duplicate offset entry tree add.
229406
 
229406
 xx/xx/2018 autofs-5.1.5
229406
 - fix flag file permission.
229406
--- autofs-5.1.4.orig/lib/mounts.c
229406
+++ autofs-5.1.4/lib/mounts.c
229406
@@ -1341,7 +1341,7 @@ static struct tree_node *tree_add_node(s
229406
 	}
229406
 
229406
 	if (!eq)
229406
-		error(LOGOPT_ANY, "cannot add duplicate entry to tree");
229406
+		return p;
229406
 	else {
229406
 		if (eq < 0)
229406
 			return tree_add_left(p, ptr);
229406
@@ -1515,8 +1515,10 @@ static int tree_host_cmp(struct tree_nod
229406
 	int eq;
229406
 
229406
 	eq = strcmp(exp->dir, n_exp->dir);
229406
-	if (!eq)
229406
+	if (!eq) {
229406
+		error(LOGOPT_ANY, "duplicate entry %s ignored", exp->dir);
229406
 		return 0;
229406
+	}
229406
 	return (exp_len < n_exp_len) ? -1 : 1;
229406
 }
229406