summaryrefslogtreecommitdiff
path: root/sys/dev/usb
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/dev/usb
parentfc9422c9d9d5eec5abd0d58ae5fa47aedf2198e3 (diff)
integrate kauth.
Diffstat (limited to 'sys/dev/usb')
-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
7 files changed, 19 insertions, 17 deletions
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.