aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Kent <raven@themaw.net>2021-11-25 10:22:58 +0800
committerIan Kent <raven@themaw.net>2022-01-21 16:03:22 +0800
commit90b8eb7c7787d4290694ba2b09946eadd5b41626 (patch)
tree921ee2ecf583af46af2f7facee811605e067969f
parent962cf36aa3e6b93171908e4e15a8a988369bed23 (diff)
downloadautofs-90b8eb7c7787d4290694ba2b09946eadd5b41626.tar.gz
autofs-5.1.8 - dont fail on duplicate host export entry
If we encounter a duplicate host export entry don't fail, just ignore it and return the duplicate. Signed-off-by: Ian Kent <raven@themaw.net>
-rw-r--r--CHANGELOG1
-rw-r--r--lib/mounts.c6
2 files changed, 5 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index bd1f672c..aaf20cd6 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -5,6 +5,7 @@
- fix root offset error handling.
- fix fix root offset error handling.
- fix nonstrict fail handling of last offset mount.
+- dont fail on duplicate offset entry tree add.
19/10/2021 autofs-5.1.8
- add xdr_exports().
diff --git a/lib/mounts.c b/lib/mounts.c
index b4229908..451849a6 100644
--- a/lib/mounts.c
+++ b/lib/mounts.c
@@ -1341,7 +1341,7 @@ static struct tree_node *tree_add_node(struct tree_node *root, void *ptr)
}
if (!eq)
- error(LOGOPT_ANY, "cannot add duplicate entry to tree");
+ return p;
else {
if (eq < 0)
return tree_add_left(p, ptr);
@@ -1515,8 +1515,10 @@ static int tree_host_cmp(struct tree_node *n, void *ptr)
int eq;
eq = strcmp(exp->dir, n_exp->dir);
- if (!eq)
+ if (!eq) {
+ error(LOGOPT_ANY, "duplicate entry %s ignored", exp->dir);
return 0;
+ }
return (exp_len < n_exp_len) ? -1 : 1;
}