Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153362518
D47210.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
D47210.diff
View Options
diff --git a/usr.bin/netstat/Makefile b/usr.bin/netstat/Makefile
--- a/usr.bin/netstat/Makefile
+++ b/usr.bin/netstat/Makefile
@@ -50,8 +50,6 @@
CFLAGS+=-DPF
.endif
-BINGRP= kmem
-BINMODE=2555
LIBADD= kvm memstat xo util
.if ${MK_NETGRAPH_SUPPORT} != "no"
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c
--- a/usr.bin/netstat/main.c
+++ b/usr.bin/netstat/main.c
@@ -455,17 +455,10 @@
}
#endif
- /*
- * Discard setgid privileges if not the running kernel so that bad
- * guys can't print interesting stuff from kernel memory.
- */
live = (nlistf == NULL && memf == NULL);
- if (!live) {
- if (setgid(getgid()) != 0)
- xo_err(EX_OSERR, "setgid");
- /* Load all necessary kvm symbols */
+ /* Load all necessary kvm symbols */
+ if (!live)
kresolve_list(nl);
- }
if (xflag && Tflag)
xo_errx(EX_USAGE, "-x and -T are incompatible, pick one.");
@@ -739,9 +732,6 @@
return (0);
kvmd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf);
- if (setgid(getgid()) != 0)
- xo_err(EX_OSERR, "setgid");
-
if (kvmd == NULL) {
xo_warnx("kvm not available: %s", errbuf);
return (-1);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 21, 5:32 PM (12 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31923238
Default Alt Text
D47210.diff (1 KB)
Attached To
Mode
D47210: netstat: strip the binary of sgid
Attached
Detach File
Event Timeline
Log In to Comment