Skip to contentSkip to conversation

mount.nfs: submarvellous messages from mount.nfs

PATCH In review Steve Dickson 1 participant 2 messages Aug 16, 2011

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

PATCH 1/1 mount.nfs: submarvellous messages from mount.nfs

From: Max Matveev <[email protected]>

Consider a setup where mountd on the server is controlled via tcp_wrappers (usual RHEL setup) and will not process calls from a particular client because of something in /etc/hosts.deny.

When such client attempts to do v3 mount, the error message printed by mount.nfs is misleading.

This patch changes that error message from:
mount.nfs: Argument list too long
to
mount.nfs: access denied by server while mounting server:/export

---
 utils/mount/stropts.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
utils/mount/stropts.c +2 -0
index f1aa503..4d023d6 100644
@@ -538,6 +538,8 @@ nfs_rewrite_pmap_mount_options(struct mount_options *options)
 		errno = ESPIPE;
 		if (rpc_createerr.cf_stat == RPC_PROGNOTREGISTERED)
 			errno = EOPNOTSUPP;
+		else if (rpc_createerr.cf_stat == RPC_AUTHERROR)
+			errno = EACCES;
 		else if (rpc_createerr.cf_error.re_errno != 0)
 			errno = rpc_createerr.cf_error.re_errno;
 		return 0;
Signature · 1 line
1.7.6
#1 lore raw
Quoted 9 lines · Steve Dickson

From: Max Matveev <[email protected]>

Consider a setup where mountd on the server is controlled via tcp_wrappers (usual RHEL setup) and will not process calls from a particular client because of something in /etc/hosts.deny.

When such client attempts to do v3 mount, the error message printed by mount.nfs is misleading.

Quoted 6 lines

This patch changes that error message from:
mount.nfs: Argument list too long
to
mount.nfs: access denied by server while mounting server:/export

Committed...

steved.

Quoted 17 lines
---
 utils/mount/stropts.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
utils/mount/stropts.c +2 -0
index f1aa503..4d023d6 100644
@@ -538,6 +538,8 @@ nfs_rewrite_pmap_mount_options(struct mount_options *options)
 		errno = ESPIPE;
 		if (rpc_createerr.cf_stat == RPC_PROGNOTREGISTERED)
 			errno = EOPNOTSUPP;
+		else if (rpc_createerr.cf_stat == RPC_AUTHERROR)
+			errno = EACCES;
 		else if (rpc_createerr.cf_error.re_errno != 0)
 			errno = rpc_createerr.cf_error.re_errno;
 		return 0;