]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
If mount.nfs is not installed setuid, an attempt to perform a "user"
authorNeilBrown <neilb@suse.de>
Thu, 8 May 2008 09:18:25 +0000 (05:18 -0400)
committerSteve Dickson <steved@redhat.com>
Thu, 8 May 2008 09:18:25 +0000 (05:18 -0400)
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>
utils/mount/mount.c

index 5076468db8cc29384d22c2a99225934643709be0..d7271a1c32757b3cadc451e9f093f9aec672dc44 100644 (file)
@@ -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)) {