From 419c44dc96ee194e77fbdf6182929cc26920ceb0 Mon Sep 17 00:00:00 2001 From: trasz Date: Thu, 25 Sep 2014 17:28:29 +0000 Subject: [PATCH] MFC r272025: Fix thinko that, with two map entries like shown below, in that order, made autofs mix them up: the second one wasn't visible in ls(1) output, and trying to access it would trigger mount for the first one. foobar host:/foobar foo host:/foo Approved by: re (gjb) Sponsored by: The FreeBSD Foundation git-svn-id: svn://svn.freebsd.org/base/stable/10@272116 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/fs/autofs/autofs_vnops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/fs/autofs/autofs_vnops.c b/sys/fs/autofs/autofs_vnops.c index e0a75fa62..392c253b8 100644 --- a/sys/fs/autofs/autofs_vnops.c +++ b/sys/fs/autofs/autofs_vnops.c @@ -544,6 +544,8 @@ autofs_node_find(struct autofs_node *parent, const char *name, TAILQ_FOREACH(anp, &parent->an_children, an_next) { if (namelen >= 0) { + if (strlen(anp->an_name) != namelen) + continue; if (strncmp(anp->an_name, name, namelen) != 0) continue; } else { -- 2.45.0