PERFORCE change 113275 for review
Todd Miller
millert at FreeBSD.org
Sun Jan 21 22:34:00 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=113275
Change 113275 by millert at millert_macbook on 2007/01/21 22:30:09
Use existing cred passed in to socket read/write functions
instead of looking up the cred via curren_proc(). Also
replace a proc_ucred(current_proc()) with kauth_cred_get().
Affected files ...
.. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/bsd/kern/sys_socket.c#5 edit
Differences ...
==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/bsd/kern/sys_socket.c#5 (text+ko) ====
@@ -112,7 +112,7 @@
soo_read(
struct fileproc *fp,
struct uio *uio,
- __unused kauth_cred_t cred,
+ kauth_cred_t cred,
__unused int flags,
__unused struct proc *p)
{
@@ -134,7 +134,7 @@
}
#ifdef MAC_SOCKET
SOCK_LOCK(so);
- error = mac_socket_check_receive(proc_ucred(p), so);
+ error = mac_socket_check_receive(cred, so);
SOCK_UNLOCK(so);
if (error)
return (error);
@@ -151,7 +151,7 @@
soo_write(
struct fileproc *fp,
struct uio *uio,
- __unused kauth_cred_t cred,
+ kauth_cred_t cred,
__unused int flags,
struct proc *procp)
{
@@ -171,7 +171,7 @@
#ifdef MAC_SOCKET
SOCK_LOCK(so);
- error = mac_socket_check_send(proc_ucred(procp), so);
+ error = mac_socket_check_send(cred, so);
SOCK_UNLOCK(so);
if (error)
return (error);
@@ -419,7 +419,7 @@
#ifdef MAC_SOCKET
SOCK_LOCK(so);
- stat = mac_socket_check_stat(proc_ucred(current_proc()), so);
+ stat = mac_socket_check_stat(kauth_cred_get(), so);
SOCK_UNLOCK(so);
if (stat)
return (stat);
More information about the trustedbsd-cvs
mailing list