Kill some KAUTH_GENERIC_ISSUSER.

This commit is contained in:
elad 2006-10-25 12:48:44 +00:00
parent a72d8a71e5
commit 75939147ff
1 changed files with 17 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: in.c,v 1.112 2006/10/12 01:32:37 christos Exp $ */
/* $NetBSD: in.c,v 1.113 2006/10/25 12:48:44 elad Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -98,7 +98,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.112 2006/10/12 01:32:37 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.113 2006/10/25 12:48:44 elad Exp $");
#include "opt_inet.h"
#include "opt_inet_conf.h"
@ -321,8 +321,11 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp,
switch (cmd) {
case SIOCALIFADDR:
case SIOCDLIFADDR:
if (l == 0 || (error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag)))
if (l == NULL)
return (EPERM);
if (kauth_authorize_network(l->l_cred, KAUTH_NETWORK_INTERFACE,
KAUTH_REQ_NETWORK_INTERFACE_SETPRIV, ifp, (void *)cmd,
NULL) != 0)
return (EPERM);
/*fall through*/
case SIOCGLIFADDR:
@ -377,8 +380,11 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp,
(cmd == SIOCSIFNETMASK || cmd == SIOCSIFDSTADDR))
return (EADDRNOTAVAIL);
if (l == 0 || (error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag)))
if (l == NULL)
return (EPERM);
if (kauth_authorize_network(l->l_cred, KAUTH_NETWORK_INTERFACE,
KAUTH_REQ_NETWORK_INTERFACE_SETPRIV, ifp, (void *)cmd,
NULL) != 0)
return (EPERM);
if (ia == 0) {
@ -407,8 +413,11 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp,
break;
case SIOCSIFBRDADDR:
if (l == 0 || (error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag)))
if (l == NULL)
return (EPERM);
if (kauth_authorize_network(l->l_cred, KAUTH_NETWORK_INTERFACE,
KAUTH_REQ_NETWORK_INTERFACE_SETPRIV, ifp, (void *)cmd,
NULL) != 0)
return (EPERM);
/* FALLTHROUGH */