summaryrefslogtreecommitdiffstats
path: root/usr.bin/nfsstat
diff options
context:
space:
mode:
authorrmacklem <rmacklem@FreeBSD.org>2013-06-09 21:54:19 +0000
committerrmacklem <rmacklem@FreeBSD.org>2013-06-09 21:54:19 +0000
commit55fa9cb19444690b4483d40ae48c9c67363cc788 (patch)
tree747753d6159649e10b4be83bb6a81b28f911ede2 /usr.bin/nfsstat
parent2ec3ccab05ceb9d46ff8bfd7510e7859e344aa5a (diff)
downloadFreeBSD-src-55fa9cb19444690b4483d40ae48c9c67363cc788.zip
FreeBSD-src-55fa9cb19444690b4483d40ae48c9c67363cc788.tar.gz
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
Diffstat (limited to 'usr.bin/nfsstat')
-rw-r--r--usr.bin/nfsstat/nfsstat.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/usr.bin/nfsstat/nfsstat.c b/usr.bin/nfsstat/nfsstat.c
index 4a3228a..bd18186 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++;
}
OpenPOWER on IntegriCloud