summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorelad <elad@NetBSD.org>2006-05-14 21:42:26 +0000
committerelad <elad@NetBSD.org>2006-05-14 21:42:26 +0000
commit2867b68bc3d7cdb1bb7b9f8367e4aa0b2fa765f4 (patch)
treea0add7b65b60ddf03960733156c82bfb90bc978d /sys
parentfc9422c9d9d5eec5abd0d58ae5fa47aedf2198e3 (diff)
integrate kauth.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/DEVNAMES2
-rw-r--r--sys/dev/acpi/acpica/OsdHardware.c4
-rw-r--r--sys/dev/arcbios/arcbios_tty.c7
-rw-r--r--sys/dev/ata/ata_raid_adaptec.c5
-rw-r--r--sys/dev/ata/ata_raid_promise.c5
-rw-r--r--sys/dev/ata/ld_ataraid.c5
-rw-r--r--sys/dev/cardbus/if_ath_cardbus.c4
-rw-r--r--sys/dev/ccd.c21
-rw-r--r--sys/dev/cgd.c12
-rw-r--r--sys/dev/cons.c7
-rw-r--r--sys/dev/dec/dz.c6
-rw-r--r--sys/dev/dksubr.c12
-rw-r--r--sys/dev/dkwedge/dk.c7
-rw-r--r--sys/dev/dmover/dmover_io.c8
-rw-r--r--sys/dev/ebus/cs4231_ebus.c4
-rw-r--r--sys/dev/firmload.c5
-rw-r--r--sys/dev/fss.c20
-rw-r--r--sys/dev/gpib/cs80bus.c4
-rw-r--r--sys/dev/gpib/rd.c4
-rw-r--r--sys/dev/hpc/biconsdev.c7
-rw-r--r--sys/dev/hpc/hpf1275a_tty.c6
-rw-r--r--sys/dev/i2c/ddcreg.h2
-rw-r--r--sys/dev/ic/an.c9
-rw-r--r--sys/dev/ic/cd18xx.c11
-rw-r--r--sys/dev/ic/clmpcc.c13
-rw-r--r--sys/dev/ic/com.c13
-rw-r--r--sys/dev/ic/cy.c12
-rw-r--r--sys/dev/ic/max2820reg.h2
-rw-r--r--sys/dev/ic/midway.c13
-rw-r--r--sys/dev/ic/pcdisplayvar.h2
-rw-r--r--sys/dev/ic/rrunner.c9
-rw-r--r--sys/dev/ic/tulip.c4
-rw-r--r--sys/dev/ic/wi.c9
-rw-r--r--sys/dev/ic/z8530tty.c11
-rw-r--r--sys/dev/ieee1394/sbp.c2
-rw-r--r--sys/dev/if_ndis/if_ndis.c6
-rw-r--r--sys/dev/ir/irframe_tty.c8
-rw-r--r--sys/dev/isa/sbdsp.c4
-rw-r--r--sys/dev/isa/wss_isa.c4
-rw-r--r--sys/dev/kloader.c8
-rw-r--r--sys/dev/marvell/gtmpsc.c6
-rw-r--r--sys/dev/mii/ciphy.c4
-rw-r--r--sys/dev/ofisa/joy_ofisa.c4
-rw-r--r--sys/dev/ofw/ofcons.c6
-rw-r--r--sys/dev/ofw/ofnet.c4
-rw-r--r--sys/dev/pci/agp_i810.c4
-rw-r--r--sys/dev/pci/auixp.c4
-rw-r--r--sys/dev/pci/cz.c9
-rw-r--r--sys/dev/pci/if_iwi.c11
-rw-r--r--sys/dev/pci/if_lmc.c3
-rw-r--r--sys/dev/pci/if_lmc.h5
-rw-r--r--sys/dev/pci/mly.c4
-rw-r--r--sys/dev/pcmcia/if_cnw.c11
-rw-r--r--sys/dev/pcmcia/pcmcia_cis_quirks.c4
-rw-r--r--sys/dev/qbus/dhu.c6
-rw-r--r--sys/dev/qbus/dl.c6
-rw-r--r--sys/dev/qbus/dz_uba.c4
-rw-r--r--sys/dev/qbus/ts.c4
-rw-r--r--sys/dev/raidframe/rf_copyback.c8
-rw-r--r--sys/dev/raidframe/rf_dagdegwr.h2
-rw-r--r--sys/dev/raidframe/rf_disks.c9
-rw-r--r--sys/dev/raidframe/rf_netbsdkintf.c15
-rw-r--r--sys/dev/raidframe/rf_reconstruct.c8
-rw-r--r--sys/dev/rnd.c15
-rw-r--r--sys/dev/sbus/magma.c8
-rw-r--r--sys/dev/sbus/spif.c8
-rw-r--r--sys/dev/tc/asc_tcds.c4
-rw-r--r--sys/dev/tc/pxg.c6
-rw-r--r--sys/dev/tc/stic.c4
-rw-r--r--sys/dev/usb/Makefile2
-rw-r--r--sys/dev/usb/ubtbcmfw.c8
-rw-r--r--sys/dev/usb/ucom.c9
-rw-r--r--sys/dev/usb/ucycom.c9
-rw-r--r--sys/dev/usb/ugensa.c2
-rw-r--r--sys/dev/usb/ulpt.c4
-rw-r--r--sys/dev/usb/usbdevs2
-rw-r--r--sys/dev/verified_exec.c14
-rw-r--r--sys/dev/vme/xd.c7
-rw-r--r--sys/dev/vme/xy.c8
-rw-r--r--sys/dev/vnd.c28
-rw-r--r--sys/dev/vndvar.h5
-rw-r--r--sys/dev/wscons/wsdisplay.c8
-rw-r--r--sys/dev/wscons/wsdisplay_compat_usl.c7
-rw-r--r--sys/dev/wscons/wsdisplay_vcons.c4
-rw-r--r--sys/dev/wscons/wskbd.c10
-rw-r--r--sys/dev/wscons/wsmouse.c4
86 files changed, 341 insertions, 273 deletions
diff --git a/sys/dev/DEVNAMES b/sys/dev/DEVNAMES
index 4538de61ecf..328ca4e6c11 100644
--- a/sys/dev/DEVNAMES
+++ b/sys/dev/DEVNAMES
@@ -1,4 +1,4 @@
-# $NetBSD: DEVNAMES,v 1.198 2006/05/11 21:11:29 gdamore Exp $
+# $NetBSD: DEVNAMES,v 1.199 2006/05/14 21:42:26 elad Exp $
#
# This file contains all used device names and defined attributes in
# alphabetical order. New devices added to the system somewhere should first
diff --git a/sys/dev/acpi/acpica/OsdHardware.c b/sys/dev/acpi/acpica/OsdHardware.c
index 3ce89344edd..b9e369809ff 100644
--- a/sys/dev/acpi/acpica/OsdHardware.c
+++ b/sys/dev/acpi/acpica/OsdHardware.c
@@ -1,4 +1,4 @@
-/* $NetBSD: OsdHardware.c,v 1.1 2006/03/23 13:41:13 kochi Exp $ */
+/* $NetBSD: OsdHardware.c,v 1.2 2006/05/14 21:42:26 elad Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: OsdHardware.c,v 1.1 2006/03/23 13:41:13 kochi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: OsdHardware.c,v 1.2 2006/05/14 21:42:26 elad Exp $");
#include <sys/param.h>
#include <sys/device.h>
diff --git a/sys/dev/arcbios/arcbios_tty.c b/sys/dev/arcbios/arcbios_tty.c
index a33aaa6026c..720240ac5fd 100644
--- a/sys/dev/arcbios/arcbios_tty.c
+++ b/sys/dev/arcbios/arcbios_tty.c
@@ -1,4 +1,4 @@
-/* $NetBSD: arcbios_tty.c,v 1.11 2005/12/11 12:21:14 christos Exp $ */
+/* $NetBSD: arcbios_tty.c,v 1.12 2006/05/14 21:42:26 elad Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: arcbios_tty.c,v 1.11 2005/12/11 12:21:14 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arcbios_tty.c,v 1.12 2006/05/14 21:42:26 elad Exp $");
#include <sys/param.h>
#include <sys/user.h>
@@ -102,7 +102,8 @@ arcbios_ttyopen(dev_t dev, int flag, int mode, struct lwp *l)
setuptimeout = 1;
} else if (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) {
splx(s);
return (EBUSY);
}
diff --git a/sys/dev/ata/ata_raid_adaptec.c b/sys/dev/ata/ata_raid_adaptec.c
index 39f9697b80e..46316aababd 100644
--- a/sys/dev/ata/ata_raid_adaptec.c
+++ b/sys/dev/ata/ata_raid_adaptec.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ata_raid_adaptec.c,v 1.4 2006/03/28 17:38:29 thorpej Exp $ */
+/* $NetBSD: ata_raid_adaptec.c,v 1.5 2006/05/14 21:42:26 elad Exp $ */
/*-
* Copyright (c) 2000,2001,2002 Søren Schmidt <sos@FreeBSD.org>
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ata_raid_adaptec.c,v 1.4 2006/03/28 17:38:29 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata_raid_adaptec.c,v 1.5 2006/05/14 21:42:26 elad Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@@ -47,6 +47,7 @@ __KERNEL_RCSID(0, "$NetBSD: ata_raid_adaptec.c,v 1.4 2006/03/28 17:38:29 thorpej
#include <sys/fcntl.h>
#include <sys/malloc.h>
#include <sys/vnode.h>
+#include <sys/kauth.h>
#include <miscfs/specfs/specdev.h>
diff --git a/sys/dev/ata/ata_raid_promise.c b/sys/dev/ata/ata_raid_promise.c
index 5fb0f4a4b2b..3c4fa855e96 100644
--- a/sys/dev/ata/ata_raid_promise.c
+++ b/sys/dev/ata/ata_raid_promise.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ata_raid_promise.c,v 1.7 2006/03/28 17:38:29 thorpej Exp $ */
+/* $NetBSD: ata_raid_promise.c,v 1.8 2006/05/14 21:42:26 elad Exp $ */
/*-
* Copyright (c) 2000,2001,2002 Søren Schmidt <sos@FreeBSD.org>
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ata_raid_promise.c,v 1.7 2006/03/28 17:38:29 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata_raid_promise.c,v 1.8 2006/05/14 21:42:26 elad Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@@ -47,6 +47,7 @@ __KERNEL_RCSID(0, "$NetBSD: ata_raid_promise.c,v 1.7 2006/03/28 17:38:29 thorpej
#include <sys/fcntl.h>
#include <sys/malloc.h>
#include <sys/vnode.h>
+#include <sys/kauth.h>
#include <miscfs/specfs/specdev.h>
diff --git a/sys/dev/ata/ld_ataraid.c b/sys/dev/ata/ld_ataraid.c
index d382e5d6729..6bf46463b41 100644
--- a/sys/dev/ata/ld_ataraid.c
+++ b/sys/dev/ata/ld_ataraid.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ld_ataraid.c,v 1.15 2006/03/28 17:38:29 thorpej Exp $ */
+/* $NetBSD: ld_ataraid.c,v 1.16 2006/05/14 21:42:26 elad Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ld_ataraid.c,v 1.15 2006/03/28 17:38:29 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld_ataraid.c,v 1.16 2006/05/14 21:42:26 elad Exp $");
#include "rnd.h"
@@ -62,6 +62,7 @@ __KERNEL_RCSID(0, "$NetBSD: ld_ataraid.c,v 1.15 2006/03/28 17:38:29 thorpej Exp
#include <sys/fcntl.h>
#include <sys/malloc.h>
#include <sys/vnode.h>
+#include <sys/kauth.h>
#if NRND > 0
#include <sys/rnd.h>
#endif
diff --git a/sys/dev/cardbus/if_ath_cardbus.c b/sys/dev/cardbus/if_ath_cardbus.c
index c8be9d14ee7..79aa0ad1738 100644
--- a/sys/dev/cardbus/if_ath_cardbus.c
+++ b/sys/dev/cardbus/if_ath_cardbus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ath_cardbus.c,v 1.11 2006/04/02 05:52:50 gdamore Exp $ */
+/* $NetBSD: if_ath_cardbus.c,v 1.12 2006/05/14 21:42:26 elad Exp $ */
/*
* Copyright (c) 2003
* Ichiro FUKUHARA <ichiro@ichiro.org>.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ath_cardbus.c,v 1.11 2006/04/02 05:52:50 gdamore Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ath_cardbus.c,v 1.12 2006/05/14 21:42:26 elad Exp $");
#include "opt_inet.h"
#include "opt_ns.h"
diff --git a/sys/dev/ccd.c b/sys/dev/ccd.c
index 2e95e069339..79fdff3e958 100644
--- a/sys/dev/ccd.c
+++ b/sys/dev/ccd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ccd.c,v 1.109 2006/04/24 21:35:57 jld Exp $ */
+/* $NetBSD: ccd.c,v 1.110 2006/05/14 21:42:26 elad Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 1999 The NetBSD Foundation, Inc.
@@ -125,7 +125,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.109 2006/04/24 21:35:57 jld Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.110 2006/05/14 21:42:26 elad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -147,6 +147,7 @@ __KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.109 2006/04/24 21:35:57 jld Exp $");
#include <sys/conf.h>
#include <sys/lock.h>
#include <sys/queue.h>
+#include <sys/kauth.h>
#include <dev/ccdvar.h>
@@ -323,7 +324,7 @@ ccdinit(struct ccd_softc *cs, char **cpaths, struct vnode **vpp,
/*
* XXX: Cache the component's dev_t.
*/
- if ((error = VOP_GETATTR(vpp[ix], &va, l->l_proc->p_ucred, l)) != 0) {
+ if ((error = VOP_GETATTR(vpp[ix], &va, l->l_proc->p_cred, l)) != 0) {
#ifdef DEBUG
if (ccddebug & (CCDB_FOLLOW|CCDB_INIT))
printf("%s: %s: getattr failed %s = %d\n",
@@ -338,7 +339,7 @@ ccdinit(struct ccd_softc *cs, char **cpaths, struct vnode **vpp,
* Get partition information for the component.
*/
error = VOP_IOCTL(vpp[ix], DIOCGPART, &dpart,
- FREAD, l->l_proc->p_ucred, l);
+ FREAD, l->l_proc->p_cred, l);
if (error) {
#ifdef DEBUG
if (ccddebug & (CCDB_FOLLOW|CCDB_INIT))
@@ -988,7 +989,7 @@ ccdioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
int part, pmask;
struct ccd_softc *cs;
struct ccd_ioctl *ccio = (struct ccd_ioctl *)data;
- struct ucred *uc;
+ kauth_cred_t uc;
char **cpp;
struct vnode **vpp;
#ifdef __HAVE_OLD_DISKLABEL
@@ -999,7 +1000,7 @@ ccdioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
return (ENXIO);
cs = &ccd_softc[unit];
- uc = (l != NULL) ? l->l_proc->p_ucred : NOCRED;
+ uc = (l != NULL) ? l->l_proc->p_cred : NOCRED;
/* Must be open for writes for these commands... */
switch (cmd) {
@@ -1377,24 +1378,24 @@ ccdlookup(char *path, struct lwp *l, struct vnode **vpp /* result */)
if (vp->v_usecount > 1) {
VOP_UNLOCK(vp, 0);
- (void)vn_close(vp, FREAD|FWRITE, p->p_ucred, l);
+ (void)vn_close(vp, FREAD|FWRITE, p->p_cred, l);
return (EBUSY);
}
- if ((error = VOP_GETATTR(vp, &va, p->p_ucred, l)) != 0) {
+ if ((error = VOP_GETATTR(vp, &va, p->p_cred, l)) != 0) {
#ifdef DEBUG
if (ccddebug & (CCDB_FOLLOW|CCDB_INIT))
printf("ccdlookup: getattr error = %d\n", error);
#endif
VOP_UNLOCK(vp, 0);
- (void)vn_close(vp, FREAD|FWRITE, p->p_ucred, l);
+ (void)vn_close(vp, FREAD|FWRITE, p->p_cred, l);
return (error);
}
/* XXX: eventually we should handle VREG, too. */
if (va.va_type != VBLK) {
VOP_UNLOCK(vp, 0);
- (void)vn_close(vp, FREAD|FWRITE, p->p_ucred, l);
+ (void)vn_close(vp, FREAD|FWRITE, p->p_cred, l);
return (ENOTBLK);
}
diff --git a/sys/dev/cgd.c b/sys/dev/cgd.c
index 463d65bf433..66eefbab7f4 100644
--- a/sys/dev/cgd.c
+++ b/sys/dev/cgd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd.c,v 1.34 2006/01/04 17:16:35 xtraeme Exp $ */
+/* $NetBSD: cgd.c,v 1.35 2006/05/14 21:42:26 elad Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.34 2006/01/04 17:16:35 xtraeme Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.35 2006/05/14 21:42:26 elad Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -570,7 +570,7 @@ cgd_ioctl_set(struct cgd_softc *cs, void *data, struct lwp *l)
return 0;
bail:
- (void)vn_close(vp, FREAD|FWRITE, l->l_proc->p_ucred, l);
+ (void)vn_close(vp, FREAD|FWRITE, l->l_proc->p_cred, l);
return ret;
}
@@ -589,7 +589,7 @@ cgd_ioctl_clr(struct cgd_softc *cs, void *data, struct lwp *l)
splx(s);
bufq_free(cs->sc_dksc.sc_bufq);
- (void)vn_close(cs->sc_tvn, FREAD|FWRITE, l->l_proc->p_ucred, l);
+ (void)vn_close(cs->sc_tvn, FREAD|FWRITE, l->l_proc->p_cred, l);
cs->sc_cfuncs->cf_destroy(cs->sc_cdata.cf_priv);
free(cs->sc_tpath, M_DEVBUF);
free(cs->sc_data, M_DEVBUF);
@@ -622,12 +622,12 @@ cgdinit(struct cgd_softc *cs, const char *cpath, struct vnode *vp,
cs->sc_tpath = malloc(cs->sc_tpathlen, M_DEVBUF, M_WAITOK);
memcpy(cs->sc_tpath, tmppath, cs->sc_tpathlen);
- if ((ret = VOP_GETATTR(vp, &va, l->l_proc->p_ucred, l)) != 0)
+ if ((ret = VOP_GETATTR(vp, &va, l->l_proc->p_cred, l)) != 0)
goto bail;
cs->sc_tdev = va.va_rdev;
- ret = VOP_IOCTL(vp, DIOCGPART, &dpart, FREAD, l->l_proc->p_ucred, l);
+ ret = VOP_IOCTL(vp, DIOCGPART, &dpart, FREAD, l->l_proc->p_cred, l);
if (ret)
goto bail;
diff --git a/sys/dev/cons.c b/sys/dev/cons.c
index 1512f1968ef..dbc0e60abaa 100644
--- a/sys/dev/cons.c
+++ b/sys/dev/cons.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cons.c,v 1.57 2005/12/11 12:20:53 christos Exp $ */
+/* $NetBSD: cons.c,v 1.58 2006/05/14 21:42:26 elad Exp $ */
/*
* Copyright (c) 1990, 1993
@@ -78,7 +78,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cons.c,v 1.57 2005/12/11 12:20:53 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cons.c,v 1.58 2006/05/14 21:42:26 elad Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@@ -91,6 +91,7 @@ __KERNEL_RCSID(0, "$NetBSD: cons.c,v 1.57 2005/12/11 12:20:53 christos Exp $");
#include <sys/file.h>
#include <sys/conf.h>
#include <sys/vnode.h>
+#include <sys/kauth.h>
#include <dev/cons.h>
@@ -236,7 +237,7 @@ cnioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
* output from the "virtual" console.
*/
if (cmd == TIOCCONS && constty != NULL) {
- error = suser(l->l_proc->p_ucred, (u_short *) NULL);
+ error = kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, (u_short *) NULL);
if (error)
return (error);
constty = NULL;
diff --git a/sys/dev/dec/dz.c b/sys/dev/dec/dz.c
index 67300b946c2..642ebe3700c 100644
--- a/sys/dev/dec/dz.c
+++ b/sys/dev/dec/dz.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dz.c,v 1.18 2005/12/11 12:21:20 christos Exp $ */
+/* $NetBSD: dz.c,v 1.19 2006/05/14 21:42:27 elad Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dz.c,v 1.18 2005/12/11 12:21:20 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dz.c,v 1.19 2006/05/14 21:42:27 elad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -359,7 +359,7 @@ dzopen(dev_t dev, int flag, int mode, struct lwp *l)
(void) dzparam(tp, &tp->t_termios);
ttsetwater(tp);
} else if ((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);
/* Use DMBIS and *not* DMSET or else we clobber incoming bits */
if (dzmctl(sc, line, DML_DTR, DMBIS) & DML_DCD)
diff --git a/sys/dev/dksubr.c b/sys/dev/dksubr.c
index fc4b3e3beb8..1b38accac14 100644
--- a/sys/dev/dksubr.c
+++ b/sys/dev/dksubr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dksubr.c,v 1.21 2005/12/26 10:36:47 yamt Exp $ */
+/* $NetBSD: dksubr.c,v 1.22 2006/05/14 21:42:26 elad Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 1999, 2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.21 2005/12/26 10:36:47 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.22 2006/05/14 21:42:26 elad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -657,22 +657,22 @@ dk_lookup(path, l, vpp)
if (vp->v_usecount > 1) {
VOP_UNLOCK(vp, 0);
- (void)vn_close(vp, FREAD|FWRITE, p->p_ucred, l);
+ (void)vn_close(vp, FREAD|FWRITE, p->p_cred, l);
return (EBUSY);
}
- if ((error = VOP_GETATTR(vp, &va, p->p_ucred, l)) != 0) {
+ if ((error = VOP_GETATTR(vp, &va, p->p_cred, l)) != 0) {
DPRINTF((DKDB_FOLLOW|DKDB_INIT),
("dk_lookup: getattr error = %d\n", error));
VOP_UNLOCK(vp, 0);
- (void)vn_close(vp, FREAD|FWRITE, p->p_ucred, l);
+ (void)vn_close(vp, FREAD|FWRITE, p->p_cred, l);
return (error);
}
/* XXX: eventually we should handle VREG, too. */
if (va.va_type != VBLK) {
VOP_UNLOCK(vp, 0);
- (void)vn_close(vp, FREAD|FWRITE, p->p_ucred, l);
+ (void)vn_close(vp, FREAD|FWRITE, p->p_cred, l);
return (ENOTBLK);
}
diff --git a/sys/dev/dkwedge/dk.c b/sys/dev/dkwedge/dk.c
index 7e5c91d9c94..9050ccdb577 100644
--- a/sys/dev/dkwedge/dk.c
+++ b/sys/dev/dkwedge/dk.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dk.c,v 1.14 2006/04/06 17:55:43 thorpej Exp $ */
+/* $NetBSD: dk.c,v 1.15 2006/05/14 21:42:27 elad Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.14 2006/04/06 17:55:43 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.15 2006/05/14 21:42:27 elad Exp $");
#include "opt_dkwedge.h"
@@ -60,6 +60,7 @@ __KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.14 2006/04/06 17:55:43 thorpej Exp $");
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/device.h>
+#include <sys/kauth.h>
#include <miscfs/specfs/specdev.h>
@@ -1183,7 +1184,7 @@ dkioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
else
error = VOP_IOCTL(sc->sc_parent->dk_rawvp,
cmd, data, flag,
- l != NULL ? l->l_proc->p_ucred : NOCRED, l);
+ l != NULL ? l->l_proc->p_cred : NOCRED, l);
break;
case DIOCGWEDGEINFO:
{
diff --git a/sys/dev/dmover/dmover_io.c b/sys/dev/dmover/dmover_io.c
index c55cb789dd6..e9a6c71bf6a 100644
--- a/sys/dev/dmover/dmover_io.c
+++ b/sys/dev/dmover/dmover_io.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dmover_io.c,v 1.21 2006/03/01 12:38:13 yamt Exp $ */
+/* $NetBSD: dmover_io.c,v 1.22 2006/05/14 21:42:27 elad Exp $ */
/*
* Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -55,7 +55,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dmover_io.c,v 1.21 2006/03/01 12:38:13 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dmover_io.c,v 1.22 2006/05/14 21:42:27 elad Exp $");
#include <sys/param.h>
#include <sys/queue.h>
@@ -343,7 +343,7 @@ dmio_usrreq_fini1(struct work *wk, void *dummy)
*/
static int
dmio_read(struct file *fp, off_t *offp, struct uio *uio,
- struct ucred *cred, int flags)
+ kauth_cred_t cred, int flags)
{
struct dmio_state *ds = (struct dmio_state *) fp->f_data;
struct dmio_usrreq_state *dus;
@@ -471,7 +471,7 @@ dmio_usrreq_done(struct dmover_request *dreq)
*/
static int
dmio_write(struct file *fp, off_t *offp, struct uio *uio,
- struct ucred *cred, int flags)
+ kauth_cred_t cred, int flags)
{
struct dmio_state *ds = (struct dmio_state *) fp->f_data;
struct dmio_usrreq_state *dus;
diff --git a/sys/dev/ebus/cs4231_ebus.c b/sys/dev/ebus/cs4231_ebus.c
index 47c68e7bcfa..5d18cbf5920 100644
--- a/sys/dev/ebus/cs4231_ebus.c
+++ b/sys/dev/ebus/cs4231_ebus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cs4231_ebus.c,v 1.20 2006/03/29 06:29:20 thorpej Exp $ */
+/* $NetBSD: cs4231_ebus.c,v 1.21 2006/05/14 21:42:27 elad Exp $ */
/*
* Copyright (c) 2002 Valeriy E. Ushakov
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cs4231_ebus.c,v 1.20 2006/03/29 06:29:20 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cs4231_ebus.c,v 1.21 2006/05/14 21:42:27 elad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
diff --git a/sys/dev/firmload.c b/sys/dev/firmload.c
index 2caa2a1a847..e1feec3d751 100644
--- a/sys/dev/firmload.c
+++ b/sys/dev/firmload.c
@@ -1,4 +1,4 @@
-/* $NetBSD: firmload.c,v 1.2 2006/04/17 17:30:32 rpaulo Exp $ */
+/* $NetBSD: firmload.c,v 1.3 2006/05/14 21:42:26 elad Exp $ */
/*-
* Copyright (c) 2005, 2006 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: firmload.c,v 1.2 2006/04/17 17:30:32 rpaulo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: firmload.c,v 1.3 2006/05/14 21:42:26 elad Exp $");
/*
* The firmload API provides an interface for device drivers to access
@@ -51,6 +51,7 @@ __KERNEL_RCSID(0, "$NetBSD: firmload.c,v 1.2 2006/04/17 17:30:32 rpaulo Exp $");
#include <sys/systm.h>
#include <sys/sysctl.h>
#include <sys/vnode.h>
+#include <sys/kauth.h>
#include <dev/firmload.h>
diff --git a/sys/dev/fss.c b/sys/dev/fss.c
index 141e36eb12d..8de9190a398 100644
--- a/sys/dev/fss.c
+++ b/sys/dev/fss.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fss.c,v 1.25 2006/05/10 21:53:16 mrg Exp $ */
+/* $NetBSD: fss.c,v 1.26 2006/05/14 21:42:26 elad Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.25 2006/05/10 21:53:16 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.26 2006/05/14 21:42:26 elad Exp $");
#include "fss.h"
@@ -608,7 +608,7 @@ fss_create_files(struct fss_softc *sc, struct fss_set *fss,
}
error = VOP_IOCTL(nd.ni_vp, DIOCGPART, &dpart, FREAD,
- l->l_proc->p_ucred, l);
+ l->l_proc->p_cred, l);
if (error) {
vrele(nd.ni_vp);
return error;
@@ -634,7 +634,7 @@ fss_create_files(struct fss_softc *sc, struct fss_set *fss,
return EINVAL;
if (sc->sc_bs_vp->v_type == VREG) {
- error = VOP_GETATTR(sc->sc_bs_vp, &va, l->l_proc->p_ucred, l);
+ error = VOP_GETATTR(sc->sc_bs_vp, &va, l->l_proc->p_cred, l);
if (error != 0)
return error;
sc->sc_bs_size = va.va_size;
@@ -658,7 +658,7 @@ fss_create_files(struct fss_softc *sc, struct fss_set *fss,
* VOP_STRATEGY() clean the buffer cache to prevent
* cache incoherencies.
*/
- if ((error = vinvalbuf(sc->sc_bs_vp, V_SAVE, l->l_proc->p_ucred, l, 0, 0)) != 0)
+ if ((error = vinvalbuf(sc->sc_bs_vp, V_SAVE, l->l_proc->p_cred, l, 0, 0)) != 0)
return error;
return 0;
@@ -769,9 +769,9 @@ bad:
fss_softc_free(sc);
if (sc->sc_bs_vp != NULL) {
if (sc->sc_flags & FSS_PERSISTENT)
- vn_close(sc->sc_bs_vp, FREAD, l->l_proc->p_ucred, l);
+ vn_close(sc->sc_bs_vp, FREAD, l->l_proc->p_cred, l);
else
- vn_close(sc->sc_bs_vp, FREAD|FWRITE, l->l_proc->p_ucred, l);
+ vn_close(sc->sc_bs_vp, FREAD|FWRITE, l->l_proc->p_cred, l);
}
sc->sc_bs_vp = NULL;
@@ -797,9 +797,9 @@ fss_delete_snapshot(struct fss_softc *sc, struct lwp *l)
fss_softc_free(sc);
if (sc->sc_flags & FSS_PERSISTENT)
- vn_close(sc->sc_bs_vp, FREAD, l->l_proc->p_ucred, l);
+ vn_close(sc->sc_bs_vp, FREAD, l->l_proc->p_cred, l);
else
- vn_close(sc->sc_bs_vp, FREAD|FWRITE, l->l_proc->p_ucred, l);
+ vn_close(sc->sc_bs_vp, FREAD|FWRITE, l->l_proc->p_cred, l);
sc->sc_bs_vp = NULL;
sc->sc_flags &= ~FSS_PERSISTENT;
@@ -951,7 +951,7 @@ fss_bs_io(struct fss_softc *sc, fss_io_type rw,
error = vn_rdwr((rw == FSS_READ ? UIO_READ : UIO_WRITE), sc->sc_bs_vp,
data, len, off, UIO_SYSSPACE, IO_UNIT|IO_NODELOCKED,
- sc->sc_bs_proc->p_ucred, NULL, NULL);
+ sc->sc_bs_proc->p_cred, NULL, NULL);
if (error == 0) {
simple_lock(&sc->sc_bs_vp->v_interlock);
error = VOP_PUTPAGES(sc->sc_bs_vp, trunc_page(off),
diff --git a/sys/dev/gpib/cs80bus.c b/sys/dev/gpib/cs80bus.c
index 52113e487f3..d954bfc5e0d 100644
--- a/sys/dev/gpib/cs80bus.c
+++ b/sys/dev/gpib/cs80bus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cs80bus.c,v 1.6 2006/03/29 06:33:50 thorpej Exp $ */
+/* $NetBSD: cs80bus.c,v 1.7 2006/05/14 21:42:27 elad Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cs80bus.c,v 1.6 2006/03/29 06:33:50 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cs80bus.c,v 1.7 2006/05/14 21:42:27 elad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
diff --git a/sys/dev/gpib/rd.c b/sys/dev/gpib/rd.c
index a23516820d4..831890af75c 100644
--- a/sys/dev/gpib/rd.c
+++ b/sys/dev/gpib/rd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rd.c,v 1.12 2006/04/14 13:09:06 blymn Exp $ */
+/* $NetBSD: rd.c,v 1.13 2006/05/14 21:42:27 elad Exp $ */
/*-
* Copyright (c) 1996-2003 The NetBSD Foundation, Inc.
@@ -118,7 +118,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.12 2006/04/14 13:09:06 blymn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.13 2006/05/14 21:42:27 elad Exp $");
#include "rnd.h"
diff --git a/sys/dev/hpc/biconsdev.c b/sys/dev/hpc/biconsdev.c
index 9aa2df5f83d..49732219576 100644
--- a/sys/dev/hpc/biconsdev.c
+++ b/sys/dev/hpc/biconsdev.c
@@ -1,4 +1,4 @@
-/* $NetBSD: biconsdev.c,v 1.13 2005/12/11 12:21:22 christos Exp $ */
+/* $NetBSD: biconsdev.c,v 1.14 2006/05/14 21:42:27 elad Exp $ */
/*-
* Copyright (c) 1999-2001
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: biconsdev.c,v 1.13 2005/12/11 12:21:22 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: biconsdev.c,v 1.14 2006/05/14 21:42:27 elad Exp $");
#include "biconsdev.h"
#include <sys/param.h>
@@ -182,7 +182,8 @@ biconsdevopen(dev_t dev, int flag, int mode, struct lwp *l)
(void)(*tp->t_param)(tp, &tp->t_termios);
ttsetwater(tp);
} else if (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);
status = (*tp->t_linesw->l_open)(dev, tp);
diff --git a/sys/dev/hpc/hpf1275a_tty.c b/sys/dev/hpc/hpf1275a_tty.c
index 6655a6d8beb..0fdaaf8fbd6 100644
--- a/sys/dev/hpc/hpf1275a_tty.c
+++ b/sys/dev/hpc/hpf1275a_tty.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hpf1275a_tty.c,v 1.7 2006/03/29 06:37:35 thorpej Exp $ */
+/* $NetBSD: hpf1275a_tty.c,v 1.8 2006/05/14 21:42:27 elad Exp $ */
/*
* Copyright (c) 2004 Valeriy E. Ushakov
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hpf1275a_tty.c,v 1.7 2006/03/29 06:37:35 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hpf1275a_tty.c,v 1.8 2006/05/14 21:42:27 elad Exp $");
#include "opt_wsdisplay_compat.h"
@@ -307,7 +307,7 @@ hpf1275a_open(dev_t dev, struct tty *tp)
struct hpf1275a_softc *sc;
int error, s;
- if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
+ if ((error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag)) != 0)
return (error);
s = spltty();
diff --git a/sys/dev/i2c/ddcreg.h b/sys/dev/i2c/ddcreg.h
index 0bf37bd06dd..1956d7cef91 100644
--- a/sys/dev/i2c/ddcreg.h
+++ b/sys/dev/i2c/ddcreg.h
@@ -1,4 +1,4 @@
-/* $NetBSD: ddcreg.h,v 1.1 2006/04/25 21:18:16 gdamore Exp $ */
+/* $NetBSD: ddcreg.h,v 1.2 2006/05/14 21:42:27 elad Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
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;
diff --git a/sys/dev/ieee1394/sbp.c b/sys/dev/ieee1394/sbp.c
index e0a7cf8ab18..79728172afe 100644
--- a/sys/dev/ieee1394/sbp.c
+++ b/sys/dev/ieee1394/sbp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sbp.c,v 1.10 2006/04/30 13:25:04 kiyohara Exp $ */
+/* $NetBSD: sbp.c,v 1.11 2006/05/14 21:42:27 elad Exp $ */
/*-
* Copyright (c) 2003 Hidetoshi Shimokawa
* Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
diff --git a/sys/dev/if_ndis/if_ndis.c b/sys/dev/if_ndis/if_ndis.c
index 2a0c3a75c06..5bf8627acf4 100644
--- a/sys/dev/if_ndis/if_ndis.c
+++ b/sys/dev/if_ndis/if_ndis.c
@@ -35,7 +35,7 @@
__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis.c,v 1.69.2.6 2005/03/31 04:24:36 wpaul Exp $");
#endif
#ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: if_ndis.c,v 1.7 2006/04/23 22:53:43 rittera Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ndis.c,v 1.8 2006/05/14 21:42:27 elad Exp $");
#endif
#ifdef __FreeBSD__
@@ -53,6 +53,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_ndis.c,v 1.7 2006/04/23 22:53:43 rittera Exp $");
#ifdef __NetBSD__
#include <sys/device.h>
+#include <sys/kauth.h>
#endif
#ifdef __FreeBSD__
@@ -2763,7 +2764,8 @@ ndis_wi_ioctl_set(ifp, command, data)
#ifdef __FreeBSD__
error = suser(curthread);
#else /* __NetBSD__ */
- error = suser(curproc->p_ucred, &curproc->p_acflag);
+ error = kauth_authorize_generic(curproc->p_cred,
+ KAUTH_GENERIC_ISSUSER, &curproc->p_acflag);
#endif
if (error)
return (error);
diff --git a/sys/dev/ir/irframe_tty.c b/sys/dev/ir/irframe_tty.c
index 0d2b061a99a..a4515077b79 100644
--- a/sys/dev/ir/irframe_tty.c
+++ b/sys/dev/ir/irframe_tty.c
@@ -1,4 +1,4 @@
-/* $NetBSD: irframe_tty.c,v 1.33 2006/03/28 17:38:33 thorpej Exp $ */
+/* $NetBSD: irframe_tty.c,v 1.34 2006/05/14 21:42:27 elad Exp $ */
/*
* TODO
@@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: irframe_tty.c,v 1.33 2006/03/28 17:38:33 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: irframe_tty.c,v 1.34 2006/05/14 21:42:27 elad Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@@ -63,6 +63,7 @@ __KERNEL_RCSID(0, "$NetBSD: irframe_tty.c,v 1.33 2006/03/28 17:38:33 thorpej Exp
#include <sys/file.h>
#include <sys/vnode.h>
#include <sys/poll.h>
+#include <sys/kauth.h>
#include <dev/ir/ir.h>
#include <dev/ir/sir.h>
@@ -223,7 +224,8 @@ irframetopen(dev_t dev, struct tty *tp)
p = l->l_proc;
DPRINTF(("%s\n", __FUNCTION__));
- if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
+ if ((error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER,
+ &p->p_acflag)) != 0)
return (error);
s = spltty();
diff --git a/sys/dev/isa/sbdsp.c b/sys/dev/isa/sbdsp.c
index 6d07b7c1169..e3427749c14 100644
--- a/sys/dev/isa/sbdsp.c
+++ b/sys/dev/isa/sbdsp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sbdsp.c,v 1.121 2006/04/13 03:45:44 christos Exp $ */
+/* $NetBSD: sbdsp.c,v 1.122 2006/05/14 21:42:27 elad Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -81,7 +81,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sbdsp.c,v 1.121 2006/04/13 03:45:44 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbdsp.c,v 1.122 2006/05/14 21:42:27 elad Exp $");
#include "midi.h"
#include "mpu.h"
diff --git a/sys/dev/isa/wss_isa.c b/sys/dev/isa/wss_isa.c
index 00a41c8ccc9..c904d8a13fc 100644
--- a/sys/dev/isa/wss_isa.c
+++ b/sys/dev/isa/wss_isa.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wss_isa.c,v 1.20 2006/03/29 04:16:50 thorpej Exp $ */
+/* $NetBSD: wss_isa.c,v 1.21 2006/05/14 21:42:27 elad Exp $ */
/*
* Copyright (c) 1994 John Brezak
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wss_isa.c,v 1.20 2006/03/29 04:16:50 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wss_isa.c,v 1.21 2006/05/14 21:42:27 elad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
diff --git a/sys/dev/kloader.c b/sys/dev/kloader.c
index 2351bd6f702..9257b7a945f 100644
--- a/sys/dev/kloader.c
+++ b/sys/dev/kloader.c
@@ -1,4 +1,4 @@
-/* $NetBSD: kloader.c,v 1.9 2006/01/20 02:47:30 uwe Exp $ */
+/* $NetBSD: kloader.c,v 1.10 2006/05/14 21:42:26 elad Exp $ */
/*-
* Copyright (c) 2001, 2002, 2004 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kloader.c,v 1.9 2006/01/20 02:47:30 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kloader.c,v 1.10 2006/05/14 21:42:26 elad Exp $");
#include "debug_kloader.h"
@@ -624,7 +624,7 @@ kloader_close()
struct vnode *vp = kloader.vp;
VOP_UNLOCK(vp, 0);
- vn_close(vp, FREAD, l->l_proc->p_ucred, l);
+ vn_close(vp, FREAD, l->l_proc->p_cred, l);
}
int
@@ -636,7 +636,7 @@ kloader_read(size_t ofs, size_t size, void *buf)
int error;
error = vn_rdwr(UIO_READ, vp, buf, size, ofs, UIO_SYSSPACE,
- IO_NODELOCKED | IO_SYNC, l->l_proc->p_ucred, &resid, NULL);
+ IO_NODELOCKED | IO_SYNC, l->l_proc->p_cred, &resid, NULL);
if (error)
PRINTF("read error.\n");
diff --git a/sys/dev/marvell/gtmpsc.c b/sys/dev/marvell/gtmpsc.c
index 3f131496b29..015520427ef 100644
--- a/sys/dev/marvell/gtmpsc.c
+++ b/sys/dev/marvell/gtmpsc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: gtmpsc.c,v 1.16 2006/03/29 06:55:32 thorpej Exp $ */
+/* $NetBSD: gtmpsc.c,v 1.17 2006/05/14 21:42:27 elad Exp $ */
/*
* Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc.
@@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gtmpsc.c,v 1.16 2006/03/29 06:55:32 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gtmpsc.c,v 1.17 2006/05/14 21:42:27 elad Exp $");
#include "opt_kgdb.h"
@@ -611,7 +611,7 @@ gtmpscopen(dev_t dev, int flag, int mode, struct lwp *l)
tp = sc->gtmpsc_tty;
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();
diff --git a/sys/dev/mii/ciphy.c b/sys/dev/mii/ciphy.c
index aac55a3b815..0f97ccadc2b 100644
--- a/sys/dev/mii/ciphy.c
+++ b/sys/dev/mii/ciphy.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ciphy.c,v 1.6 2006/03/29 07:05:24 thorpej Exp $ */
+/* $NetBSD: ciphy.c,v 1.7 2006/05/14 21:42:28 elad Exp $ */
/*-
* Copyright (c) 2004
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.6 2006/03/29 07:05:24 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.7 2006/05/14 21:42:28 elad Exp $");
/*
* Driver for the Cicada CS8201 10/100/1000 copper PHY.
diff --git a/sys/dev/ofisa/joy_ofisa.c b/sys/dev/ofisa/joy_ofisa.c
index 6255f74d887..758ce088748 100644
--- a/sys/dev/ofisa/joy_ofisa.c
+++ b/sys/dev/ofisa/joy_ofisa.c
@@ -1,4 +1,4 @@
-/* $NetBSD: joy_ofisa.c,v 1.10 2006/03/29 07:09:33 thorpej Exp $ */
+/* $NetBSD: joy_ofisa.c,v 1.11 2006/05/14 21:42:28 elad Exp $ */
/*-
* Copyright (c) 1996, 1998 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: joy_ofisa.c,v 1.10 2006/03/29 07:09:33 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: joy_ofisa.c,v 1.11 2006/05/14 21:42:28 elad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
diff --git a/sys/dev/ofw/ofcons.c b/sys/dev/ofw/ofcons.c
index eb5940bf64f..9a630f20058 100644
--- a/sys/dev/ofw/ofcons.c
+++ b/sys/dev/ofw/ofcons.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ofcons.c,v 1.25 2006/03/29 07:10:25 thorpej Exp $ */
+/* $NetBSD: ofcons.c,v 1.26 2006/05/14 21:42:28 elad Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofcons.c,v 1.25 2006/03/29 07:10:25 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofcons.c,v 1.26 2006/05/14 21:42:28 elad Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@@ -146,7 +146,7 @@ ofcons_open(dev, flag, mode, l)
ofcons_param(tp, &tp->t_termios);
ttsetwater(tp);
} else if ((tp->t_state&TS_XCLUDE) &&
- suser(l->l_proc->p_ucred, &l->l_proc->p_acflag))
+ kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag))
return EBUSY;
tp->t_state |= TS_CARR_ON;
diff --git a/sys/dev/ofw/ofnet.c b/sys/dev/ofw/ofnet.c
index 1c0ab75bff6..4343d049767 100644
--- a/sys/dev/ofw/ofnet.c
+++ b/sys/dev/ofw/ofnet.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ofnet.c,v 1.36 2006/03/29 07:10:25 thorpej Exp $ */
+/* $NetBSD: ofnet.c,v 1.37 2006/05/14 21:42:28 elad Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofnet.c,v 1.36 2006/03/29 07:10:25 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofnet.c,v 1.37 2006/05/14 21:42:28 elad Exp $");
#include "ofnet.h"
#include "opt_inet.h"
diff --git a/sys/dev/pci/agp_i810.c b/sys/dev/pci/agp_i810.c
index f879b3bbada..13d0fdf9305 100644
--- a/sys/dev/pci/agp_i810.c
+++ b/sys/dev/pci/agp_i810.c
@@ -1,4 +1,4 @@
-/* $NetBSD: agp_i810.c,v 1.29 2006/04/15 20:23:32 rpaulo Exp $ */
+/* $NetBSD: agp_i810.c,v 1.30 2006/05/14 21:45:00 elad Exp $ */
/*-
* Copyright (c) 2000 Doug Rabson
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: agp_i810.c,v 1.29 2006/04/15 20:23:32 rpaulo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: agp_i810.c,v 1.30 2006/05/14 21:45:00 elad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
diff --git a/sys/dev/pci/auixp.c b/sys/dev/pci/auixp.c
index 96629ee39b6..d2ab9aa1601 100644
--- a/sys/dev/pci/auixp.c
+++ b/sys/dev/pci/auixp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: auixp.c,v 1.12 2006/04/11 16:34:57 rpaulo Exp $ */
+/* $NetBSD: auixp.c,v 1.13 2006/05/14 21:45:00 elad Exp $ */
/*
* Copyright (c) 2004, 2005 Reinoud Zandijk <reinoud@netbsd.org>
@@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: auixp.c,v 1.12 2006/04/11 16:34:57 rpaulo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auixp.c,v 1.13 2006/05/14 21:45:00 elad Exp $");
#include <sys/types.h>
#include <sys/errno.h>
diff --git a/sys/dev/pci/cz.c b/sys/dev/pci/cz.c
index c7b81bf19d2..9426c36c59a 100644
--- a/sys/dev/pci/cz.c
+++ b/sys/dev/pci/cz.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cz.c,v 1.36 2006/03/28 17:38:34 thorpej Exp $ */
+/* $NetBSD: cz.c,v 1.37 2006/05/14 21:45:00 elad Exp $ */
/*-
* Copyright (c) 2000 Zembu Labs, Inc.
@@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cz.c,v 1.36 2006/03/28 17:38:34 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cz.c,v 1.37 2006/05/14 21:45:00 elad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -86,6 +86,7 @@ __KERNEL_RCSID(0, "$NetBSD: cz.c,v 1.36 2006/03/28 17:38:34 thorpej Exp $");
#include <sys/kernel.h>
#include <sys/fcntl.h>
#include <sys/syslog.h>
+#include <sys/kauth.h>
#include <sys/callout.h>
@@ -961,7 +962,7 @@ czttyopen(dev_t dev, int flags, 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();
@@ -1168,7 +1169,7 @@ czttyioctl(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/pci/if_iwi.c b/sys/dev/pci/if_iwi.c
index 65be56f4984..619827fa9d8 100644
--- a/sys/dev/pci/if_iwi.c
+++ b/sys/dev/pci/if_iwi.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_iwi.c,v 1.47 2006/04/11 15:42:56 rpaulo Exp $ */
+/* $NetBSD: if_iwi.c,v 1.48 2006/05/14 21:45:00 elad Exp $ */
/*-
* Copyright (c) 2004, 2005
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.47 2006/04/11 15:42:56 rpaulo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.48 2006/05/14 21:45:00 elad Exp $");
/*-
* Intel(R) PRO/Wireless 2200BG/2225BG/2915ABG driver
@@ -46,6 +46,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.47 2006/04/11 15:42:56 rpaulo Exp $");
#include <sys/systm.h>
#include <sys/malloc.h>
#include <sys/conf.h>
+#include <sys/kauth.h>
#include <machine/bus.h>
#include <machine/endian.h>
@@ -1942,7 +1943,8 @@ iwi_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
case SIOCSLOADFW:
/* only super-user can do that! */
- 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;
error = iwi_cache_firmware(sc, ifr->ifr_data);
@@ -1950,7 +1952,8 @@ iwi_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
case SIOCSKILLFW:
/* only super-user can do that! */
- 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;
ifp->if_flags &= ~IFF_UP;
diff --git a/sys/dev/pci/if_lmc.c b/sys/dev/pci/if_lmc.c
index 95db972e726..6741ef91813 100644
--- a/sys/dev/pci/if_lmc.c
+++ b/sys/dev/pci/if_lmc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_lmc.c,v 1.28 2006/04/20 16:51:57 christos Exp $ */
+/* $NetBSD: if_lmc.c,v 1.29 2006/05/14 21:45:00 elad Exp $ */
/*-
* Copyright (c) 2002-2006 David Boggs. <boggs@boggs.palo-alto.ca.us>
@@ -166,6 +166,7 @@
# include <sys/sockio.h>
# include <sys/device.h>
# include <sys/reboot.h>
+# include <sys/kauth.h>
# include <net/if.h>
# include <net/if_types.h>
# include <net/if_media.h>
diff --git a/sys/dev/pci/if_lmc.h b/sys/dev/pci/if_lmc.h
index b417656dd3a..963ba052635 100644
--- a/sys/dev/pci/if_lmc.h
+++ b/sys/dev/pci/if_lmc.h
@@ -1,5 +1,5 @@
/*-
- * $NetBSD: if_lmc.h,v 1.3 2006/04/20 16:51:58 christos Exp $
+ * $NetBSD: if_lmc.h,v 1.4 2006/05/14 21:45:00 elad Exp $
*
* Copyright (c) 2002-2006 David Boggs. (boggs@boggs.palo-alto.ca.us)
* All rights reserved.
@@ -1071,8 +1071,7 @@ typedef int intr_return_t;
# define TOP_UNLOCK(sc) __cpu_simple_unlock (&(sc)->top_lock)
# define BOTTOM_TRYLOCK(sc) __cpu_simple_lock_try(&(sc)->bottom_lock)
# define BOTTOM_UNLOCK(sc) __cpu_simple_unlock (&(sc)->bottom_lock)
-# define CHECK_CAP suser(curproc->p_ucred, &curproc->p_acflag)
-/* kauth_authorize_generic(curproc->p_cred, KAUTH_GENERIC_ISSUSER, &curproc->p_acflag) */
+# define CHECK_CAP kauth_authorize_generic(curproc->p_cred, KAUTH_GENERIC_ISSUSER, &curproc->p_acflag)
# define DISABLE_INTR int spl = splnet()
# define ENABLE_INTR splx(spl)
# define IRQ_NONE 0
diff --git a/sys/dev/pci/mly.c b/sys/dev/pci/mly.c
index cf717addfb2..915c9cf5ec6 100644
--- a/sys/dev/pci/mly.c
+++ b/sys/dev/pci/mly.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mly.c,v 1.26 2006/04/14 17:58:01 christos Exp $ */
+/* $NetBSD: mly.c,v 1.27 2006/05/14 21:45:00 elad Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mly.c,v 1.26 2006/04/14 17:58:01 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mly.c,v 1.27 2006/05/14 21:45:00 elad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
diff --git a/sys/dev/pcmcia/if_cnw.c b/sys/dev/pcmcia/if_cnw.c
index 8a4ca4bdaa7..930bed49c42 100644
--- a/sys/dev/pcmcia/if_cnw.c
+++ b/sys/dev/pcmcia/if_cnw.c
@@ -1,4 +1,4 @@
-/* $NetBSD: if_cnw.c,v 1.33 2006/02/20 16:50:37 thorpej Exp $ */
+/* $NetBSD: if_cnw.c,v 1.34 2006/05/14 21:45:00 elad Exp $ */
/*-
* Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
@@ -112,7 +112,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_cnw.c,v 1.33 2006/02/20 16:50:37 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cnw.c,v 1.34 2006/05/14 21:45:00 elad Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@@ -124,6 +124,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_cnw.c,v 1.33 2006/02/20 16:50:37 thorpej Exp $");
#include <sys/mbuf.h>
#include <sys/ioctl.h>
#include <sys/proc.h>
+#include <sys/kauth.h>
#include <net/if.h>
@@ -1096,21 +1097,21 @@ cnw_ioctl(ifp, cmd, data)
break;
case SIOCSCNWDOMAIN:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag);
if (error)
break;
error = cnw_setdomain(sc, ifr->ifr_domain);
break;
case SIOCSCNWKEY:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag);
if (error)
break;
error = cnw_setkey(sc, ifr->ifr_key);
break;
case SIOCGCNWSTATUS:
- error = suser(p->p_ucred, &p->p_acflag);
+ error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag);
if (error)
break;
if ((ifp->if_flags & IFF_RUNNING) == 0)
diff --git a/sys/dev/pcmcia/pcmcia_cis_quirks.c b/sys/dev/pcmcia/pcmcia_cis_quirks.c
index 6a1f28abfb0..8f14273b656 100644
--- a/sys/dev/pcmcia/pcmcia_cis_quirks.c
+++ b/sys/dev/pcmcia/pcmcia_cis_quirks.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pcmcia_cis_quirks.c,v 1.27 2006/04/14 17:42:29 christos Exp $ */
+/* $NetBSD: pcmcia_cis_quirks.c,v 1.28 2006/05/14 21:45:00 elad Exp $ */
/*
* Copyright (c) 1998 Marc Horowitz. All rights reserved.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pcmcia_cis_quirks.c,v 1.27 2006/04/14 17:42:29 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcmcia_cis_quirks.c,v 1.28 2006/05/14 21:45:00 elad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
diff --git a/sys/dev/qbus/dhu.c b/sys/dev/qbus/dhu.c
index 75edd285324..6280f225e9f 100644
--- a/sys/dev/qbus/dhu.c
+++ b/sys/dev/qbus/dhu.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dhu.c,v 1.42 2006/03/29 18:17:36 thorpej Exp $ */
+/* $NetBSD: dhu.c,v 1.43 2006/05/14 21:45:00 elad Exp $ */
/*
* Copyright (c) 2003, Hugh Graham.
* Copyright (c) 1992, 1993
@@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dhu.c,v 1.42 2006/03/29 18:17:36 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dhu.c,v 1.43 2006/05/14 21:45:00 elad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -467,7 +467,7 @@ dhuopen(dev, flag, mode, l)
(void) dhuparam(tp, &tp->t_termios);
ttsetwater(tp);
} else if ((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);
/* Use DMBIS and *not* DMSET or else we clobber incoming bits */
if (dhumctl(sc, line, DML_DTR|DML_RTS, DMBIS) & DML_DCD)
diff --git a/sys/dev/qbus/dl.c b/sys/dev/qbus/dl.c
index 65460844873..7abe5cb3ac6 100644
--- a/sys/dev/qbus/dl.c
+++ b/sys/dev/qbus/dl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dl.c,v 1.32 2006/03/29 18:17:36 thorpej Exp $ */
+/* $NetBSD: dl.c,v 1.33 2006/05/14 21:45:00 elad Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -111,7 +111,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dl.c,v 1.32 2006/03/29 18:17:36 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dl.c,v 1.33 2006/05/14 21:45:00 elad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -356,7 +356,7 @@ dlopen(dev_t dev, int flag, int mode, struct lwp *l)
ttsetwater(tp);
} else if ((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;
return ((*tp->t_linesw->l_open)(dev, tp));
diff --git a/sys/dev/qbus/dz_uba.c b/sys/dev/qbus/dz_uba.c
index e45f005a987..39cc892a9be 100644
--- a/sys/dev/qbus/dz_uba.c
+++ b/sys/dev/qbus/dz_uba.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dz_uba.c,v 1.24 2006/03/29 18:17:36 thorpej Exp $ */
+/* $NetBSD: dz_uba.c,v 1.25 2006/05/14 21:45:00 elad Exp $ */
/*
* Copyright (c) 1998 Ludd, University of Lule}, Sweden. All rights reserved.
* Copyright (c) 1996 Ken C. Wellsch. All rights reserved.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dz_uba.c,v 1.24 2006/03/29 18:17:36 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dz_uba.c,v 1.25 2006/05/14 21:45:00 elad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
diff --git a/sys/dev/qbus/ts.c b/sys/dev/qbus/ts.c
index 7e4e800c232..a7c0d167d9c 100644
--- a/sys/dev/qbus/ts.c
+++ b/sys/dev/qbus/ts.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ts.c,v 1.17 2006/03/29 18:17:36 thorpej Exp $ */
+/* $NetBSD: ts.c,v 1.18 2006/05/14 21:45:00 elad Exp $ */
/*-
* Copyright (c) 1991 The Regents of the University of California.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ts.c,v 1.17 2006/03/29 18:17:36 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ts.c,v 1.18 2006/05/14 21:45:00 elad Exp $");
#undef TSDEBUG
diff --git a/sys/dev/raidframe/rf_copyback.c b/sys/dev/raidframe/rf_copyback.c
index cd0180ee907..018c423c771 100644
--- a/sys/dev/raidframe/rf_copyback.c
+++ b/sys/dev/raidframe/rf_copyback.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_copyback.c,v 1.32 2005/12/11 12:23:37 christos Exp $ */
+/* $NetBSD: rf_copyback.c,v 1.33 2006/05/14 21:45:00 elad Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -38,7 +38,7 @@
****************************************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_copyback.c,v 1.32 2005/12/11 12:23:37 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_copyback.c,v 1.33 2006/05/14 21:45:00 elad Exp $");
#include <dev/raidframe/raidframevar.h>
@@ -155,11 +155,11 @@ rf_CopybackReconstructedData(RF_Raid_t *raidPtr)
* getting a vp for it? */
if ((retcode = VOP_GETATTR(vp, &va,
- l->l_proc->p_ucred, l)) != 0) {
+ l->l_proc->p_cred, l)) != 0) {
return;
}
retcode = VOP_IOCTL(vp, DIOCGPART, &dpart,
- FREAD, l->l_proc->p_ucred, l);
+ FREAD, l->l_proc->p_cred, l);
if (retcode) {
return;
}
diff --git a/sys/dev/raidframe/rf_dagdegwr.h b/sys/dev/raidframe/rf_dagdegwr.h
index 6dc432ab597..5df19e4ab5b 100644
--- a/sys/dev/raidframe/rf_dagdegwr.h
+++ b/sys/dev/raidframe/rf_dagdegwr.h
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_dagdegwr.h,v 1.5 2006/04/26 17:08:48 oster Exp $ */
+/* $NetBSD: rf_dagdegwr.h,v 1.6 2006/05/14 21:45:00 elad Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
diff --git a/sys/dev/raidframe/rf_disks.c b/sys/dev/raidframe/rf_disks.c
index 0332a98301f..876bcd14830 100644
--- a/sys/dev/raidframe/rf_disks.c
+++ b/sys/dev/raidframe/rf_disks.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_disks.c,v 1.59 2005/12/11 12:23:37 christos Exp $ */
+/* $NetBSD: rf_disks.c,v 1.60 2006/05/14 21:45:00 elad Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -67,7 +67,7 @@
***************************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_disks.c,v 1.59 2005/12/11 12:23:37 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_disks.c,v 1.60 2006/05/14 21:45:00 elad Exp $");
#include <dev/raidframe/raidframevar.h>
@@ -85,6 +85,7 @@ __KERNEL_RCSID(0, "$NetBSD: rf_disks.c,v 1.59 2005/12/11 12:23:37 christos Exp $
#include <sys/ioctl.h>
#include <sys/fcntl.h>
#include <sys/vnode.h>
+#include <sys/kauth.h>
static int rf_AllocDiskStructures(RF_Raid_t *, RF_Config_t *);
static void rf_print_label_status( RF_Raid_t *, int, char *,
@@ -615,11 +616,11 @@ rf_ConfigureDisk(RF_Raid_t *raidPtr, char *bf, RF_RaidDisk_t *diskPtr,
if (diskPtr->status == rf_ds_optimal) {
if ((error = VOP_GETATTR(vp, &va,
- l->l_proc->p_ucred, l)) != 0) {
+ l->l_proc->p_cred, l)) != 0) {
return (error);
}
error = VOP_IOCTL(vp, DIOCGPART, &dpart,
- FREAD, l->l_proc->p_ucred, l);
+ FREAD, l->l_proc->p_cred, l);
if (error) {
return (error);
}
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c
index 154616dd2f9..1d621440c5f 100644
--- a/sys/dev/raidframe/rf_netbsdkintf.c
+++ b/sys/dev/raidframe/rf_netbsdkintf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_netbsdkintf.c,v 1.207 2006/04/12 23:33:39 simonb Exp $ */
+/* $NetBSD: rf_netbsdkintf.c,v 1.208 2006/05/14 21:45:00 elad Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -146,7 +146,7 @@
***********************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.207 2006/04/12 23:33:39 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.208 2006/05/14 21:45:00 elad Exp $");
#include <sys/param.h>
#include <sys/errno.h>
@@ -168,6 +168,7 @@ __KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.207 2006/04/12 23:33:39 simonb
#include <sys/bufq.h>
#include <sys/user.h>
#include <sys/reboot.h>
+#include <sys/kauth.h>
#include <dev/raidframe/raidframevar.h>
#include <dev/raidframe/raidframeio.h>
@@ -2114,18 +2115,18 @@ raidlookup(char *path, struct lwp *l, struct vnode **vpp)
vp = nd.ni_vp;
if (vp->v_usecount > 1) {
VOP_UNLOCK(vp, 0);
- (void) vn_close(vp, FREAD | FWRITE, p->p_ucred, l);
+ (void) vn_close(vp, FREAD | FWRITE, p->p_cred, l);
return (EBUSY);
}
- if ((error = VOP_GETATTR(vp, &va, p->p_ucred, l)) != 0) {
+ if ((error = VOP_GETATTR(vp, &va, p->p_cred, l)) != 0) {
VOP_UNLOCK(vp, 0);
- (void) vn_close(vp, FREAD | FWRITE, p->p_ucred, l);
+ (void) vn_close(vp, FREAD | FWRITE, p->p_cred, l);
return (error);
}
/* XXX: eventually we should handle VREG, too. */
if (va.va_type != VBLK) {
VOP_UNLOCK(vp, 0);
- (void) vn_close(vp, FREAD | FWRITE, p->p_ucred, l);
+ (void) vn_close(vp, FREAD | FWRITE, p->p_cred, l);
return (ENOTBLK);
}
VOP_UNLOCK(vp, 0);
@@ -2455,7 +2456,7 @@ rf_close_component(RF_Raid_t *raidPtr, struct vnode *vp, int auto_configured)
vput(vp);
} else {
- (void) vn_close(vp, FREAD | FWRITE, p->p_ucred, l);
+ (void) vn_close(vp, FREAD | FWRITE, p->p_cred, l);
}
}
}
diff --git a/sys/dev/raidframe/rf_reconstruct.c b/sys/dev/raidframe/rf_reconstruct.c
index bf47a1c9d49..0d935dc7da9 100644
--- a/sys/dev/raidframe/rf_reconstruct.c
+++ b/sys/dev/raidframe/rf_reconstruct.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_reconstruct.c,v 1.90 2005/12/11 12:23:37 christos Exp $ */
+/* $NetBSD: rf_reconstruct.c,v 1.91 2006/05/14 21:45:00 elad Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -33,7 +33,7 @@
************************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.90 2005/12/11 12:23:37 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.91 2006/05/14 21:45:00 elad Exp $");
#include <sys/time.h>
#include <sys/buf.h>
@@ -456,7 +456,7 @@ rf_ReconstructInPlace(RF_Raid_t *raidPtr, RF_RowCol_t col)
/* Ok, so we can at least do a lookup...
How about actually getting a vp for it? */
- if ((retcode = VOP_GETATTR(vp, &va, lwp->l_proc->p_ucred, lwp)) != 0) {
+ if ((retcode = VOP_GETATTR(vp, &va, lwp->l_proc->p_cred, lwp)) != 0) {
RF_LOCK_MUTEX(raidPtr->mutex);
raidPtr->reconInProgress--;
RF_UNLOCK_MUTEX(raidPtr->mutex);
@@ -464,7 +464,7 @@ rf_ReconstructInPlace(RF_Raid_t *raidPtr, RF_RowCol_t col)
return(retcode);
}
- retcode = VOP_IOCTL(vp, DIOCGPART, &dpart, FREAD, lwp->l_proc->p_ucred, lwp);
+ retcode = VOP_IOCTL(vp, DIOCGPART, &dpart, FREAD, lwp->l_proc->p_cred, lwp);
if (retcode) {
RF_LOCK_MUTEX(raidPtr->mutex);
raidPtr->reconInProgress--;
diff --git a/sys/dev/rnd.c b/sys/dev/rnd.c
index c2e13200fd0..ee77cd58437 100644
--- a/sys/dev/rnd.c
+++ b/sys/dev/rnd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rnd.c,v 1.50 2006/02/17 19:22:30 rpaulo Exp $ */
+/* $NetBSD: rnd.c,v 1.51 2006/05/14 21:42:26 elad Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rnd.c,v 1.50 2006/02/17 19:22:30 rpaulo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rnd.c,v 1.51 2006/05/14 21:42:26 elad Exp $");
#include <sys/param.h>
#include <sys/ioctl.h>
@@ -54,6 +54,7 @@ __KERNEL_RCSID(0, "$NetBSD: rnd.c,v 1.50 2006/02/17 19:22:30 rpaulo Exp $");
#include <sys/rnd.h>
#include <sys/vnode.h>
#include <sys/pool.h>
+#include <sys/kauth.h>
#ifdef __HAVE_CPU_COUNTER
#include <machine/cpu_counter.h>
@@ -511,7 +512,7 @@ rndioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct lwp *l)
break;
case RNDGETPOOLSTAT:
- if ((ret = suser(p->p_ucred, &p->p_acflag)) != 0)
+ if ((ret = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag)) != 0)
return (ret);
s = splsoftclock();
@@ -520,7 +521,7 @@ rndioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct lwp *l)
break;
case RNDGETSRCNUM:
- if ((ret = suser(p->p_ucred, &p->p_acflag)) != 0)
+ if ((ret = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag)) != 0)
return (ret);
rst = (rndstat_t *)addr;
@@ -563,7 +564,7 @@ rndioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct lwp *l)
break;
case RNDGETSRCNAME:
- if ((ret = suser(p->p_ucred, &p->p_acflag)) != 0)
+ if ((ret = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag)) != 0)
return (ret);
/*
@@ -586,7 +587,7 @@ rndioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct lwp *l)
break;
case RNDCTL:
- if ((ret = suser(p->p_ucred, &p->p_acflag)) != 0)
+ if ((ret = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag)) != 0)
return (ret);
/*
@@ -630,7 +631,7 @@ rndioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct lwp *l)
break;
case RNDADDDATA:
- if ((ret = suser(p->p_ucred, &p->p_acflag)) != 0)
+ if ((ret = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag)) != 0)
return (ret);
rnddata = (rnddata_t *)addr;
diff --git a/sys/dev/sbus/magma.c b/sys/dev/sbus/magma.c
index de6347a602c..501c51db9e8 100644
--- a/sys/dev/sbus/magma.c
+++ b/sys/dev/sbus/magma.c
@@ -1,4 +1,4 @@
-/* $NetBSD: magma.c,v 1.32 2005/12/24 20:27:52 perry Exp $ */
+/* $NetBSD: magma.c,v 1.33 2006/05/14 21:47:00 elad Exp $ */
/*
* magma.c
*
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: magma.c,v 1.32 2005/12/24 20:27:52 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: magma.c,v 1.33 2006/05/14 21:47:00 elad Exp $");
#if 0
#define MAGMA_DEBUG
@@ -926,7 +926,7 @@ mttyopen(dev, flags, 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);
s = spltty();
@@ -1164,7 +1164,7 @@ mttyioctl(dev, cmd, data, flags, l)
break;
case TIOCSFLAGS:
- if( suser(l->l_proc->p_ucred, &l->l_proc->p_acflag) )
+ if (kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) )
error = EPERM;
else
mp->mp_openflags = *((int *)data) &
diff --git a/sys/dev/sbus/spif.c b/sys/dev/sbus/spif.c
index e8d3509c68c..b776ae80dcb 100644
--- a/sys/dev/sbus/spif.c
+++ b/sys/dev/sbus/spif.c
@@ -1,4 +1,4 @@
-/* $NetBSD: spif.c,v 1.4 2005/12/11 12:23:44 christos Exp $ */
+/* $NetBSD: spif.c,v 1.5 2006/05/14 21:47:00 elad Exp $ */
/* $OpenBSD: spif.c,v 1.12 2003/10/03 16:44:51 miod Exp $ */
/*
@@ -41,7 +41,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spif.c,v 1.4 2005/12/11 12:23:44 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spif.c,v 1.5 2006/05/14 21:47:00 elad Exp $");
#include "spif.h"
#if NSPIF > 0
@@ -385,7 +385,7 @@ stty_open(dev, flags, mode, l)
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();
@@ -497,7 +497,7 @@ stty_ioctl(dev, cmd, data, flags, l)
*((int *)data) = sp->sp_openflags;
break;
case TIOCSFLAGS:
- if( suser(l->l_proc->p_ucred, &l->l_proc->p_acflag) )
+ if (kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag) )
error = EPERM;
else
sp->sp_openflags = *((int *)data) &
diff --git a/sys/dev/tc/asc_tcds.c b/sys/dev/tc/asc_tcds.c
index 8f668f5a05d..1dafd6dcdfe 100644
--- a/sys/dev/tc/asc_tcds.c
+++ b/sys/dev/tc/asc_tcds.c
@@ -1,4 +1,4 @@
-/* $NetBSD: asc_tcds.c,v 1.16 2006/03/31 17:39:33 thorpej Exp $ */
+/* $NetBSD: asc_tcds.c,v 1.17 2006/05/14 21:47:00 elad Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: asc_tcds.c,v 1.16 2006/03/31 17:39:33 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: asc_tcds.c,v 1.17 2006/05/14 21:47:00 elad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
diff --git a/sys/dev/tc/pxg.c b/sys/dev/tc/pxg.c
index 64ed24a0c1b..44e0bd7b764 100644
--- a/sys/dev/tc/pxg.c
+++ b/sys/dev/tc/pxg.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pxg.c,v 1.21 2006/03/31 17:39:33 thorpej Exp $ */
+/* $NetBSD: pxg.c,v 1.22 2006/05/14 21:47:00 elad Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pxg.c,v 1.21 2006/03/31 17:39:33 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxg.c,v 1.22 2006/05/14 21:47:00 elad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -367,7 +367,7 @@ pxg_ioctl(struct stic_info *si, u_long cmd, caddr_t data, int flag,
switch (cmd) {
case STICIO_START860:
case STICIO_RESET860:
- if ((rv = suser(p->p_ucred, &p->p_acflag)) != 0)
+ if ((rv = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag)) != 0)
return (rv);
if (si->si_dispmode != WSDISPLAYIO_MODE_MAPPED)
return (EBUSY);
diff --git a/sys/dev/tc/stic.c b/sys/dev/tc/stic.c
index 0488b2af7af..ad1fa4da55c 100644
--- a/sys/dev/tc/stic.c
+++ b/sys/dev/tc/stic.c
@@ -1,4 +1,4 @@
-/* $NetBSD: stic.c,v 1.32 2006/04/12 19:38:24 jmmv Exp $ */
+/* $NetBSD: stic.c,v 1.33 2006/05/14 21:47:00 elad Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: stic.c,v 1.32 2006/04/12 19:38:24 jmmv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: stic.c,v 1.33 2006/05/14 21:47:00 elad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
diff --git a/sys/dev/usb/Makefile b/sys/dev/usb/Makefile
index 04c267200d7..673302874bc 100644
--- a/sys/dev/usb/Makefile
+++ b/sys/dev/usb/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2006/04/03 08:15:48 scw Exp $
+# $NetBSD: Makefile,v 1.9 2006/05/14 21:47:00 elad Exp $
# use 'make -f Makefile.usbdevs' to make usbdevs.h and usbdevs_data.h
# _after_ you committed usbdevs. See comment in Makefile.usbdevs
diff --git a/sys/dev/usb/ubtbcmfw.c b/sys/dev/usb/ubtbcmfw.c
index f6abe08fda3..fbfeab1db6d 100644
--- a/sys/dev/usb/ubtbcmfw.c
+++ b/sys/dev/usb/ubtbcmfw.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ubtbcmfw.c,v 1.11 2005/12/11 12:24:01 christos Exp $ */
+/* $NetBSD: ubtbcmfw.c,v 1.12 2006/05/14 21:47:00 elad Exp $ */
/*
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ubtbcmfw.c,v 1.11 2005/12/11 12:24:01 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ubtbcmfw.c,v 1.12 2006/05/14 21:47:00 elad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -247,7 +247,7 @@ ubtbcmfw_load_file(usbd_device_handle dev, usbd_pipe_handle out,
for (offs = 0; ; offs += size) {
size = sizeof buf;
error = vn_rdwr(UIO_READ, vp, buf, size, offs, UIO_SYSSPACE,
- IO_NODELOCKED | IO_SYNC, p->p_ucred, &resid, NULL);
+ IO_NODELOCKED | IO_SYNC, p->p_cred, &resid, NULL);
size -= resid;
if (error || size == 0)
break;
@@ -258,7 +258,7 @@ ubtbcmfw_load_file(usbd_device_handle dev, usbd_pipe_handle out,
}
out:
- vn_close(vp, FREAD, p->p_ucred, p);
+ vn_close(vp, FREAD, p->p_cred, p);
return error;
}
diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c
index a608e85865e..1cc8c15d81f 100644
--- a/sys/dev/usb/ucom.c
+++ b/sys/dev/usb/ucom.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ucom.c,v 1.62 2006/03/28 17:38:35 thorpej Exp $ */
+/* $NetBSD: ucom.c,v 1.63 2006/05/14 21:47:00 elad Exp $ */
/*
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.62 2006/03/28 17:38:35 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.63 2006/05/14 21:47:00 elad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -55,6 +55,7 @@ __KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.62 2006/03/28 17:38:35 thorpej Exp $");
#include <sys/vnode.h>
#include <sys/device.h>
#include <sys/poll.h>
+#include <sys/kauth.h>
#if defined(__NetBSD__)
#include "rnd.h"
#if NRND > 0
@@ -328,7 +329,7 @@ ucomopen(dev_t dev, int flag, int mode, struct lwp *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();
@@ -657,7 +658,7 @@ ucom_do_ioctl(struct ucom_softc *sc, u_long cmd, caddr_t data,
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/usb/ucycom.c b/sys/dev/usb/ucycom.c
index 002ede97795..eac755df453 100644
--- a/sys/dev/usb/ucycom.c
+++ b/sys/dev/usb/ucycom.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ucycom.c,v 1.9 2006/03/28 17:38:35 thorpej Exp $ */
+/* $NetBSD: ucycom.c,v 1.10 2006/05/14 21:47:00 elad Exp $ */
/*
* Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: ucycom.c,v 1.9 2006/03/28 17:38:35 thorpej Exp $");
+__RCSID("$NetBSD: ucycom.c,v 1.10 2006/05/14 21:47:00 elad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -57,6 +57,7 @@ __RCSID("$NetBSD: ucycom.c,v 1.9 2006/03/28 17:38:35 thorpej Exp $");
#include <sys/tty.h>
#include <sys/file.h>
#include <sys/vnode.h>
+#include <sys/kauth.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbhid.h>
@@ -333,7 +334,7 @@ ucycomopen(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();
@@ -769,7 +770,7 @@ ucycomioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
break;
case TIOCSFLAGS:
- err = suser(l->l_proc->p_ucred, &l->l_proc->p_acflag);
+ err = kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER, &l->l_proc->p_acflag);
if (err)
break;
sc->sc_swflags = *(int *)data;
diff --git a/sys/dev/usb/ugensa.c b/sys/dev/usb/ugensa.c
index 3e3c16d8a5e..4400dad7b95 100644
--- a/sys/dev/usb/ugensa.c
+++ b/sys/dev/usb/ugensa.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ugensa.c,v 1.5 2006/03/25 14:15:45 gdt Exp $ */
+/* $NetBSD: ugensa.c,v 1.6 2006/05/14 21:47:00 elad Exp $ */
/*
* Copyright (c) 2004, 2005 The NetBSD Foundation, Inc.
diff --git a/sys/dev/usb/ulpt.c b/sys/dev/usb/ulpt.c
index 32b591f2adc..e5794f0507d 100644
--- a/sys/dev/usb/ulpt.c
+++ b/sys/dev/usb/ulpt.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ulpt.c,v 1.72 2006/03/28 17:38:35 thorpej Exp $ */
+/* $NetBSD: ulpt.c,v 1.73 2006/05/14 21:47:00 elad Exp $ */
/* $FreeBSD: src/sys/dev/usb/ulpt.c,v 1.24 1999/11/17 22:33:44 n_hibma Exp $ */
/*
@@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ulpt.c,v 1.72 2006/03/28 17:38:35 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ulpt.c,v 1.73 2006/05/14 21:47:00 elad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs
index e60aeced19e..90051862b9a 100644
--- a/sys/dev/usb/usbdevs
+++ b/sys/dev/usb/usbdevs
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.427 2006/04/03 07:14:03 scw Exp $
+$NetBSD: usbdevs,v 1.428 2006/05/14 21:47:00 elad Exp $
/*
* Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
diff --git a/sys/dev/verified_exec.c b/sys/dev/verified_exec.c
index d69de7b2c59..47b7a544f1b 100644
--- a/sys/dev/verified_exec.c
+++ b/sys/dev/verified_exec.c
@@ -1,4 +1,4 @@
-/* $NetBSD: verified_exec.c,v 1.32 2006/05/06 13:25:36 elad Exp $ */
+/* $NetBSD: verified_exec.c,v 1.33 2006/05/14 21:42:26 elad Exp $ */
/*-
* Copyright 2005 Elad Efrat <elad@bsd.org.il>
@@ -31,9 +31,9 @@
#include <sys/cdefs.h>
#if defined(__NetBSD__)
-__KERNEL_RCSID(0, "$NetBSD: verified_exec.c,v 1.32 2006/05/06 13:25:36 elad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: verified_exec.c,v 1.33 2006/05/14 21:42:26 elad Exp $");
#else
-__RCSID("$Id: verified_exec.c,v 1.32 2006/05/06 13:25:36 elad Exp $\n$NetBSD: verified_exec.c,v 1.32 2006/05/06 13:25:36 elad Exp $");
+__RCSID("$Id: verified_exec.c,v 1.33 2006/05/14 21:42:26 elad Exp $\n$NetBSD: verified_exec.c,v 1.33 2006/05/14 21:42:26 elad Exp $");
#endif
#include <sys/param.h>
@@ -126,10 +126,12 @@ veriexecopen(dev_t dev __unused, int flags __unused,
if (veriexec_verbose >= 2) {
printf("Veriexec: veriexecopen: Veriexec load device "
"open attempt by uid=%u, pid=%u. (dev=%u)\n",
- l->l_proc->p_ucred->cr_uid, l->l_proc->p_pid, dev);
+ kauth_cred_geteuid(l->l_proc->p_cred),
+ l->l_proc->p_pid, dev);
}
- if (suser(l->l_proc->p_ucred, &l->l_proc->p_acflag) != 0)
+ if (kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER,
+ &l->l_proc->p_acflag) != 0)
return (EPERM);
if (veriexec_dev_usage > 0) {
@@ -260,7 +262,7 @@ veriexec_load(struct veriexec_params *params, struct lwp *l)
}
/* Get attributes for device and inode. */
- error = VOP_GETATTR(nid.ni_vp, &va, l->l_proc->p_ucred, l);
+ error = VOP_GETATTR(nid.ni_vp, &va, l->l_proc->p_cred, l);
if (error) {
vrele(nid.ni_vp);
return (error);
diff --git a/sys/dev/vme/xd.c b/sys/dev/vme/xd.c
index c4ad9df8689..a61a54320a0 100644
--- a/sys/dev/vme/xd.c
+++ b/sys/dev/vme/xd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: xd.c,v 1.60 2006/03/28 17:38:38 thorpej Exp $ */
+/* $NetBSD: xd.c,v 1.61 2006/05/14 21:47:00 elad Exp $ */
/*
*
@@ -51,7 +51,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.60 2006/03/28 17:38:38 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.61 2006/05/14 21:47:00 elad Exp $");
#undef XDC_DEBUG /* full debug */
#define XDC_DIAG /* extra sanity checks */
@@ -1120,7 +1120,8 @@ xdioctl(dev, command, addr, flag, l)
case DIOSXDCMD:
xio = (struct xd_iocmd *) addr;
- if ((error = suser(l->l_proc->p_ucred, &l->l_proc->p_acflag)) != 0)
+ if ((error = kauth_authorize_generic(l->l_proc->p_cred, KAUTH_GENERIC_ISSUSER,
+ &l->l_proc->p_acflag)) != 0)
return (error);
return (xdc_ioctlcmd(xd, dev, xio));
diff --git a/sys/dev/vme/xy.c b/sys/dev/vme/xy.c
index d6475652757..f400a07b154 100644
--- a/sys/dev/vme/xy.c
+++ b/sys/dev/vme/xy.c
@@ -1,4 +1,4 @@
-/* $NetBSD: xy.c,v 1.63 2006/05/10 06:24:03 skrll Exp $ */
+/* $NetBSD: xy.c,v 1.64 2006/05/14 21:47:00 elad Exp $ */
/*
*
@@ -51,7 +51,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xy.c,v 1.63 2006/05/10 06:24:03 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xy.c,v 1.64 2006/05/14 21:47:00 elad Exp $");
#undef XYC_DEBUG /* full debug */
#undef XYC_DIAG /* extra sanity checks */
@@ -1032,7 +1032,9 @@ xyioctl(dev, command, addr, flag, l)
case DIOSXDCMD:
xio = (struct xd_iocmd *) addr;
- if ((error = suser(l->l_proc->p_ucred, &l->l_proc->p_acflag)) != 0)
+ if ((error = kauth_authorize_generic(l->l_proc->p_cred,
+ KAUTH_GENERIC_ISSUSER,
+ &l->l_proc->p_acflag)) != 0)
return (error);
return (xyc_ioctlcmd(xy, dev, xio));
diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c
index 37d0e9eaadc..23eb8b2f128 100644
--- a/sys/dev/vnd.c
+++ b/sys/dev/vnd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: vnd.c,v 1.146 2006/03/30 15:19:45 cube Exp $ */
+/* $NetBSD: vnd.c,v 1.147 2006/05/14 21:42:26 elad Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -133,7 +133,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.146 2006/03/30 15:19:45 cube Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.147 2006/05/14 21:42:26 elad Exp $");
#if defined(_KERNEL_OPT)
#include "fs_nfs.h"
@@ -159,6 +159,8 @@ __KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.146 2006/03/30 15:19:45 cube Exp $");
#include <sys/file.h>
#include <sys/uio.h>
#include <sys/conf.h>
+#include <sys/kauth.h>
+
#include <net/zlib.h>
#include <miscfs/specfs/specdev.h>
@@ -196,7 +198,7 @@ struct vndxfer {
void vndattach(int);
static void vndclear(struct vnd_softc *, int);
-static int vndsetcred(struct vnd_softc *, struct ucred *);
+static int vndsetcred(struct vnd_softc *, kauth_cred_t);
static void vndthrottle(struct vnd_softc *, struct vnode *);
static void vndiodone(struct buf *);
#if 0
@@ -782,7 +784,7 @@ vnd_cget(struct lwp *l, int unit, int *un, struct vattr *va)
if ((vnd->sc_flags & VNF_INITED) == 0)
return -1;
- return VOP_GETATTR(vnd->sc_vp, va, l->l_proc->p_ucred, l);
+ return VOP_GETATTR(vnd->sc_vp, va, l->l_proc->p_cred, l);
}
/* ARGSUSED */
@@ -867,7 +869,7 @@ vndioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
if ((error = vn_open(&nd, fflags, 0)) != 0)
goto unlock_and_exit;
KASSERT(l);
- error = VOP_GETATTR(nd.ni_vp, &vattr, l->l_proc->p_ucred, l);
+ error = VOP_GETATTR(nd.ni_vp, &vattr, l->l_proc->p_cred, l);
if (!error && nd.ni_vp->v_type != VREG)
error = EOPNOTSUPP;
if (error) {
@@ -891,7 +893,7 @@ vndioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
/* read compressed file header */
error = vn_rdwr(UIO_READ, nd.ni_vp, (caddr_t)ch,
sizeof(struct vnd_comp_header), 0, UIO_SYSSPACE,
- IO_UNIT|IO_NODELOCKED, p->p_ucred, NULL, NULL);
+ IO_UNIT|IO_NODELOCKED, p->p_cred, NULL, NULL);
if(error) {
free(ch, M_TEMP);
VOP_UNLOCK(nd.ni_vp, 0);
@@ -930,7 +932,7 @@ vndioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
(caddr_t)vnd->sc_comp_offsets,
sizeof(u_int64_t) * vnd->sc_comp_numoffs,
sizeof(struct vnd_comp_header), UIO_SYSSPACE,
- IO_UNIT|IO_NODELOCKED, p->p_ucred, NULL, NULL);
+ IO_UNIT|IO_NODELOCKED, p->p_cred, NULL, NULL);
if(error) {
VOP_UNLOCK(nd.ni_vp, 0);
goto close_and_exit;
@@ -1046,7 +1048,7 @@ vndioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
vnd->sc_flags |= VNF_READONLY;
}
- if ((error = vndsetcred(vnd, p->p_ucred)) != 0)
+ if ((error = vndsetcred(vnd, p->p_cred)) != 0)
goto close_and_exit;
vndthrottle(vnd, vnd->sc_vp);
@@ -1087,7 +1089,7 @@ vndioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct lwp *l)
break;
close_and_exit:
- (void) vn_close(nd.ni_vp, fflags, p->p_ucred, l);
+ (void) vn_close(nd.ni_vp, fflags, p->p_cred, l);
unlock_and_exit:
#ifdef VND_COMPRESSION
/* free any allocated memory (for compressed file) */
@@ -1292,14 +1294,14 @@ unlock_and_exit:
* if some other uid can write directly to the mapped file (NFS).
*/
static int
-vndsetcred(struct vnd_softc *vnd, struct ucred *cred)
+vndsetcred(struct vnd_softc *vnd, kauth_cred_t cred)
{
struct uio auio;
struct iovec aiov;
char *tmpbuf;
int error;
- vnd->sc_cred = crdup(cred);
+ vnd->sc_cred = kauth_cred_dup(cred);
tmpbuf = malloc(DEV_BSIZE, M_TEMP, M_WAITOK);
/* XXX: Horrible kludge to establish credentials for NFS */
@@ -1421,9 +1423,9 @@ vndclear(struct vnd_softc *vnd, int myminor)
if (vp == (struct vnode *)0)
panic("vndclear: null vp");
(void) vn_close(vp, fflags, vnd->sc_cred, l);
- crfree(vnd->sc_cred);
+ kauth_cred_free(vnd->sc_cred);
vnd->sc_vp = (struct vnode *)0;
- vnd->sc_cred = (struct ucred *)0;
+ vnd->sc_cred = (kauth_cred_t)0;
vnd->sc_size = 0;
}
diff --git a/sys/dev/vndvar.h b/sys/dev/vndvar.h
index ab07fb00a60..a61c3041cf3 100644
--- a/sys/dev/vndvar.h
+++ b/sys/dev/vndvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: vndvar.h,v 1.19 2006/02/01 03:15:33 cube Exp $ */
+/* $NetBSD: vndvar.h,v 1.20 2006/05/14 21:42:26 elad Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -143,7 +143,6 @@ struct vnd_ioctl {
#ifdef _KERNEL
struct vnode;
-struct ucred;
/*
* A vnode disk's state information.
@@ -153,7 +152,7 @@ struct vnd_softc {
int sc_flags; /* flags */
size_t sc_size; /* size of vnd */
struct vnode *sc_vp; /* vnode */
- struct ucred *sc_cred; /* credentials */
+ kauth_cred_t sc_cred; /* credentials */
int sc_maxactive; /* max # of active requests */
struct bufq_state *sc_tab; /* transfer queue */
int sc_active; /* number of active transfers */
diff --git a/sys/dev/wscons/wsdisplay.c b/sys/dev/wscons/wsdisplay.c
index bda8c11b3d8..bbb22670608 100644
--- a/sys/dev/wscons/wsdisplay.c
+++ b/sys/dev/wscons/wsdisplay.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wsdisplay.c,v 1.97 2006/04/15 17:48:24 jmmv Exp $ */
+/* $NetBSD: wsdisplay.c,v 1.98 2006/05/14 21:47:00 elad Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.97 2006/04/15 17:48:24 jmmv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.98 2006/05/14 21:47:00 elad Exp $");
#include "opt_wsdisplay_compat.h"
#include "opt_wsmsgattrs.h"
@@ -55,6 +55,7 @@ __KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.97 2006/04/15 17:48:24 jmmv Exp $");
#include <sys/errno.h>
#include <sys/fcntl.h>
#include <sys/vnode.h>
+#include <sys/kauth.h>
#include <dev/wscons/wseventvar.h>
#include <dev/wscons/wsmuxvar.h>
@@ -756,7 +757,8 @@ wsdisplayopen(dev_t dev, int flag, int mode, struct lwp *l)
wsdisplayparam(tp, &tp->t_termios);
ttsetwater(tp);
} else if ((tp->t_state & TS_XCLUDE) != 0 &&
- 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;
tp->t_state |= TS_CARR_ON;
diff --git a/sys/dev/wscons/wsdisplay_compat_usl.c b/sys/dev/wscons/wsdisplay_compat_usl.c
index 4b37dd11911..170f14c7ad4 100644
--- a/sys/dev/wscons/wsdisplay_compat_usl.c
+++ b/sys/dev/wscons/wsdisplay_compat_usl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wsdisplay_compat_usl.c,v 1.31 2006/03/18 13:06:38 jmcneill Exp $ */
+/* $NetBSD: wsdisplay_compat_usl.c,v 1.32 2006/05/14 21:47:00 elad Exp $ */
/*
* Copyright (c) 1998
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsdisplay_compat_usl.c,v 1.31 2006/03/18 13:06:38 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsdisplay_compat_usl.c,v 1.32 2006/05/14 21:47:00 elad Exp $");
#include "opt_compat_freebsd.h"
#include "opt_compat_netbsd.h"
@@ -41,6 +41,7 @@ __KERNEL_RCSID(0, "$NetBSD: wsdisplay_compat_usl.c,v 1.31 2006/03/18 13:06:38 jm
#include <sys/signalvar.h>
#include <sys/malloc.h>
#include <sys/errno.h>
+#include <sys/kauth.h>
#include <dev/wscons/wsconsio.h>
#include <dev/wscons/wsdisplayvar.h>
@@ -404,7 +405,7 @@ wsdisplay_usl_ioctl2(struct wsdisplay_softc *sc, struct wsscreen *scr,
#undef d
case KDENABIO:
- if (suser(p->p_ucred, &p->p_acflag) || securelevel > 1)
+ if (kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag) || securelevel > 1)
return (EPERM);
/* FALLTHRU */
case KDDISABIO:
diff --git a/sys/dev/wscons/wsdisplay_vcons.c b/sys/dev/wscons/wsdisplay_vcons.c
index abd4d232b60..5a55cbfcaa9 100644
--- a/sys/dev/wscons/wsdisplay_vcons.c
+++ b/sys/dev/wscons/wsdisplay_vcons.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wsdisplay_vcons.c,v 1.6 2006/04/15 17:48:24 jmmv Exp $ */
+/* $NetBSD: wsdisplay_vcons.c,v 1.7 2006/05/14 21:47:00 elad Exp $ */
/*-
* Copyright (c) 2005, 2006 Michael Lorenz
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.6 2006/04/15 17:48:24 jmmv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.7 2006/05/14 21:47:00 elad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
diff --git a/sys/dev/wscons/wskbd.c b/sys/dev/wscons/wskbd.c
index 726293c38bf..c6432f802ff 100644
--- a/sys/dev/wscons/wskbd.c
+++ b/sys/dev/wscons/wskbd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wskbd.c,v 1.91 2006/05/14 10:25:16 martin Exp $ */
+/* $NetBSD: wskbd.c,v 1.92 2006/05/14 21:47:00 elad Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@@ -79,7 +79,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wskbd.c,v 1.91 2006/05/14 10:25:16 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wskbd.c,v 1.92 2006/05/14 21:47:00 elad Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -105,6 +105,7 @@ __KERNEL_RCSID(0, "$NetBSD: wskbd.c,v 1.91 2006/05/14 10:25:16 martin Exp $");
#include <sys/errno.h>
#include <sys/fcntl.h>
#include <sys/vnode.h>
+#include <sys/kauth.h>
#include <dev/wscons/wsconsio.h>
#include <dev/wscons/wskbdvar.h>
@@ -1021,7 +1022,8 @@ getbell:
return (0);
case WSKBDIO_SETDEFAULTBELL:
- if (p && (error = suser(p->p_ucred, &p->p_acflag)) != 0)
+ if (p && (error = kauth_authorize_generic(p->p_cred,
+ KAUTH_GENERIC_ISSUSER, &p->p_acflag)) != 0)
return (error);
kbdp = &wskbd_default_bell_data;
goto setbell;
@@ -1059,7 +1061,7 @@ getkeyrepeat:
return (0);
case WSKBDIO_SETDEFAULTKEYREPEAT:
- if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
+ if ((error = kauth_authorize_generic(p->p_cred, KAUTH_GENERIC_ISSUSER, &p->p_acflag)) != 0)
return (error);
kkdp = &wskbd_default_keyrepeat_data;
goto setkeyrepeat;
diff --git a/sys/dev/wscons/wsmouse.c b/sys/dev/wscons/wsmouse.c
index 52c58e794dc..58b435915ac 100644
--- a/sys/dev/wscons/wsmouse.c
+++ b/sys/dev/wscons/wsmouse.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wsmouse.c,v 1.45 2006/03/29 04:16:51 thorpej Exp $ */
+/* $NetBSD: wsmouse.c,v 1.46 2006/05/14 21:47:00 elad Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -111,7 +111,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsmouse.c,v 1.45 2006/03/29 04:16:51 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsmouse.c,v 1.46 2006/05/14 21:47:00 elad Exp $");
#include "wsmouse.h"
#include "wsdisplay.h"