Skip to contentSkip to conversation

exportfs: Messages indicating unsupported operation that works

DISCUSSION Tony Asleson 2 participants 2 messages Dec 16, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

When I try to export a directory that has a space in it I get the following:

# exportfs *:"/mnt/has space"
exportfs: /mnt/has space does not support NFS export

exit code is 0.

If I do:

# exportfs -v
/mnt/has space	<world>(ro,wdelay,root_squash,no_subtree_check,
sec=sys,ro,secure,root_squash,no_all_squash)

It exists and I can mount it from a client and everything appears fine.

I took a peek at the code and we are failing in test_export. We are getting a -1 returned when we write to: /proc/net/rpc/nfsd.export/channel .

This seems like a confusing message when it appears that everything is working, thoughts?

Notes:
- Kernel Linux rawhide 3.13.0-0.rc3.git1.2.fc21.x86_64
- nfs-utils: Latest from git, but this happens on older released versions tested too.

Thanks,
Tony

#1 lore raw
Quoted 18 lines · Tony Asleson

When I try to export a directory that has a space in it I get the following:

# exportfs *:"/mnt/has space"
exportfs: /mnt/has space does not support NFS export

exit code is 0.

If I do:

# exportfs -v
/mnt/has space	<world>(ro,wdelay,root_squash,no_subtree_check,
sec=sys,ro,secure,root_squash,no_all_squash)

It exists and I can mount it from a client and everything appears fine.

I took a peek at the code and we are failing in test_export. We are getting a -1 returned when we write to: /proc/net/rpc/nfsd.export/channel .

Quoted 7 lines

This seems like a confusing message when it appears that everything is working, thoughts?

Notes:
- Kernel Linux rawhide 3.13.0-0.rc3.git1.2.fc21.x86_64
- nfs-utils: Latest from git, but this happens on older released versions tested too.

test_export clearly isn't escaping the pathname. It probably needs something like the following (completely untested).

--b.

utils/exportfs/exportfs.c +7 -3
index 4331697..d5dfb0b 100644
@@ -418,11 +418,15 @@ static int can_test(void)
 static int test_export(char *path, int with_fsid)
 {
 	char buf[1024];
+	char *bp = buf;
+	int len = sizeof(buf);
 	int fd, n;
 
-	sprintf(buf, "-test-client- %s 3 %d 65534 65534 0\n",
-		path,
-		with_fsid ? NFSEXP_FSID : 0);
+	n = sprintf(buf, "-test-client- ");
+	bp += n;
+	len -= n;
+	qword_add(&bp, &len, path);
+	sprintf(bp, " 3 %d 65534 65534 0\n", with_fsid ? NFSEXP_FSID : 0);
 	fd = open("/proc/net/rpc/nfsd.export/channel", O_WRONLY);
 	if (fd < 0)
 		return 0;