summaryrefslogtreecommitdiff
path: root/sys/dev/wscons/wsmux.c
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2005-08-14 11:00:16 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2005-08-14 11:00:16 +0000
commit7a5cb464cb9e625c495a794c61a769a8c4e866b5 (patch)
treee4c9053d7737bea4ed7f5c479e4724a5db3d0cb1 /sys/dev/wscons/wsmux.c
parentaa90e1774f220cac512a167a80241a994474f8e9 (diff)
Honor (the lack of) FWRITE in the various ioctl routines; with input from
fgs@ and mickey@; ok deraadt@.
Diffstat (limited to 'sys/dev/wscons/wsmux.c')
-rw-r--r--sys/dev/wscons/wsmux.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/sys/dev/wscons/wsmux.c b/sys/dev/wscons/wsmux.c
index 9964bff685a..f250741e1d1 100644
--- a/sys/dev/wscons/wsmux.c
+++ b/sys/dev/wscons/wsmux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsmux.c,v 1.14 2005/05/15 19:03:47 deraadt Exp $ */
+/* $OpenBSD: wsmux.c,v 1.15 2005/08/14 11:00:15 miod Exp $ */
/* $NetBSD: wsmux.c,v 1.37 2005/04/30 03:47:12 augustss Exp $ */
/*
@@ -377,9 +377,19 @@ wsmux_do_ioctl(struct device *dv, u_long cmd, caddr_t data, int flag,
switch (cmd) {
case WSMUXIO_INJECTEVENT:
+ case WSMUXIO_ADD_DEVICE:
+ case WSMUXIO_REMOVE_DEVICE:
+#ifdef WSDISPLAY_COMPAT_RAWKBD
+ case WSKBDIO_SETMODE:
+#endif
+ if ((flag & FWRITE) == 0)
+ return (EACCES);
+ }
+
+ switch (cmd) {
+ case WSMUXIO_INJECTEVENT:
/* Inject an event, e.g., from moused. */
DPRINTF(("%s: inject\n", sc->sc_base.me_dv.dv_xname));
-
evar = sc->sc_base.me_evp;
if (evar == NULL) {
/* No event sink, so ignore it. */
@@ -627,7 +637,7 @@ wsmux_attach_sc(struct wsmux_softc *sc, struct wsevsrc *me)
DPRINTF(("wsmux_attach_sc: %s set rawkbd=%d\n",
me->me_dv.dv_xname, sc->sc_rawkbd));
(void)wsevsrc_ioctl(me, WSKBDIO_SETMODE,
- &sc->sc_rawkbd, 0, 0);
+ &sc->sc_rawkbd, FWRITE, 0);
#endif
if (sc->sc_kbd_layout != KB_NONE)
(void)wsevsrc_ioctl(me,