Linux NFS development
 help / color / mirror / Atom feed
* [PATCH nfs-utils] Give useful error if mount.nfs not installed setuid.
@ 2008-05-08  4:17 Neil Brown
       [not found] ` <18466.32444.577468.951202-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Neil Brown @ 2008-05-08  4:17 UTC (permalink / raw)
  To: linux-nfs; +Cc: Steve Dickson


If mount.nfs is not installed setuid, an attempt to perform a "user"
or "users" mount will fail with a fairly obscure error message,
typically about getting "permission denied" from the server.

This patch gives a more helpful message in that case.

Signed-off-by: NeilBrown <neilb@suse.de>

diff --git a/utils/mount/mount.c b/utils/mount/mount.c
index 5076468..57360fb 100644
--- a/utils/mount/mount.c
+++ b/utils/mount/mount.c
@@ -539,6 +539,12 @@ int main(int argc, char *argv[])
 			mnt_err = EX_USAGE;
 			goto out;
 		}
+
+		if (geteuid() != 0) {
+			nfs_error(_("%s: not installed setuid - "
+				    "\"user\" NFS mounts not supported."));
+			exit(EX_FAIL);
+		}
 	}
 
 	if (chk_mountpoint(mount_point)) {

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

end of thread, other threads:[~2008-05-08  9:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-08  4:17 [PATCH nfs-utils] Give useful error if mount.nfs not installed setuid Neil Brown
     [not found] ` <18466.32444.577468.951202-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2008-05-08  9:21   ` Steve Dickson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox