Skip to contentSkip to conversation

Give useful error if mount.nfs not installed setuid.

PATCH In review Neil Brown 2 participants 2 messages May 8, 2008 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Neil Brown

author
#0 lore raw

PATCH 1/1 Give useful error if mount.nfs not installed setuid.

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.

utils/mount/mount.c +6 -0
index 5076468..57360fb 100644
@@ -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)) {

A message that is not in the archive (sent off-list or not yet received): 18466.32444.577468.951202-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org

#2 lore raw
Quoted 7 lines · Neil Brown

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.

Committed... thanks...

steved.