aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2001-08-31 16:26:37 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2001-08-31 16:26:37 +0000
commit3b7e5ccc6a8fbd9da28696a3e98a648883a33af2 (patch)
treeab53d2e577c98daad47ff99c85bf950d53a8ed69 /usr.bin
parent208691fcd8e8c8ae68306ddb5dca8e5f207a793f (diff)
Notes
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/fstat/fstat.c1
-rw-r--r--usr.bin/netstat/main.c1
-rw-r--r--usr.bin/vmstat/vmstat.c1
3 files changed, 3 insertions, 0 deletions
diff --git a/usr.bin/fstat/fstat.c b/usr.bin/fstat/fstat.c
index 96be7061ba0cb..5ee9feb7dab3a 100644
--- a/usr.bin/fstat/fstat.c
+++ b/usr.bin/fstat/fstat.c
@@ -236,6 +236,7 @@ main(argc, argv)
if ((kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, buf)) == NULL)
errx(1, "%s", buf);
+ setgid(getgid());
#ifdef notdef
if (kvm_nlist(kd, nl) != 0)
errx(1, "no namelist: %s", kvm_geterr(kd));
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c
index 4f373d1161e24..30dfaa8040dd5 100644
--- a/usr.bin/netstat/main.c
+++ b/usr.bin/netstat/main.c
@@ -664,6 +664,7 @@ kread(u_long addr, char *buf, int size)
* XXX.
*/
kvmd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, buf);
+ setgid(getgid());
if (kvmd != NULL) {
if (kvm_nlist(kvmd, nl) < 0) {
if(nlistf)
diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c
index 9da1759e20916..f48c9187ecb3a 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) {