From 7c44c1146bdcf28efdb31dab2f1bf9c869f3561b Mon Sep 17 00:00:00 2001 From: Rick Macklem Date: Sun, 9 Jun 2013 21:54:19 +0000 Subject: [PATCH] Modify nfsstat.c so that it prints out an error when a non-root user attempts to use the "-m" option and it fails. Requested by: danny@cs.huji.ac.il MFC after: 2 weeks --- usr.bin/nfsstat/nfsstat.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usr.bin/nfsstat/nfsstat.c b/usr.bin/nfsstat/nfsstat.c index 4a3228a8d597..bd18186728e6 100644 --- a/usr.bin/nfsstat/nfsstat.c +++ b/usr.bin/nfsstat/nfsstat.c @@ -133,6 +133,9 @@ main(int argc, char **argv) printf("%s on %s\n%s\n", mntbuf->f_mntfromname, mntbuf->f_mntonname, buf); + else if (errno == EPERM) + errx(1, "Only priviledged users" + " can use the -m option"); } mntbuf++; }