Module Name:    src
Committed By:   elad
Date:           Wed Dec 30 06:58:51 UTC 2009

Modified Files:
        src/sys/kern: uipc_socket.c

Log Message:
Use credentials from the socket.


To generate a diff of this commit:
cvs rdiff -u -r1.198 -r1.199 src/sys/kern/uipc_socket.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/uipc_socket.c
diff -u src/sys/kern/uipc_socket.c:1.198 src/sys/kern/uipc_socket.c:1.199
--- src/sys/kern/uipc_socket.c:1.198	Tue Dec 29 04:23:43 2009
+++ src/sys/kern/uipc_socket.c	Wed Dec 30 06:58:50 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_socket.c,v 1.198 2009/12/29 04:23:43 elad Exp $	*/
+/*	$NetBSD: uipc_socket.c,v 1.199 2009/12/30 06:58:50 elad Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.198 2009/12/29 04:23:43 elad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.199 2009/12/30 06:58:50 elad Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_sock_counters.h"
@@ -452,10 +452,8 @@
 	case KAUTH_REQ_NETWORK_SOCKET_DROP: {
 		/* Normal users can only drop their own connections. */
 		struct socket *so = (struct socket *)arg1;
-		uid_t sockuid = so->so_uidinfo->ui_uid;
 
-		if (sockuid == kauth_cred_getuid(cred) ||
-		    sockuid == kauth_cred_geteuid(cred))
+		if (proc_uidmatch(cred, so->so_cred))
 			result = KAUTH_RESULT_ALLOW;
 
 		break;

Reply via email to