diff options
author | Scott Mayhew <smayhew@redhat.com> | 2016-12-17 13:42:08 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2016-12-17 13:42:08 -0500 |
commit | f46bbf2136eaf2fa452c01b0352528ea169759c9 (patch) | |
tree | 466c07282fb2df454b7b25a667f94e10aa61a868 /utils/exportfs/exportfs.c | |
parent | daf0838e30f896d02ca51becc99578713c1be4cb (diff) | |
download | nfs-utils-f46bbf2136eaf2fa452c01b0352528ea169759c9.tar.gz nfs-utils-f46bbf2136eaf2fa452c01b0352528ea169759c9.tar.xz nfs-utils-f46bbf2136eaf2fa452c01b0352528ea169759c9.zip |
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 <smayhew@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/exportfs/exportfs.c')
-rw-r--r-- | utils/exportfs/exportfs.c | 2 |
1 files changed, 2 insertions, 0 deletions
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) |