diff options
author | rmacklem <rmacklem@FreeBSD.org> | 2013-06-09 21:54:19 +0000 |
---|---|---|
committer | rmacklem <rmacklem@FreeBSD.org> | 2013-06-09 21:54:19 +0000 |
commit | 55fa9cb19444690b4483d40ae48c9c67363cc788 (patch) | |
tree | 747753d6159649e10b4be83bb6a81b28f911ede2 | |
parent | 2ec3ccab05ceb9d46ff8bfd7510e7859e344aa5a (diff) | |
download | FreeBSD-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
-rw-r--r-- | usr.bin/nfsstat/nfsstat.c | 3 |
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++; } |