Date: Sun, 21 Jan 2007 22:30:23 GMT From: Todd Miller <millert@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 113275 for review Message-ID: <200701212230.l0LMUNPB060775@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=113275 Change 113275 by millert@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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701212230.l0LMUNPB060775>