summaryrefslogtreecommitdiff
path: root/sys/netinet/udp_usrreq.c
diff options
context:
space:
mode:
authorBrian Feldman <green@FreeBSD.org>2001-02-18 13:30:20 +0000
committerBrian Feldman <green@FreeBSD.org>2001-02-18 13:30:20 +0000
commitc0511d3b58c985e17c0c23585ea7d16b6f52fe61 (patch)
tree2c98c72cf23cba290a2be73c7aed9bd4bf7a492c /sys/netinet/udp_usrreq.c
parentffa3e13653a581fa24e55f911eef6ab1b8ffbf82 (diff)
Notes
Diffstat (limited to 'sys/netinet/udp_usrreq.c')
-rw-r--r--sys/netinet/udp_usrreq.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 468064fe7150..5588956e70e3 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -606,6 +606,7 @@ SYSCTL_PROC(_net_inet_udp, UDPCTL_PCBLIST, pcblist, CTLFLAG_RD, 0, 0,
static int
udp_getcred(SYSCTL_HANDLER_ARGS)
{
+ struct xucred xuc;
struct sockaddr_in addrs[2];
struct inpcb *inp;
int error, s;
@@ -623,14 +624,19 @@ udp_getcred(SYSCTL_HANDLER_ARGS)
error = ENOENT;
goto out;
}
- error = SYSCTL_OUT(req, inp->inp_socket->so_cred, sizeof(struct ucred));
+ bzero(&xuc, sizeof(xuc));
+ xuc.cr_uid = inp->inp_socket->so_cred->cr_uid;
+ xuc.cr_ngroups = inp->inp_socket->so_cred->cr_ngroups;
+ bcopy(inp->inp_socket->so_cred->cr_groups, xuc.cr_groups,
+ sizeof(xuc.cr_groups));
+ error = SYSCTL_OUT(req, &xuc, sizeof(struct xucred));
out:
splx(s);
return (error);
}
SYSCTL_PROC(_net_inet_udp, OID_AUTO, getcred, CTLTYPE_OPAQUE|CTLFLAG_RW,
- 0, 0, udp_getcred, "S,ucred", "Get the ucred of a UDP connection");
+ 0, 0, udp_getcred, "S,xucred", "Get the xucred of a UDP connection");
static int
udp_output(inp, m, addr, control, p)