diff options
| author | elad <elad@NetBSD.org> | 2009-05-06 18:41:54 +0000 |
|---|---|---|
| committer | elad <elad@NetBSD.org> | 2009-05-06 18:41:54 +0000 |
| commit | 105d9a093de9b461bbaede09cd60a3bd5eab31fc (patch) | |
| tree | 19d1f403bc14bfef712afed7a7915d6ea4bfd650 /sys/arch/macppc/dev | |
| parent | af1172fad03120c47791b3583453a5689f850924 (diff) | |
Replace curlwp->l_cred with kauth_cred_get().
Mailing list reference:
http://mail-index.netbsd.org/tech-kern/2009/05/05/msg005038.html
Diffstat (limited to 'sys/arch/macppc/dev')
| -rw-r--r-- | sys/arch/macppc/dev/ofb.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/sys/arch/macppc/dev/ofb.c b/sys/arch/macppc/dev/ofb.c index c422dbba7c8..c8ef473a70f 100644 --- a/sys/arch/macppc/dev/ofb.c +++ b/sys/arch/macppc/dev/ofb.c @@ -1,4 +1,4 @@ -/* $NetBSD: ofb.c,v 1.63 2007/11/26 19:58:29 garbled Exp $ */ +/* $NetBSD: ofb.c,v 1.64 2009/05/06 18:41:54 elad Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ofb.c,v 1.63 2007/11/26 19:58:29 garbled Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofb.c,v 1.64 2009/05/06 18:41:54 elad Exp $"); #include <sys/param.h> #include <sys/buf.h> @@ -319,7 +319,6 @@ ofb_mmap(void *v, void *vs, off_t offset, int prot) struct ofb_softc *sc = vd->cookie; struct rasops_info *ri; u_int32_t *ap = sc->sc_addrs; - struct lwp *me; int i; if (vd->active == NULL) { @@ -338,13 +337,10 @@ ofb_mmap(void *v, void *vs, off_t offset, int prot) * restrict all other mappings to processes with superuser privileges * or the kernel itself */ - me = curlwp; - if (me != NULL) { - if (kauth_authorize_generic(me->l_cred, KAUTH_GENERIC_ISSUSER, - NULL) != 0) { - printf("%s: mmap() rejected.\n", sc->sc_dev.dv_xname); - return -1; - } + if (kauth_authorize_generic(kauth_cred_get(), KAUTH_GENERIC_ISSUSER, + NULL) != 0) { + printf("%s: mmap() rejected.\n", sc->sc_dev.dv_xname); + return -1; } /* let them mmap() 0xa0000 - 0xbffff if it's not covered above */ |
