summaryrefslogtreecommitdiffstats
path: root/usr.bin/vmstat
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2001-08-31 16:26:37 +0000
committerru <ru@FreeBSD.org>2001-08-31 16:26:37 +0000
commitd7e70183dd68ef56c2783038a68fdb3298b7f647 (patch)
treeab53d2e577c98daad47ff99c85bf950d53a8ed69 /usr.bin/vmstat
parent336fa381382db82c39a914894286106270b68110 (diff)
downloadFreeBSD-src-d7e70183dd68ef56c2783038a68fdb3298b7f647.zip
FreeBSD-src-d7e70183dd68ef56c2783038a68fdb3298b7f647.tar.gz
SECURITY: Drop `setgid kmem' bit as early as possible.
Diffstat (limited to 'usr.bin/vmstat')
-rw-r--r--usr.bin/vmstat/vmstat.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c
index 9da1759..f48c918 100644
--- a/usr.bin/vmstat/vmstat.c
+++ b/usr.bin/vmstat/vmstat.c
@@ -241,6 +241,7 @@ main(argc, argv)
kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf);
if (kd == 0)
errx(1, "kvm_openfiles: %s", errbuf);
+ setgid(getgid());
if ((c = kvm_nlist(kd, namelist)) != 0) {
if (c > 0) {
OpenPOWER on IntegriCloud