Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Move KAUTH_NETWORK_BIND::KAUTH_REQ_NETWORK_BIND_PORT pol...



details:   https://anonhg.NetBSD.org/src/rev/4f71d92166ec
branches:  trunk
changeset: 747851:4f71d92166ec
user:      elad <elad%NetBSD.org@localhost>
date:      Sat Oct 03 03:59:39 2009 +0000

description:
Move KAUTH_NETWORK_BIND::KAUTH_REQ_NETWORK_BIND_PORT policy back to the
subsystem (or close to it).

Note: Revisit KAUTH_REQ_NETWORK_BIND_PRIVPORT.

diffstat:

 sys/kern/uipc_socket.c              |  11 ++++++++---
 sys/secmodel/suser/secmodel_suser.c |   8 ++------
 2 files changed, 10 insertions(+), 9 deletions(-)

diffs (64 lines):

diff -r 4a750ca4aa65 -r 4f71d92166ec sys/kern/uipc_socket.c
--- a/sys/kern/uipc_socket.c    Sat Oct 03 03:38:31 2009 +0000
+++ b/sys/kern/uipc_socket.c    Sat Oct 03 03:59:39 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_socket.c,v 1.192 2009/10/03 01:41:39 elad Exp $   */
+/*     $NetBSD: uipc_socket.c,v 1.193 2009/10/03 03:59: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.192 2009/10/03 01:41:39 elad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.193 2009/10/03 03:59:39 elad Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_sock_counters.h"
@@ -440,10 +440,15 @@
        result = KAUTH_RESULT_DEFER;
        req = (enum kauth_network_req)arg0;
 
-       if (action != KAUTH_NETWORK_SOCKET)
+       if ((action != KAUTH_NETWORK_SOCKET) &&
+           (action != KAUTH_NETWORK_BIND))
                return result;
 
        switch (req) {
+       case KAUTH_REQ_NETWORK_BIND_PORT:
+               result = KAUTH_RESULT_ALLOW;
+               break;
+
        case KAUTH_REQ_NETWORK_SOCKET_DROP: {
                /* Normal users can only drop their own connections. */
                struct socket *so = (struct socket *)arg1;
diff -r 4a750ca4aa65 -r 4f71d92166ec sys/secmodel/suser/secmodel_suser.c
--- a/sys/secmodel/suser/secmodel_suser.c       Sat Oct 03 03:38:31 2009 +0000
+++ b/sys/secmodel/suser/secmodel_suser.c       Sat Oct 03 03:59:39 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: secmodel_suser.c,v 1.25 2009/10/03 03:38:31 elad Exp $ */
+/* $NetBSD: secmodel_suser.c,v 1.26 2009/10/03 03:59: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.25 2009/10/03 03:38:31 elad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.26 2009/10/03 03:59:39 elad Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -611,10 +611,6 @@
 
        case KAUTH_NETWORK_BIND:
                switch (req) {
-               case KAUTH_REQ_NETWORK_BIND_PORT:
-                       result = KAUTH_RESULT_ALLOW;
-                       break;
-
                case KAUTH_REQ_NETWORK_BIND_PRIVPORT:
                        if (isroot)
                                result = KAUTH_RESULT_ALLOW;



Home | Main Index | Thread Index | Old Index