linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trond Myklebust <trondmy@gmail.com>
To: Steve Dickson <SteveD@redhat.com>
Cc: "J. Bruce Fields" <bfields@redhat.com>, linux-nfs@vger.kernel.org
Subject: [PATCH v2 1/3] mountd: Fix up incorrect comparison in next_mnt()
Date: Tue,  4 Jun 2019 13:57:32 -0400	[thread overview]
Message-ID: <20190604175734.98657-2-trond.myklebust@hammerspace.com> (raw)
In-Reply-To: <20190604175734.98657-1-trond.myklebust@hammerspace.com>

We want to ensure that we compare the full name of the last component.

Reported-by: "J. Bruce Fields" <bfields@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
---
 utils/mountd/cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
index d818c971bded..d616d526667e 100644
--- a/utils/mountd/cache.c
+++ b/utils/mountd/cache.c
@@ -400,7 +400,7 @@ static char *next_mnt(void **v, char *p)
 	while ((me = getmntent(f)) != NULL && l > 1) {
 		mnt_dir = nfsd_path_strip_root(me->mnt_dir);
 
-		if (strncmp(mnt_dir, p, l) == 0 && mnt_dir[l] != '/')
+		if (strncmp(mnt_dir, p, l) == 0 && mnt_dir[l] == '/')
 			return mnt_dir;
 	}
 	endmntent(f);
-- 
2.21.0


  reply	other threads:[~2019-06-04 17:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-04 17:57 [PATCH v2 0/3] Incremental against [exports] rootdir patchset Trond Myklebust
2019-06-04 17:57 ` Trond Myklebust [this message]
2019-06-04 17:57   ` [PATCH v2 2/3] mountd: Ensure nfsd_path_strip_root() uses the canonicalised path Trond Myklebust
2019-06-04 17:57     ` [PATCH v2 3/3] mountd: Canonicalise the rootdir in exportent_mkrealpath() Trond Myklebust

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190604175734.98657-2-trond.myklebust@hammerspace.com \
    --to=trondmy@gmail.com \
    --cc=SteveD@redhat.com \
    --cc=bfields@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).