summaryrefslogtreecommitdiffstats
path: root/utils/mount/mount.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2008-05-08 05:18:25 -0400
committerSteve Dickson <steved@redhat.com>2008-05-08 05:18:25 -0400
commit0930b25ee3a1eb28b957cdc70c9a1958812d895f (patch)
treeab5b8fbcf1a6b5c37351fc5ede58cb54d01742fe /utils/mount/mount.c
parent25cd5f9101b8969f9e1f9d7d486f11c215d0eeb4 (diff)
downloadnfs-utils-0930b25ee3a1eb28b957cdc70c9a1958812d895f.tar.gz
nfs-utils-0930b25ee3a1eb28b957cdc70c9a1958812d895f.tar.xz
nfs-utils-0930b25ee3a1eb28b957cdc70c9a1958812d895f.zip
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> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/mount/mount.c')
-rw-r--r--utils/mount/mount.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/utils/mount/mount.c b/utils/mount/mount.c
index 5076468..d7271a1 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."), progname);
+ exit(EX_FAIL);
+ }
}
if (chk_mountpoint(mount_point)) {