Blame SOURCES/nfs-utils-1.3.0-exportfs-slashes.patch

e19a30
diff -up nfs-utils-1.3.0/utils/exportfs/exportfs.c.orig nfs-utils-1.3.0/utils/exportfs/exportfs.c
e19a30
--- nfs-utils-1.3.0/utils/exportfs/exportfs.c.orig	2016-05-03 10:50:17.226864000 -0400
e19a30
+++ nfs-utils-1.3.0/utils/exportfs/exportfs.c	2016-05-03 10:51:49.848199000 -0400
e19a30
@@ -402,8 +402,17 @@ unexportfs_parsed(char *hname, char *pat
e19a30
 			hname = ai->ai_canonname;
e19a30
 	}
e19a30
 
e19a30
+	/*
e19a30
+	 * It's possible the specified path ends with a '/'. But
e19a30
+	 * the entry from exportlist won't has the trailing '/',
e19a30
+	 * so need to deal with it.
e19a30
+	*/
e19a30
+	size_t nlen = strlen(path);
e19a30
+	while (path[nlen - 1] == '/')
e19a30
+		nlen--;
e19a30
+
e19a30
 	for (exp = exportlist[htype].p_head; exp; exp = exp->m_next) {
e19a30
-		if (path && strcmp(path, exp->m_export.e_path))
e19a30
+		if (path && strncmp(path, exp->m_export.e_path, nlen))
e19a30
 			continue;
e19a30
 		if (htype != exp->m_client->m_type)
e19a30
 			continue;