From f46bbf2136eaf2fa452c01b0352528ea169759c9 Mon Sep 17 00:00:00 2001 From: Scott Mayhew Date: Sat, 17 Dec 2016 13:42:08 -0500 Subject: exportfs: fix path comparison in unexportfs_parsed() Passing a path like /export1 to unexportfs_parsed() matches not only /export1, but /export11, /export100, /export1forthemoney, etc. which can result in some nasty surprises when unexporting individual exports. Signed-off-by: Scott Mayhew Signed-off-by: Steve Dickson --- utils/exportfs/exportfs.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'utils/exportfs/exportfs.c') diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c index b7a910e..a763272 100644 --- a/utils/exportfs/exportfs.c +++ b/utils/exportfs/exportfs.c @@ -345,6 +345,8 @@ unexportfs_parsed(char *hname, char *path, int verbose) nlen--; for (exp = exportlist[htype].p_head; exp; exp = exp->m_next) { + if (strlen(exp->m_export.e_path) != nlen) + continue; if (path && strncmp(path, exp->m_export.e_path, nlen)) continue; if (htype != exp->m_client->m_type) -- cgit