These patches fix up a couple of bugs and issues against the [exports]
rootdir patchset for nfs-utils.
Trond Myklebust (3):
mountd: Fix up incorrect comparison in next_mnt()
mountd: Ensure nfsd_path_strip_root() uses the canonicalised path
mountd: Canonicalise the rootdir in exportent_mkrealpath()
support/export/export.c | 12 ++++++++++--
support/misc/nfsd_path.c | 17 +++++++++++++----
utils/mountd/cache.c | 2 +-
3 files changed, 24 insertions(+), 7 deletions(-)
--
2.21.0
We want to ensure that we compare the full name of the last component.
Reported-by: "J. Bruce Fields" <[email protected]>
Signed-off-by: Trond Myklebust <[email protected]>
---
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
On 6/3/19 1:12 PM, Trond Myklebust wrote:
> These patches fix up a couple of bugs and issues against the [exports]
> rootdir patchset for nfs-utils.
>
> Trond Myklebust (3):
> mountd: Fix up incorrect comparison in next_mnt()
> mountd: Ensure nfsd_path_strip_root() uses the canonicalised path
> mountd: Canonicalise the rootdir in exportent_mkrealpath()
>
> support/export/export.c | 12 ++++++++++--
> support/misc/nfsd_path.c | 17 +++++++++++++----
> utils/mountd/cache.c | 2 +-
> 3 files changed, 24 insertions(+), 7 deletions(-)
>
Committed!
steved.