Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Finish moving socket policy to the subsystem.
details: https://anonhg.NetBSD.org/src/rev/0a4c19bc01a7
branches: trunk
changeset: 747842:0a4c19bc01a7
user: elad <elad%NetBSD.org@localhost>
date: Sat Oct 03 01:41:39 2009 +0000
description:
Finish moving socket policy to the subsystem.
diffstat:
sys/kern/uipc_socket.c | 9 +++++++--
sys/secmodel/suser/secmodel_suser.c | 16 ++++++++--------
2 files changed, 15 insertions(+), 10 deletions(-)
diffs (69 lines):
diff -r f191c9fa21a8 -r 0a4c19bc01a7 sys/kern/uipc_socket.c
--- a/sys/kern/uipc_socket.c Sat Oct 03 01:35:20 2009 +0000
+++ b/sys/kern/uipc_socket.c Sat Oct 03 01:41:39 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uipc_socket.c,v 1.191 2009/10/02 23:50:16 elad Exp $ */
+/* $NetBSD: uipc_socket.c,v 1.192 2009/10/03 01:41:39 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.191 2009/10/02 23:50:16 elad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.192 2009/10/03 01:41:39 elad Exp $");
#include "opt_compat_netbsd.h"
#include "opt_sock_counters.h"
@@ -470,6 +470,11 @@
break;
+ case KAUTH_REQ_NETWORK_SOCKET_CANSEE:
+ result = KAUTH_RESULT_ALLOW;
+
+ break;
+
default:
break;
}
diff -r f191c9fa21a8 -r 0a4c19bc01a7 sys/secmodel/suser/secmodel_suser.c
--- a/sys/secmodel/suser/secmodel_suser.c Sat Oct 03 01:35:20 2009 +0000
+++ b/sys/secmodel/suser/secmodel_suser.c Sat Oct 03 01:41:39 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: secmodel_suser.c,v 1.18 2009/10/03 01:30:25 elad Exp $ */
+/* $NetBSD: secmodel_suser.c,v 1.19 2009/10/03 01:41:39 elad Exp $ */
/*-
* Copyright (c) 2006 Elad Efrat <elad%NetBSD.org@localhost>
* All rights reserved.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.18 2009/10/03 01:30:25 elad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.19 2009/10/03 01:41:39 elad Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -822,14 +822,14 @@
}
if (secmodel_bsd44_curtain) {
+ struct socket *so;
uid_t so_uid;
- so_uid =
- ((struct socket *)arg1)->so_uidinfo->ui_uid;
- if (kauth_cred_geteuid(cred) == so_uid)
- result = KAUTH_RESULT_ALLOW;
- } else
- result = KAUTH_RESULT_ALLOW;
+ so = (struct socket *)arg1;
+ so_uid = so->so_uidinfo->ui_uid;
+ if (kauth_cred_geteuid(cred) != so_uid)
+ result = KAUTH_RESULT_DENY;
+ }
break;
Home |
Main Index |
Thread Index |
Old Index