From b8093b898541661fb734cfbf7dcb2dc1a914d7b6 Mon Sep 17 00:00:00 2001 From: elad Date: Fri, 20 Oct 2006 21:55:56 +0000 Subject: [PATCH] Kill some KAUTH_GENERIC_ISSUSER. --- sys/altq/altq_afmap.c | 8 ++++---- sys/altq/altq_blue.c | 9 +++++---- sys/altq/altq_cbq.c | 8 ++++---- sys/altq/altq_cdnr.c | 9 +++++---- sys/altq/altq_conf.c | 9 +++++---- sys/altq/altq_fifoq.c | 9 +++++---- sys/altq/altq_hfsc.c | 9 +++++---- sys/altq/altq_priq.c | 9 +++++---- sys/altq/altq_red.c | 9 +++++---- sys/altq/altq_rio.c | 9 +++++---- sys/altq/altq_wfq.c | 9 +++++---- 11 files changed, 53 insertions(+), 44 deletions(-) diff --git a/sys/altq/altq_afmap.c b/sys/altq/altq_afmap.c index 1a4252102156..a795d5e3b011 100644 --- a/sys/altq/altq_afmap.c +++ b/sys/altq/altq_afmap.c @@ -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 -__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); diff --git a/sys/altq/altq_blue.c b/sys/altq/altq_blue.c index f4f9dae9153c..0c1cfb2feedc 100644 --- a/sys/altq/altq_blue.c +++ b/sys/altq/altq_blue.c @@ -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 -__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; diff --git a/sys/altq/altq_cbq.c b/sys/altq/altq_cbq.c index 5616015032d7..e586bc45b477 100644 --- a/sys/altq/altq_cbq.c +++ b/sys/altq/altq_cbq.c @@ -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 -__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); diff --git a/sys/altq/altq_cdnr.c b/sys/altq/altq_cdnr.c index c4b7b7021bc3..d3b2d8e4c815 100644 --- a/sys/altq/altq_cdnr.c +++ b/sys/altq/altq_cdnr.c @@ -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 -__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; diff --git a/sys/altq/altq_conf.c b/sys/altq/altq_conf.c index 599da3c6fe5b..532d8064c178 100644 --- a/sys/altq/altq_conf.c +++ b/sys/altq/altq_conf.c @@ -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 -__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; diff --git a/sys/altq/altq_fifoq.c b/sys/altq/altq_fifoq.c index e2706cce6638..609f910b8f20 100644 --- a/sys/altq/altq_fifoq.c +++ b/sys/altq/altq_fifoq.c @@ -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 -__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; diff --git a/sys/altq/altq_hfsc.c b/sys/altq/altq_hfsc.c index 2d281963a9c7..07337c6902fd 100644 --- a/sys/altq/altq_hfsc.c +++ b/sys/altq/altq_hfsc.c @@ -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 -__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; diff --git a/sys/altq/altq_priq.c b/sys/altq/altq_priq.c index 977064b9243f..b0de273cc42d 100644 --- a/sys/altq/altq_priq.c +++ b/sys/altq/altq_priq.c @@ -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 -__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; diff --git a/sys/altq/altq_red.c b/sys/altq/altq_red.c index fc31d8fbcfb5..5f65bca5370c 100644 --- a/sys/altq/altq_red.c +++ b/sys/altq/altq_red.c @@ -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 -__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; diff --git a/sys/altq/altq_rio.c b/sys/altq/altq_rio.c index 9d5bff7bf3e9..bba917807409 100644 --- a/sys/altq/altq_rio.c +++ b/sys/altq/altq_rio.c @@ -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 -__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; diff --git a/sys/altq/altq_wfq.c b/sys/altq/altq_wfq.c index d7dd1a53575b..33795efa64a2 100644 --- a/sys/altq/altq_wfq.c +++ b/sys/altq/altq_wfq.c @@ -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 -__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;