Kill some KAUTH_GENERIC_ISSUSER.

This commit is contained in:
elad 2006-10-20 21:55:56 +00:00
parent e76360da33
commit b8093b8985
11 changed files with 53 additions and 44 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: altq_afmap.c,v 1.15 2006/10/12 19:59:08 peter Exp $ */
/* $NetBSD: altq_afmap.c,v 1.16 2006/10/20 21:55:56 elad Exp $ */
/* $KAME: altq_afmap.c,v 1.12 2005/04/13 03:44:24 suz Exp $ */
/*
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: altq_afmap.c,v 1.15 2006/10/12 19:59:08 peter Exp $");
__KERNEL_RCSID(0, "$NetBSD: altq_afmap.c,v 1.16 2006/10/20 21:55:56 elad Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@ -359,8 +359,8 @@ afmioctl(dev_t dev __unused, ioctlcmd_t cmd, caddr_t addr, int flag __unused,
#if (__FreeBSD_version > 400000)
error = suser(p);
#else
error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag);
error = kauth_authorize_network(l->l_cred, KAUTH_NETWORK_ALTQ,
KAUTH_REQ_NETWORK_ALTQ_AFMAP, NULL, NULL, NULL);
#endif
if (error)
return (error);

View File

@ -1,4 +1,4 @@
/* $NetBSD: altq_blue.c,v 1.19 2006/10/12 19:59:08 peter Exp $ */
/* $NetBSD: altq_blue.c,v 1.20 2006/10/20 21:55:56 elad Exp $ */
/* $KAME: altq_blue.c,v 1.15 2005/04/13 03:44:24 suz Exp $ */
/*
@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: altq_blue.c,v 1.19 2006/10/12 19:59:08 peter Exp $");
__KERNEL_RCSID(0, "$NetBSD: altq_blue.c,v 1.20 2006/10/20 21:55:56 elad Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@ -166,8 +166,9 @@ blueioctl(dev_t dev __unused, ioctlcmd_t cmd, caddr_t addr, int flag __unused,
if ((error = suser(p)) != 0)
return (error);
#else
if ((error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag)) != 0)
if ((error = kauth_authorize_network(l->l_cred,
KAUTH_NETWORK_ALTQ, KAUTH_REQ_NETWORK_ALTQ_BLUE, NULL,
NULL, NULL)) != 0)
return (error);
#endif
break;

View File

@ -1,4 +1,4 @@
/* $NetBSD: altq_cbq.c,v 1.20 2006/10/13 09:57:28 peter Exp $ */
/* $NetBSD: altq_cbq.c,v 1.21 2006/10/20 21:55:56 elad Exp $ */
/* $KAME: altq_cbq.c,v 1.21 2005/04/13 03:44:24 suz Exp $ */
/*
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: altq_cbq.c,v 1.20 2006/10/13 09:57:28 peter Exp $");
__KERNEL_RCSID(0, "$NetBSD: altq_cbq.c,v 1.21 2006/10/20 21:55:56 elad Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@ -1010,8 +1010,8 @@ cbqioctl(dev_t dev __unused, ioctlcmd_t cmd, caddr_t addr, int flag __unused,
#if (__FreeBSD_version > 400000)
error = suser(p);
#else
error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag);
error = kauth_authorize_network(l->l_cred, KAUTH_NETWORK_ALTQ,
KAUTH_REQ_NETWORK_ALTQ_CBQ, NULL, NULL, NULL);
#endif
if (error)
return (error);

View File

@ -1,4 +1,4 @@
/* $NetBSD: altq_cdnr.c,v 1.16 2006/10/12 19:59:08 peter Exp $ */
/* $NetBSD: altq_cdnr.c,v 1.17 2006/10/20 21:55:56 elad Exp $ */
/* $KAME: altq_cdnr.c,v 1.15 2005/04/13 03:44:24 suz Exp $ */
/*
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: altq_cdnr.c,v 1.16 2006/10/12 19:59:08 peter Exp $");
__KERNEL_RCSID(0, "$NetBSD: altq_cdnr.c,v 1.17 2006/10/20 21:55:56 elad Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@ -1191,8 +1191,9 @@ cdnrioctl(dev_t dev __unused, ioctlcmd_t cmd, caddr_t addr, int flag __unused,
#if (__FreeBSD_version > 400000)
if ((error = suser(p)) != 0)
#else
if ((error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag)) != 0)
if ((error = kauth_authorize_network(l->l_cred,
KAUTH_NETWORK_ALTQ, KAUTH_REQ_NETWORK_ALTQ_CDNR, NULL,
NULL, NULL)) != 0)
#endif
return (error);
break;

View File

@ -1,4 +1,4 @@
/* $NetBSD: altq_conf.c,v 1.17 2006/10/12 19:59:08 peter Exp $ */
/* $NetBSD: altq_conf.c,v 1.18 2006/10/20 21:55:56 elad Exp $ */
/* $KAME: altq_conf.c,v 1.24 2005/04/13 03:44:24 suz Exp $ */
/*
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: altq_conf.c,v 1.17 2006/10/12 19:59:08 peter Exp $");
__KERNEL_RCSID(0, "$NetBSD: altq_conf.c,v 1.18 2006/10/20 21:55:56 elad Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@ -218,8 +218,9 @@ altqioctl(dev_t dev, ioctlcmd_t cmd, caddr_t addr, int flag, struct lwp *l)
if ((error = suser(p)) != 0)
return (error);
#else
if ((error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag)) != 0)
if ((error = kauth_authorize_network(l->l_cred,
KAUTH_NETWORK_ALTQ, KAUTH_REQ_NETWORK_ALTQ_CONF,
NULL, NULL, NULL)) != 0)
return (error);
#endif
break;

View File

@ -1,4 +1,4 @@
/* $NetBSD: altq_fifoq.c,v 1.13 2006/10/12 19:59:08 peter Exp $ */
/* $NetBSD: altq_fifoq.c,v 1.14 2006/10/20 21:55:56 elad Exp $ */
/* $KAME: altq_fifoq.c,v 1.12 2003/07/10 12:07:48 kjc Exp $ */
/*
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.13 2006/10/12 19:59:08 peter Exp $");
__KERNEL_RCSID(0, "$NetBSD: altq_fifoq.c,v 1.14 2006/10/20 21:55:56 elad Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@ -136,8 +136,9 @@ fifoqioctl(dev_t dev __unused, ioctlcmd_t cmd, caddr_t addr, int flag __unused,
if ((error = suser(p)) != 0)
return (error);
#else
if ((error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag)) != 0)
if ((error = kauth_authorize_network(l->l_cred,
KAUTH_NETWORK_ALTQ, KAUTH_REQ_NETWORK_ALTQ_FIFOQ, NULL,
NULL, NULL)) != 0)
return (error);
#endif
break;

View File

@ -1,4 +1,4 @@
/* $NetBSD: altq_hfsc.c,v 1.20 2006/10/13 09:57:28 peter Exp $ */
/* $NetBSD: altq_hfsc.c,v 1.21 2006/10/20 21:55:56 elad Exp $ */
/* $KAME: altq_hfsc.c,v 1.26 2005/04/13 03:44:24 suz Exp $ */
/*
@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: altq_hfsc.c,v 1.20 2006/10/13 09:57:28 peter Exp $");
__KERNEL_RCSID(0, "$NetBSD: altq_hfsc.c,v 1.21 2006/10/20 21:55:56 elad Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@ -1914,8 +1914,9 @@ hfscioctl(dev_t dev __unused, ioctlcmd_t cmd, caddr_t addr, int flag __unused,
if ((error = suser(p)) != 0)
return (error);
#else
if ((error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag)) != 0)
if ((error = kauth_authorize_network(l->l_cred,
KAUTH_NETWORK_ALTQ, KAUTH_REQ_NETWORK_ALTQ_HFSC, NULL,
NULL, NULL)) != 0)
return (error);
#endif
break;

View File

@ -1,4 +1,4 @@
/* $NetBSD: altq_priq.c,v 1.16 2006/10/13 09:57:28 peter Exp $ */
/* $NetBSD: altq_priq.c,v 1.17 2006/10/20 21:55:56 elad Exp $ */
/* $KAME: altq_priq.c,v 1.13 2005/04/13 03:44:25 suz Exp $ */
/*
* Copyright (C) 2000-2003
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: altq_priq.c,v 1.16 2006/10/13 09:57:28 peter Exp $");
__KERNEL_RCSID(0, "$NetBSD: altq_priq.c,v 1.17 2006/10/20 21:55:56 elad Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@ -722,8 +722,9 @@ priqioctl(dev_t dev __unused, ioctlcmd_t cmd, caddr_t addr, int flag __unused,
if ((error = suser(p)) != 0)
return (error);
#else
if ((error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag)) != 0)
if ((error = kauth_authorize_network(l->l_cred,
KAUTH_NETWORK_ALTQ, KAUTH_REQ_NETWORK_ALTQ_PRIQ, NULL,
NULL, NULL)) != 0)
return (error);
#endif
break;

View File

@ -1,4 +1,4 @@
/* $NetBSD: altq_red.c,v 1.22 2006/10/13 09:57:28 peter Exp $ */
/* $NetBSD: altq_red.c,v 1.23 2006/10/20 21:55:56 elad Exp $ */
/* $KAME: altq_red.c,v 1.20 2005/04/13 03:44:25 suz Exp $ */
/*
@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: altq_red.c,v 1.22 2006/10/13 09:57:28 peter Exp $");
__KERNEL_RCSID(0, "$NetBSD: altq_red.c,v 1.23 2006/10/20 21:55:56 elad Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@ -770,8 +770,9 @@ redioctl(dev_t dev __unused, ioctlcmd_t cmd, caddr_t addr, int flag __unused,
#if (__FreeBSD_version > 400000)
if ((error = suser(p)) != 0)
#else
if ((error = kauth_authorize_generic(p->p_cred,
KAUTH_GENERIC_ISSUSER, &p->p_acflag)) != 0)
if ((error = kauth_authorize_network(p->p_cred,
KAUTH_NETWORK_ALTQ, KAUTH_REQ_NETWORK_ALTQ_RED, NULL,
NULL, NULL)) != 0)
#endif
return (error);
break;

View File

@ -1,4 +1,4 @@
/* $NetBSD: altq_rio.c,v 1.15 2006/10/13 09:57:28 peter Exp $ */
/* $NetBSD: altq_rio.c,v 1.16 2006/10/20 21:55:56 elad Exp $ */
/* $KAME: altq_rio.c,v 1.19 2005/04/13 03:44:25 suz Exp $ */
/*
@ -60,7 +60,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: altq_rio.c,v 1.15 2006/10/13 09:57:28 peter Exp $");
__KERNEL_RCSID(0, "$NetBSD: altq_rio.c,v 1.16 2006/10/20 21:55:56 elad Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@ -518,8 +518,9 @@ rioioctl(dev_t dev __unused, ioctlcmd_t cmd, caddr_t addr, int flag __unused,
if ((error = suser(p)) != 0)
return (error);
#else
if ((error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag)) != 0)
if ((error = kauth_authorize_network(l->l_cred,
KAUTH_NETWORK_ALTQ, KAUTH_REQ_NETWORK_ALTQ_RIO, NULL,
NULL, NULL)) != 0)
return (error);
#endif
break;

View File

@ -1,4 +1,4 @@
/* $NetBSD: altq_wfq.c,v 1.15 2006/10/12 19:59:08 peter Exp $ */
/* $NetBSD: altq_wfq.c,v 1.16 2006/10/20 21:55:56 elad Exp $ */
/* $KAME: altq_wfq.c,v 1.14 2005/04/13 03:44:25 suz Exp $ */
/*
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: altq_wfq.c,v 1.15 2006/10/12 19:59:08 peter Exp $");
__KERNEL_RCSID(0, "$NetBSD: altq_wfq.c,v 1.16 2006/10/20 21:55:56 elad Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@ -649,8 +649,9 @@ wfqioctl(dev_t dev __unused, ioctlcmd_t cmd, caddr_t addr, int flag __unused,
#if (__FreeBSD_version > 400000)
if ((error = suser(p)) != 0)
#else
if ((error = kauth_authorize_generic(l->l_cred,
KAUTH_GENERIC_ISSUSER, &l->l_acflag)) != 0)
if ((error = kauth_authorize_network(l->l_cred,
KAUTH_NETWORK_ALTQ, KAUTH_REQ_NETWORK_ALTQ_WFQ, NULL,
NULL, NULL)) != 0)
#endif
return (error);
break;