linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] exportfs: fix export point checking
@ 2016-07-09  5:15 Jianhong.Yin
  2016-07-18 17:33 ` Steve Dickson
  0 siblings, 1 reply; 3+ messages in thread
From: Jianhong.Yin @ 2016-07-09  5:15 UTC (permalink / raw)
  To: linux-nfs; +Cc: steved, Jianhong.Yin, Jianhong Yin

NFS does not support file and symbolic export, if the export point
is regular file should give warning to user.

Signed-off-by: Jianhong Yin <jiyin@redhat.com>
---
 utils/exportfs/exportfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c
index 5db348b..a00b5ea 100644
--- a/utils/exportfs/exportfs.c
+++ b/utils/exportfs/exportfs.c
@@ -585,8 +585,8 @@ validate_export(nfs_export *exp)
 		xlog(L_ERROR, "Failed to stat %s: %m", path);
 		return;
 	}
-	if (!S_ISDIR(stb.st_mode) && !S_ISREG(stb.st_mode)) {
-		xlog(L_ERROR, "%s is neither a directory nor a file. "
+	if (!S_ISDIR(stb.st_mode)) {
+		xlog(L_ERROR, "%s is not a directory. "
 			"Remote access will fail", path);
 		return;
 	}
-- 
2.5.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [PATCH] exportfs: fix export point checking
@ 2016-07-14  5:35 Jianhong.Yin
  0 siblings, 0 replies; 3+ messages in thread
From: Jianhong.Yin @ 2016-07-14  5:35 UTC (permalink / raw)
  To: linux-nfs; +Cc: steved, Jianhong.Yin

NFS does not support regular file export and mount,
use S_ISLNK instead S_ISREG
---
 utils/exportfs/exportfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c
index 5db348b..74baa08 100644
--- a/utils/exportfs/exportfs.c
+++ b/utils/exportfs/exportfs.c
@@ -585,8 +585,8 @@ validate_export(nfs_export *exp)
 		xlog(L_ERROR, "Failed to stat %s: %m", path);
 		return;
 	}
-	if (!S_ISDIR(stb.st_mode) && !S_ISREG(stb.st_mode)) {
-		xlog(L_ERROR, "%s is neither a directory nor a file. "
+	if (!S_ISDIR(stb.st_mode) && !S_ISLNK(stb.st_mode)) {
+		xlog(L_ERROR, "%s is neither a directory nor a symlink. "
 			"Remote access will fail", path);
 		return;
 	}
-- 
2.5.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-18 17:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-09  5:15 [PATCH] exportfs: fix export point checking Jianhong.Yin
2016-07-18 17:33 ` Steve Dickson
  -- strict thread matches above, loose matches on Subject: below --
2016-07-14  5:35 Jianhong.Yin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).