#
# RAW4ALL diff for Mac OS X 10.3 / Darwin 7.0
# by peter bartoli, version 3.0 of 11/23/2003
#
# to install
# 1. unpack and cd to your xnu source tree
# 2. patch -p0 -b [--verbose --suffix=.orig] < RAW4ALL.patch
# 3. build xnu and install your kernel
#
--- bsd/kern/uipc_socket.c.orig	Fri Oct 24 15:25:25 2003
+++ bsd/kern/uipc_socket.c	Sun Nov 23 14:27:02 2003
@@ -415,11 +415,15 @@
 	TAILQ_INIT(&so->so_comp);
 	so->so_type = type;
 
 #ifdef __APPLE__
 	if (p != 0) {
+#ifdef RAW4ALL
+		if (p->p_ucred->cr_uid == 0 || prp->pr_type == SOCK_RAW)
+#else
 		if (p->p_ucred->cr_uid == 0)
+#endif /* RAW4ALL */
 			so->so_state = SS_PRIV;
 
 		so->so_uid = p->p_ucred->cr_uid;
 	}
 #else
--- bsd/conf/MASTER.orig	Tue Oct 21 12:24:55 2003
+++ bsd/conf/MASTER	Sun Nov 23 14:30:08 2003
@@ -264,5 +264,7 @@
 # now using iokit disk shim, this is code is obsolete
 #pseudo-device diskshim
 
 pseudo-device	random		1	init	random_init
 
+options		RAW4ALL
+
