You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
839 B
22 lines
839 B
diff -up nfs-utils-1.3.0/utils/exportfs/exportfs.c.orig nfs-utils-1.3.0/utils/exportfs/exportfs.c |
|
--- nfs-utils-1.3.0/utils/exportfs/exportfs.c.orig 2016-05-03 10:50:17.226864000 -0400 |
|
+++ nfs-utils-1.3.0/utils/exportfs/exportfs.c 2016-05-03 10:51:49.848199000 -0400 |
|
@@ -402,8 +402,17 @@ unexportfs_parsed(char *hname, char *pat |
|
hname = ai->ai_canonname; |
|
} |
|
|
|
+ /* |
|
+ * It's possible the specified path ends with a '/'. But |
|
+ * the entry from exportlist won't has the trailing '/', |
|
+ * so need to deal with it. |
|
+ */ |
|
+ size_t nlen = strlen(path); |
|
+ while (path[nlen - 1] == '/') |
|
+ nlen--; |
|
+ |
|
for (exp = exportlist[htype].p_head; exp; exp = exp->m_next) { |
|
- if (path && strcmp(path, exp->m_export.e_path)) |
|
+ if (path && strncmp(path, exp->m_export.e_path, nlen)) |
|
continue; |
|
if (htype != exp->m_client->m_type) |
|
continue;
|
|
|