Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F140125662
D3541.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D3541.diff
View Options
Index: head/usr.bin/w/Makefile
===================================================================
--- head/usr.bin/w/Makefile
+++ head/usr.bin/w/Makefile
@@ -5,8 +5,6 @@
SRCS= fmt.c pr_time.c proc_compare.c w.c
MAN= w.1 uptime.1
LIBADD= kvm sbuf xo util
-#BINGRP= kmem
-#BINMODE=2555
LINKS= ${BINDIR}/w ${BINDIR}/uptime
.PATH: ${.CURDIR}/../../bin/ps
Index: head/usr.bin/w/w.c
===================================================================
--- head/usr.bin/w/w.c
+++ head/usr.bin/w/w.c
@@ -135,7 +135,7 @@
struct kinfo_proc *dkp;
struct stat *stp;
time_t touched;
- int ch, i, nentries, nusers, wcmd, longidle, longattime, dropgid;
+ int ch, i, nentries, nusers, wcmd, longidle, longattime;
const char *memf, *nlistf, *p, *save_p;
char *x_suffix;
char buf[MAXHOSTNAMELEN], errbuf[_POSIX2_LINE_MAX];
@@ -159,7 +159,6 @@
p = "dhiflM:N:nsuw";
}
- dropgid = 0;
memf = _PATH_DEVNULL;
nlistf = NULL;
while ((ch = getopt(argc, argv, p)) != -1)
@@ -176,11 +175,9 @@
case 'M':
header = 0;
memf = optarg;
- dropgid = 1;
break;
case 'N':
nlistf = optarg;
- dropgid = 1;
break;
case 'n':
nflag = 1;
@@ -200,13 +197,6 @@
_res.retrans = 2; /* resolver timeout to 2 seconds per try */
_res.retry = 1; /* only try once.. */
- /*
- * Discard setgid privileges if not the running kernel so that bad
- * guys can't print interesting stuff from kernel memory.
- */
- if (dropgid)
- setgid(getgid());
-
if ((kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf)) == NULL)
errx(1, "%s", errbuf);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 21, 2:23 PM (16 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27114153
Default Alt Text
D3541.diff (1 KB)
Attached To
Mode
D3541: Eliminate setgid leftover in w(1).
Attached
Detach File
Event Timeline
Log In to Comment