Date: Thu, 18 Jan 2001 20:14:16 +0100 (CET) From: cejkar@dcse.fee.vutbr.cz To: FreeBSD-gnats-submit@freebsd.org Subject: kern/24437: syscons - MOUSE_MOUSECHAR fix Message-ID: <200101181914.f0IJEGZ35527@kazi.dcse.fee.vutbr.cz>
next in thread | raw e-mail | index | archive | help
>Number: 24437
>Category: kern
>Synopsis: syscons - MOUSE_MOUSECHAR fix
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Thu Jan 18 11:20:02 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Rudolf Cejka
>Release: FreeBSD 5.0-CURRENT i386
>Organization:
Brno University of Technology, FEE&CS, Czech Republic
>Environment:
All systems with MOUSE_MOUSECHAR ioctl.
>Description:
When changing MOUSE_MOUSECHAR over vidcontrol, original characters
are not restored correcty. Instead, characters 0, 1, 2, and 3
are loaded in their position: Patch #1, lower change.
Right values for MOUSE_MOUSECHAR (c) are 0 <= c <= UCHAR_MAX - 3,
but kernel allows only 0 <= c <= UCHAR_MAX - 5 and vidcontrol
allows 0 <= c <= UCHAR_MAX. Kernel fix: Patch #1, upper change.
Vidcontrol fix: Patch #2.
>How-To-Repeat:
>Fix:
$FreeBSD: src/sys/dev/syscons/scmouse.c,v 1.16 2000/10/09 08:08:28 phk Exp $
--- scmouse.c.orig Thu Jan 18 18:18:32 2001
+++ scmouse.c Thu Jan 18 19:35:38 2001
@@ -874,13 +874,15 @@
if (mouse->u.mouse_char < 0) {
mouse->u.mouse_char = scp->sc->mouse_char;
} else {
- if (mouse->u.mouse_char >= UCHAR_MAX - 4)
+ if (mouse->u.mouse_char > UCHAR_MAX - 3)
return EINVAL;
s = spltty();
sc_remove_all_mouse(scp->sc);
#ifndef SC_NO_FONT_LOADING
if (ISTEXTSC(cur_scp) && (cur_scp->font != NULL))
- sc_load_font(cur_scp, 0, cur_scp->font_size, cur_scp->font,
+ sc_load_font(cur_scp, 0, cur_scp->font_size,
+ cur_scp->font + cur_scp->font_size
+ * cur_scp->sc->mouse_char,
cur_scp->sc->mouse_char, 4);
#endif
scp->sc->mouse_char = mouse->u.mouse_char;
"$FreeBSD: src/usr.sbin/vidcontrol/vidcontrol.c,v 1.33 2000/10/08 21:34:00 phk Exp $";
--- vidcontrol.c.orig Thu Jan 18 19:44:17 2001
+++ vidcontrol.c Thu Jan 18 19:44:31 2001
@@ -415,8 +415,8 @@
long l;
l = strtol(arg, NULL, 0);
- if ((l < 0) || (l > UCHAR_MAX)) {
- warnx("argument to -M must be 0 through %d", UCHAR_MAX);
+ if ((l < 0) || (l > UCHAR_MAX - 3)) {
+ warnx("argument to -M must be 0 through %d", UCHAR_MAX - 3);
return;
}
mouse.operation = MOUSE_MOUSECHAR;
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200101181914.f0IJEGZ35527>
