#
# RAW4ALL  for Mac OS X 10.4.x / Darwin 8.x
# by peter bartoli, last modified 6/20/2k5
#
# 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/conf/MASTER.orig	2005-05-16 15:29:56.000000000 -0700
+++ bsd/conf/MASTER	2005-06-20 23:31:09.000000000 -0700
@@ -272,5 +272,6 @@
 # now using iokit disk shim, this is code is obsolete
 #pseudo-device diskshim
 
 pseudo-device	random		1	init	random_init
 
+options		RAW4ALL
--- bsd/kern/uipc_socket.c.orig	2005-05-16 15:29:24.000000000 -0700
+++ bsd/kern/uipc_socket.c	2005-06-20 23:30:17.000000000 -0700
@@ -452,11 +452,15 @@
 	so->so_type = type;
 
 #ifdef __APPLE__
 	if (p != 0) {
 		so->so_uid = kauth_cred_getuid(kauth_cred_get());
+#ifdef RAW4ALL
+		if (!suser(kauth_cred_get(),NULL) || prp-> pr_type == SOCK_RAW)
+#else
 		if (!suser(kauth_cred_get(),NULL))
+#endif /* RAW4ALL */
 			so->so_state = SS_PRIV;
 	}
 #else
 	so->so_cred = kauth_cred_get_with_ref();
 #endif
