Linux NFS development
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: linux-nfs@vger.kernel.org
Cc: Steve Dickson <SteveD@redhat.com>
Subject: [PATCH nfs-utils] Give useful error if mount.nfs not installed setuid.
Date: Thu, 8 May 2008 14:17:00 +1000	[thread overview]
Message-ID: <18466.32444.577468.951202@notabene.brown> (raw)


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)) {

             reply	other threads:[~2008-05-08  4:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-08  4:17 Neil Brown [this message]
     [not found] ` <18466.32444.577468.951202-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2008-05-08  9:21   ` [PATCH nfs-utils] Give useful error if mount.nfs not installed setuid Steve Dickson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=18466.32444.577468.951202@notabene.brown \
    --to=neilb@suse.de \
    --cc=SteveD@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox