File 0001-mountd-fix-next_mnt-handling-for.patch of Package nfs-utils.3350

From 1e4a4c3816ca5a1e1a345117a201d9cc6c468beb Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.de>
Date: Wed, 25 Feb 2015 16:47:56 -0500
Subject: [PATCH] mountd: fix next_mnt handling for "/"

If the (exported) path passed to next_mnt() is simply "/", next_mnt()
will not report any children, as none start with "/" followed by a '/'.
So make a special case for strlen(p)==1.  In that case, return all
children.

This gives correct handling if only "/" is exported.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Steve Dickson <steved@redhat.com>
---
 utils/mountd/cache.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/utils/mountd/cache.c
+++ b/utils/mountd/cache.c
@@ -365,7 +365,7 @@ static char *next_mnt(void **v, char *p)
 		*v = f;
 	} else
 		f = *v;
-	while ((me = getmntent(f)) != NULL &&
+	while ((me = getmntent(f)) != NULL && l > 1 &&
 	       (strncmp(me->mnt_dir, p, l) != 0 ||
 		me->mnt_dir[l] != '/'))
 		;