diff options
| author | elad <elad@NetBSD.org> | 2009-05-07 18:01:56 +0000 |
|---|---|---|
| committer | elad <elad@NetBSD.org> | 2009-05-07 18:01:56 +0000 |
| commit | b853042065b705e95fb6943c3ed1ae81ce45a2d8 (patch) | |
| tree | 92eddfd27dfbcee93434900609d2e93875a00221 /sys/dev/bluetooth | |
| parent | 0b635e75c028043d46719964954240b8b5732c64 (diff) | |
Introduce actions/requests to handle authorization for ppp(4), sl(4),
strip(4), btuart(4) and bcsp(4) network interfaces and devices.
Mailing list reference:
http://mail-index.netbsd.org/tech-kern/2009/04/27/msg004955.html
Diffstat (limited to 'sys/dev/bluetooth')
| -rw-r--r-- | sys/dev/bluetooth/bcsp.c | 11 | ||||
| -rw-r--r-- | sys/dev/bluetooth/btuart.c | 11 |
2 files changed, 12 insertions, 10 deletions
diff --git a/sys/dev/bluetooth/bcsp.c b/sys/dev/bluetooth/bcsp.c index 12bd1ff3a89..01ce36c8bff 100644 --- a/sys/dev/bluetooth/bcsp.c +++ b/sys/dev/bluetooth/bcsp.c @@ -1,4 +1,4 @@ -/* $NetBSD: bcsp.c,v 1.16 2009/04/26 07:53:43 elad Exp $ */ +/* $NetBSD: bcsp.c,v 1.17 2009/05/07 18:01:57 elad Exp $ */ /* * Copyright (c) 2007 KIYOHARA Takashi * All rights reserved. @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: bcsp.c,v 1.16 2009/04/26 07:53:43 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcsp.c,v 1.17 2009/05/07 18:01:57 elad Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -378,9 +378,10 @@ bcspopen(dev_t device __unused, struct tty *tp) int error, unit, s; static char name[] = "bcsp"; - if ((error = kauth_authorize_generic(l->l_cred, - KAUTH_GENERIC_ISSUSER, NULL)) != 0) - return error; + error = kauth_authorize_device(l->l_cred, KAUTH_DEVICE_BLUETOOTH_BCSP, + KAUTH_ARG(KAUTH_REQ_DEVICE_BLUETOOTH_BCSP_ADD), NULL, NULL, NULL); + if (error) + return (error); s = spltty(); diff --git a/sys/dev/bluetooth/btuart.c b/sys/dev/bluetooth/btuart.c index deacd8298a8..2dc8136681e 100644 --- a/sys/dev/bluetooth/btuart.c +++ b/sys/dev/bluetooth/btuart.c @@ -1,4 +1,4 @@ -/* $NetBSD: btuart.c,v 1.21 2009/04/26 07:53:43 elad Exp $ */ +/* $NetBSD: btuart.c,v 1.22 2009/05/07 18:01:57 elad Exp $ */ /*- * Copyright (c) 2006, 2007 KIYOHARA Takashi @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: btuart.c,v 1.21 2009/04/26 07:53:43 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: btuart.c,v 1.22 2009/05/07 18:01:57 elad Exp $"); #include <sys/param.h> #include <sys/conf.h> @@ -226,9 +226,10 @@ btuartopen(dev_t devno __unused, struct tty *tp) struct lwp *l = curlwp; /* XXX */ int error, unit, s; - if ((error = kauth_authorize_generic(l->l_cred, - KAUTH_GENERIC_ISSUSER, NULL)) != 0) - return error; + error = kauth_authorize_device(l->l_cred, KAUTH_DEVICE_BLUETOOTH_BTUART, + KAUTH_ARG(KAUTH_REQ_DEVICE_BLUETOOTH_BTUART_ADD), NULL, NULL, NULL); + if (error) + return (error); s = spltty(); |
