summaryrefslogtreecommitdiffstats
path: root/sys/netinet/udp_usrreq.c
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2001-10-05 07:06:32 +0000
committerps <ps@FreeBSD.org>2001-10-05 07:06:32 +0000
commit38383190d52e794a70d2b71ee33fa321e5109e7a (patch)
tree953170eca78713bb41696224e03ab9f195a51086 /sys/netinet/udp_usrreq.c
parent9f7723d2e481ba58d2544017b5a18c2ce93dca5c (diff)
downloadFreeBSD-src-38383190d52e794a70d2b71ee33fa321e5109e7a.zip
FreeBSD-src-38383190d52e794a70d2b71ee33fa321e5109e7a.tar.gz
Only allow users to see their own socket connections if
kern.ipc.showallsockets is set to 0. Submitted by: billf (with modifications by me) Inspired by: Dave McKay (aka pm aka Packet Magnet) Reviewed by: peter MFC after: 2 weeks
Diffstat (limited to 'sys/netinet/udp_usrreq.c')
-rw-r--r--sys/netinet/udp_usrreq.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index a9efeab..e933064 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -579,8 +579,12 @@ udp_pcblist(SYSCTL_HANDLER_ARGS)
s = splnet();
for (inp = LIST_FIRST(udbinfo.listhead), i = 0; inp && i < n;
inp = LIST_NEXT(inp, inp_list)) {
- if (inp->inp_gencnt <= gencnt && !prison_xinpcb(req->p, inp))
+ if (inp->inp_gencnt <= gencnt && !prison_xinpcb(req->p, inp)) {
+ if (!showallsockets && socheckproc(inp->inp_socket,
+ curthread->td_proc))
+ continue;
inp_list[i++] = inp;
+ }
}
splx(s);
n = i;
OpenPOWER on IntegriCloud