diff options
| author | elad <elad@NetBSD.org> | 2006-05-14 21:42:26 +0000 |
|---|---|---|
| committer | elad <elad@NetBSD.org> | 2006-05-14 21:42:26 +0000 |
| commit | 2867b68bc3d7cdb1bb7b9f8367e4aa0b2fa765f4 (patch) | |
| tree | a0add7b65b60ddf03960733156c82bfb90bc978d /sys/dev/ic | |
| parent | fc9422c9d9d5eec5abd0d58ae5fa47aedf2198e3 (diff) | |
integrate kauth.
Diffstat (limited to 'sys/dev/ic')
| -rw-r--r-- | sys/dev/ic/an.c | 9 | ||||
| -rw-r--r-- | sys/dev/ic/cd18xx.c | 11 | ||||
| -rw-r--r-- | sys/dev/ic/clmpcc.c | 13 | ||||
| -rw-r--r-- | sys/dev/ic/com.c | 13 | ||||
| -rw-r--r-- | sys/dev/ic/cy.c | 12 | ||||
| -rw-r--r-- | sys/dev/ic/max2820reg.h | 2 | ||||
| -rw-r--r-- | sys/dev/ic/midway.c | 13 | ||||
| -rw-r--r-- | sys/dev/ic/pcdisplayvar.h | 2 | ||||
| -rw-r--r-- | sys/dev/ic/rrunner.c | 9 | ||||
| -rw-r--r-- | sys/dev/ic/tulip.c | 4 | ||||
| -rw-r--r-- | sys/dev/ic/wi.c | 9 | ||||
| -rw-r--r-- | sys/dev/ic/z8530tty.c | 11 |
12 files changed, 71 insertions, 37 deletions
diff --git a/sys/dev/ic/an.c b/sys/dev/ic/an.c index 601ac946efd..7c59789e15a 100644 --- a/sys/dev/ic/an.c +++ b/sys/dev/ic/an.c @@ -1,4 +1,4 @@ -/* $NetBSD: an.c,v 1.42 2006/03/12 03:34:37 dyoung Exp $ */ +/* $NetBSD: an.c,v 1.43 2006/05/14 21:42:27 elad Exp $ */ /* * Copyright (c) 1997, 1998, 1999 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. @@ -77,7 +77,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: an.c,v 1.42 2006/03/12 03:34:37 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: an.c,v 1.43 2006/05/14 21:42:27 elad Exp $"); #include "bpfilter.h" @@ -94,6 +94,7 @@ __KERNEL_RCSID(0, "$NetBSD: an.c,v 1.42 2006/03/12 03:34:37 dyoung Exp $"); #include <sys/proc.h> #include <sys/md4.h> #include <sys/endian.h> +#include <sys/kauth.h> #include <machine/bus.h> @@ -1298,7 +1299,9 @@ an_get_nwkey(struct an_softc *sc, struct ieee80211_nwkey *nwkey) if (nwkey->i_key[i].i_keydat == NULL) continue; /* do not show any keys to non-root user */ - if ((error = suser(curproc->p_ucred, &curproc->p_acflag)) != 0) + if ((error = kauth_authorize_generic(curproc->p_cred, + KAUTH_GENERIC_ISSUSER, + &curproc->p_acflag)) != 0) break; nwkey->i_key[i].i_keylen = sc->sc_wepkeys[i].an_wep_keylen; if (nwkey->i_key[i].i_keylen < 0) { diff --git a/sys/dev/ic/cd18xx.c b/sys/dev/ic/cd18xx.c index 8a2906e0602..76463f86d85 100644 --- a/sys/dev/ic/cd18xx.c +++ b/sys/dev/ic/cd18xx.c @@ -1,4 +1,4 @@ -/* $NetBSD: cd18xx.c,v 1.13 2005/12/24 20:27:29 perry Exp $ */ +/* $NetBSD: cd18xx.c,v 1.14 2006/05/14 21:42:27 elad Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -101,7 +101,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cd18xx.c,v 1.13 2005/12/24 20:27:29 perry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cd18xx.c,v 1.14 2006/05/14 21:42:27 elad Exp $"); #include <sys/param.h> #include <sys/conf.h> @@ -112,6 +112,7 @@ __KERNEL_RCSID(0, "$NetBSD: cd18xx.c,v 1.13 2005/12/24 20:27:29 perry Exp $"); #include <sys/kernel.h> #include <sys/tty.h> #include <sys/fcntl.h> +#include <sys/kauth.h> #include <machine/bus.h> @@ -432,7 +433,8 @@ cdttyopen(dev, flag, mode, p) if (tp == NULL || (ISSET(tp->t_state, TS_ISOPEN) && ISSET(tp->t_state, TS_XCLUDE) && - suser(p->p_ucred, &p->p_acflag) != 0)) + kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, + &p->p_acflag) != 0)) return (EBUSY); s = spltty(); @@ -653,7 +655,8 @@ cdttyioctl(dev, cmd, data, flag, p) break; case TIOCSFLAGS: - error = suser(p->p_ucred, &p->p_acflag); + error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, + &p->p_acflag); if (error) return (error); port->p_swflags = *(int *)data; diff --git a/sys/dev/ic/clmpcc.c b/sys/dev/ic/clmpcc.c index e78595cd70c..5f51fc7c7ec 100644 --- a/sys/dev/ic/clmpcc.c +++ b/sys/dev/ic/clmpcc.c @@ -1,4 +1,4 @@ -/* $NetBSD: clmpcc.c,v 1.27 2006/03/07 08:21:00 he Exp $ */ +/* $NetBSD: clmpcc.c,v 1.28 2006/05/14 21:42:27 elad Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: clmpcc.c,v 1.27 2006/03/07 08:21:00 he Exp $"); +__KERNEL_RCSID(0, "$NetBSD: clmpcc.c,v 1.28 2006/05/14 21:42:27 elad Exp $"); #include "opt_ddb.h" @@ -59,6 +59,7 @@ __KERNEL_RCSID(0, "$NetBSD: clmpcc.c,v 1.27 2006/03/07 08:21:00 he Exp $"); #include <sys/syslog.h> #include <sys/device.h> #include <sys/malloc.h> +#include <sys/kauth.h> #include <machine/bus.h> #include <machine/intr.h> @@ -524,7 +525,9 @@ clmpccopen(dev, flag, mode, l) if ( ISSET(tp->t_state, TS_ISOPEN) && ISSET(tp->t_state, TS_XCLUDE) && - suser(l->l_proc->p_ucred, &l->l_proc->p_acflag) != 0 ) + kauth_authorize_generic(l->l_proc->p_cred, + KAUTH_GENERIC_ISSUSER, + &l->l_proc->p_acflag) != 0 ) return EBUSY; /* @@ -751,7 +754,9 @@ clmpccioctl(dev, cmd, data, flag, l) break; case TIOCSFLAGS: - error = suser(l->l_proc->p_ucred, &l->l_proc->p_acflag); + error = kauth_authorize_generic(l->l_proc->p_cred, + KAUTH_GENERIC_ISSUSER, + &l->l_proc->p_acflag); if ( error ) break; ch->ch_openflags = *((int *)data) & diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c index 7ee9f59da75..9160caedb4f 100644 --- a/sys/dev/ic/com.c +++ b/sys/dev/ic/com.c @@ -1,4 +1,4 @@ -/* $NetBSD: com.c,v 1.242 2006/03/28 17:38:30 thorpej Exp $ */ +/* $NetBSD: com.c,v 1.243 2006/05/14 21:42:27 elad Exp $ */ /*- * Copyright (c) 1998, 1999, 2004 The NetBSD Foundation, Inc. @@ -73,7 +73,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.242 2006/03/28 17:38:30 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.243 2006/05/14 21:42:27 elad Exp $"); #include "opt_com.h" #include "opt_ddb.h" @@ -121,6 +121,7 @@ __KERNEL_RCSID(0, "$NetBSD: com.c,v 1.242 2006/03/28 17:38:30 thorpej Exp $"); #include <sys/malloc.h> #include <sys/timepps.h> #include <sys/vnode.h> +#include <sys/kauth.h> #include <machine/intr.h> #include <machine/bus.h> @@ -828,7 +829,9 @@ comopen(dev_t dev, int flag, int mode, struct lwp *l) if (ISSET(tp->t_state, TS_ISOPEN) && ISSET(tp->t_state, TS_XCLUDE) && - suser(l->l_proc->p_ucred, &l->l_proc->p_acflag) != 0) + kauth_authorize_generic(l->l_proc->p_cred, + KAUTH_GENERIC_ISSUSER, + &l->l_proc->p_acflag) != 0) return (EBUSY); s = spltty(); @@ -1074,7 +1077,9 @@ comioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l) break; case TIOCSFLAGS: - error = suser(p->p_ucred, &p->p_acflag); + error = kauth_authorize_generic(p->p_cred, + KAUTH_GENERIC_ISSUSER, + &p->p_acflag); if (error) break; sc->sc_swflags = *(int *)data; diff --git a/sys/dev/ic/cy.c b/sys/dev/ic/cy.c index eb38fe494cb..264093c2577 100644 --- a/sys/dev/ic/cy.c +++ b/sys/dev/ic/cy.c @@ -1,4 +1,4 @@ -/* $NetBSD: cy.c,v 1.41 2006/05/14 05:42:43 christos Exp $ */ +/* $NetBSD: cy.c,v 1.42 2006/05/14 21:42:27 elad Exp $ */ /* * cy.c @@ -16,7 +16,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cy.c,v 1.41 2006/05/14 05:42:43 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cy.c,v 1.42 2006/05/14 21:42:27 elad Exp $"); #include <sys/param.h> #include <sys/ioctl.h> @@ -32,6 +32,7 @@ __KERNEL_RCSID(0, "$NetBSD: cy.c,v 1.41 2006/05/14 05:42:43 christos Exp $"); #include <sys/malloc.h> #include <sys/systm.h> #include <sys/callout.h> +#include <sys/kauth.h> #include <machine/bus.h> @@ -365,7 +366,9 @@ cyopen(dev_t dev, int flag, int mode, struct lwp *l) else CLR(tp->t_state, TS_CARR_ON); } else if (ISSET(tp->t_state, TS_XCLUDE) && - suser(l->l_proc->p_ucred, &l->l_proc->p_acflag) != 0) { + kauth_authorize_generic(l->l_proc->p_cred, + KAUTH_GENERIC_ISSUSER, + &l->l_proc->p_acflag) != 0) { return EBUSY; } else { s = spltty(); @@ -554,7 +557,8 @@ cyioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l) break; case TIOCSFLAGS: - error = suser(p->p_ucred, &p->p_acflag); + error = kauth_authorize_generic(p->p_cred, + KAUTH_GENERIC_ISSUSER, &p->p_acflag); if (error != 0) return EPERM; diff --git a/sys/dev/ic/max2820reg.h b/sys/dev/ic/max2820reg.h index 5dcfe0753eb..3ecbdb00629 100644 --- a/sys/dev/ic/max2820reg.h +++ b/sys/dev/ic/max2820reg.h @@ -1,4 +1,4 @@ -/* $NetBSD: max2820reg.h,v 1.5 2006/03/08 08:26:50 dyoung Exp $ */ +/* $NetBSD: max2820reg.h,v 1.6 2006/05/14 21:42:27 elad Exp $ */ /* * Copyright (c) 2004 David Young. All rights reserved. diff --git a/sys/dev/ic/midway.c b/sys/dev/ic/midway.c index 2f48251eb1c..8aac12ea17c 100644 --- a/sys/dev/ic/midway.c +++ b/sys/dev/ic/midway.c @@ -1,4 +1,4 @@ -/* $NetBSD: midway.c,v 1.71 2006/05/10 21:53:16 mrg Exp $ */ +/* $NetBSD: midway.c,v 1.72 2006/05/14 21:42:27 elad Exp $ */ /* (sync'd to midway.c 1.68) */ /* @@ -68,7 +68,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: midway.c,v 1.71 2006/05/10 21:53:16 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: midway.c,v 1.72 2006/05/14 21:42:27 elad Exp $"); #include "opt_natm.h" @@ -160,6 +160,7 @@ __KERNEL_RCSID(0, "$NetBSD: midway.c,v 1.71 2006/05/10 21:53:16 mrg Exp $"); #include <sys/socketvar.h> #include <sys/queue.h> #include <sys/proc.h> +#include <sys/kauth.h> #include <net/if.h> #include <net/if_ether.h> @@ -1307,7 +1308,9 @@ caddr_t data; if (ifp == &sc->enif) { struct ifnet *sifp; - if ((error = suser(curproc->p_ucred, &curproc->p_acflag)) != 0) + if ((error = kauth_authorize_generic(curproc->p_cred, + KAUTH_GENERIC_ISSUSER, + &curproc->p_acflag)) != 0) break; if ((sifp = en_pvcattach(ifp)) != NULL) { @@ -1335,7 +1338,9 @@ caddr_t data; break; case SIOCSPVCTX: - if ((error = suser(curproc->p_ucred, &curproc->p_acflag)) == 0) + if ((error = kauth_authorize_generic(curproc->p_cred, + KAUTH_GENERIC_ISSUSER, + &curproc->p_acflag)) == 0) error = en_pvctx(sc, (struct pvctxreq *)data); break; diff --git a/sys/dev/ic/pcdisplayvar.h b/sys/dev/ic/pcdisplayvar.h index 16372b7fd0f..c7973369fa0 100644 --- a/sys/dev/ic/pcdisplayvar.h +++ b/sys/dev/ic/pcdisplayvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: pcdisplayvar.h,v 1.17 2006/04/15 17:48:23 jmmv Exp $ */ +/* $NetBSD: pcdisplayvar.h,v 1.18 2006/05/14 21:42:27 elad Exp $ */ /* * Copyright (c) 1998 diff --git a/sys/dev/ic/rrunner.c b/sys/dev/ic/rrunner.c index d0b03516220..e538be94788 100644 --- a/sys/dev/ic/rrunner.c +++ b/sys/dev/ic/rrunner.c @@ -1,4 +1,4 @@ -/* $NetBSD: rrunner.c,v 1.52 2006/03/28 17:38:30 thorpej Exp $ */ +/* $NetBSD: rrunner.c,v 1.53 2006/05/14 21:42:27 elad Exp $ */ /* * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rrunner.c,v 1.52 2006/03/28 17:38:30 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rrunner.c,v 1.53 2006/05/14 21:42:27 elad Exp $"); #include "opt_inet.h" #include "opt_ns.h" @@ -64,6 +64,7 @@ __KERNEL_RCSID(0, "$NetBSD: rrunner.c,v 1.52 2006/03/28 17:38:30 thorpej Exp $") #include <sys/proc.h> #include <sys/kernel.h> #include <sys/conf.h> +#include <sys/kauth.h> #include <uvm/uvm_extern.h> @@ -3112,7 +3113,9 @@ esh_generic_ioctl(struct esh_softc *sc, u_long cmd, caddr_t data, break; default: - error = suser(p->p_ucred, &p->p_acflag); + error = kauth_authorize_generic(p->p_cred, + KAUTH_GENERIC_ISSUSER, + &p->p_acflag); if (error) return (error); } diff --git a/sys/dev/ic/tulip.c b/sys/dev/ic/tulip.c index 3e1c9ec4f0a..044ed40ecb6 100644 --- a/sys/dev/ic/tulip.c +++ b/sys/dev/ic/tulip.c @@ -1,4 +1,4 @@ -/* $NetBSD: tulip.c,v 1.143 2006/03/25 23:10:50 rpaulo Exp $ */ +/* $NetBSD: tulip.c,v 1.144 2006/05/14 21:42:27 elad Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.143 2006/03/25 23:10:50 rpaulo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.144 2006/05/14 21:42:27 elad Exp $"); #include "bpfilter.h" diff --git a/sys/dev/ic/wi.c b/sys/dev/ic/wi.c index 945f8444922..46493b8fe86 100644 --- a/sys/dev/ic/wi.c +++ b/sys/dev/ic/wi.c @@ -1,4 +1,4 @@ -/* $NetBSD: wi.c,v 1.213 2006/03/12 03:22:02 dyoung Exp $ */ +/* $NetBSD: wi.c,v 1.214 2006/05/14 21:42:27 elad Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -106,7 +106,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: wi.c,v 1.213 2006/03/12 03:22:02 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wi.c,v 1.214 2006/05/14 21:42:27 elad Exp $"); #define WI_HERMES_AUTOINC_WAR /* Work around data write autoinc bug. */ #define WI_HERMES_STATS_WAR /* Work around stats counter bug. */ @@ -126,6 +126,7 @@ __KERNEL_RCSID(0, "$NetBSD: wi.c,v 1.213 2006/03/12 03:22:02 dyoung Exp $"); #include <sys/ioctl.h> #include <sys/kernel.h> /* for hz */ #include <sys/proc.h> +#include <sys/kauth.h> #include <net/if.h> #include <net/if_dl.h> @@ -1405,7 +1406,9 @@ wi_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) error = wi_get_cfg(ifp, cmd, data); break; case SIOCSIFGENERIC: - error = suser(curproc->p_ucred, &curproc->p_acflag); + error = kauth_authorize_generic(curproc->p_cred, + KAUTH_GENERIC_ISSUSER, + &curproc->p_acflag); if (error) break; error = wi_set_cfg(ifp, cmd, data); diff --git a/sys/dev/ic/z8530tty.c b/sys/dev/ic/z8530tty.c index 435926b5448..083fecd7560 100644 --- a/sys/dev/ic/z8530tty.c +++ b/sys/dev/ic/z8530tty.c @@ -1,4 +1,4 @@ -/* $NetBSD: z8530tty.c,v 1.106 2006/04/19 17:44:07 tsutsui Exp $ */ +/* $NetBSD: z8530tty.c,v 1.107 2006/05/14 21:42:27 elad Exp $ */ /*- * Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998, 1999 @@ -137,7 +137,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: z8530tty.c,v 1.106 2006/04/19 17:44:07 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: z8530tty.c,v 1.107 2006/05/14 21:42:27 elad Exp $"); #include "opt_kgdb.h" #include "opt_ntp.h" @@ -155,6 +155,7 @@ __KERNEL_RCSID(0, "$NetBSD: z8530tty.c,v 1.106 2006/04/19 17:44:07 tsutsui Exp $ #include <sys/time.h> #include <sys/kernel.h> #include <sys/syslog.h> +#include <sys/kauth.h> #include <dev/ic/z8530reg.h> #include <machine/z8530var.h> @@ -582,7 +583,8 @@ zsopen(dev, flags, mode, l) if (ISSET(tp->t_state, TS_ISOPEN) && ISSET(tp->t_state, TS_XCLUDE) && - suser(p->p_ucred, &p->p_acflag) != 0) + kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, + &p->p_acflag) != 0) return (EBUSY); s = spltty(); @@ -826,7 +828,8 @@ zsioctl(dev, cmd, data, flag, l) break; case TIOCSFLAGS: - error = suser(p->p_ucred, &p->p_acflag); + error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, + &p->p_acflag); if (error) break; zst->zst_swflags = *(int *)data; |
