summaryrefslogtreecommitdiffstats
path: root/usr.sbin/autofs
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2014-12-14 10:49:22 +0000
committertrasz <trasz@FreeBSD.org>2014-12-14 10:49:22 +0000
commitcb41c48320b2ebfc233bd4b72b1f70c3be279a72 (patch)
tree66b6a8c4084c63ab4ab5009743a54e4cdf4847dc /usr.sbin/autofs
parent1660bc111a05cbe86286f0daef65bc8e4c9564ab (diff)
downloadFreeBSD-src-cb41c48320b2ebfc233bd4b72b1f70c3be279a72.zip
FreeBSD-src-cb41c48320b2ebfc233bd4b72b1f70c3be279a72.tar.gz
Fix bug that made automount(8) never unmount stale autofs(5) mounts,
ie mounts for entries that were there in auto_master(5), and then got removed. MFC after: 1 month Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'usr.sbin/autofs')
-rw-r--r--usr.sbin/autofs/common.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/usr.sbin/autofs/common.c b/usr.sbin/autofs/common.c
index 6fd8a05..8ace69d 100644
--- a/usr.sbin/autofs/common.c
+++ b/usr.sbin/autofs/common.c
@@ -676,8 +676,8 @@ node_print(const struct node *n)
node_print_indent(child, 0);
}
-struct node *
-node_find(struct node *node, const char *path)
+static struct node *
+node_find_x(struct node *node, const char *path)
{
struct node *child, *found;
char *tmp;
@@ -702,7 +702,7 @@ node_find(struct node *node, const char *path)
free(tmp);
TAILQ_FOREACH(child, &node->n_children, n_next) {
- found = node_find(child, path);
+ found = node_find_x(child, path);
if (found != NULL)
return (found);
}
@@ -710,6 +710,17 @@ node_find(struct node *node, const char *path)
return (node);
}
+struct node *
+node_find(struct node *root, const char *path)
+{
+ struct node *node;
+
+ node = node_find_x(root, path);
+ if (node == root)
+ return (NULL);
+ return (node);
+}
+
/*
* Canonical form of a map entry looks like this:
*
OpenPOWER on IntegriCloud