From 316d9fdf57811beb0ff60e327474a79b5a96c833 Mon Sep 17 00:00:00 2001 From: Alexander Yurchenko Date: Fri, 14 Jan 2005 20:22:55 +0000 Subject: Restrict AF_BLUETOOTH sockets to root for now. Discussed with theo and markus. --- sys/netbt/hci_raw.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/netbt/hci_raw.c b/sys/netbt/hci_raw.c index 930606f5e69..ae29dcda412 100644 --- a/sys/netbt/hci_raw.c +++ b/sys/netbt/hci_raw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hci_raw.c,v 1.1 2005/01/14 12:04:02 grange Exp $ */ +/* $OpenBSD: hci_raw.c,v 1.2 2005/01/14 20:22:54 grange Exp $ */ /* * ng_btsocket_hci_raw.c @@ -27,7 +27,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: hci_raw.c,v 1.1 2005/01/14 12:04:02 grange Exp $ + * $Id: hci_raw.c,v 1.2 2005/01/14 20:22:54 grange Exp $ * $FreeBSD: src/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c,v 1.16 2004/10/18 22:19:42 rwatson Exp $ */ @@ -1682,6 +1682,10 @@ hci_raw_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam, struct sockaddr *sa; int error = 0; + /* XXX: restrict AF_BLUETOOTH sockets to root for now */ + if ((error = suser(curproc, 0)) != 0) + return (error); + if (req == PRU_CONTROL) return (ng_btsocket_hci_raw_control(so, (u_long)m, (caddr_t)nam, (struct ifnet *)control, curproc)); -- cgit v1.2.3