Debian Bug report logs - #53977
console-tools: setkeycode does not use right IOCTL

version graph

Package: console-tools; Maintainer for console-tools is Alastair McKinstry <mckinstry@debian.org>; Source for console-tools is src:console-tools.

Reported by: Bernd Eckenfels <ecki@lina.inka.de>

Date: Tue, 4 Jan 2000 00:33:01 UTC

Severity: normal

Found in version 1:0.2.3-9

Done: Bernd Eckenfels <ecki@lina.inka.de>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Yann Dirson <dirson@debian.org>:
Bug#53977; Package console-tools. Full text and rfc822 format available.

Acknowledgement sent to Bernd Eckenfels <ecki@lina.inka.de>:
New Bug report received and forwarded. Copy sent to Yann Dirson <dirson@debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Bernd Eckenfels <ecki@lina.inka.de>
To: submit@bugs.debian.org
Subject: console-tools: setkeycode does not use right IOCTL
Date: Tue, 04 Jan 2000 01:18:13 +0100
Package: console-tools
Version: 1:0.2.3-9
Severity: normal

using setkeycodes does use the IOCTL  KDGKBTYPE instead of KDSETKEYCODE. You
can see that in the attached strace:

open("/dev/tty", O_RDWR)                = 3
ioctl(3, KDGKBTYPE, 0xbffff8bb)         = -1 EINVAL (Invalid argument)
close(3)                                = 0
open("/dev/tty0", O_RDWR)               = 3
ioctl(3, KDGKBTYPE, 0xbffff8bb)         = 0
_exit(0)                                = ?

the related getkeycodes does use the right ioctl and will list the table
unchanged after issuing the abve broken setkeycodes. I checked the source
which looks pretty OK. But recompiling does not help:

alista:/home/ecki/console-tools-0.2.3/kbdtools# cpp setkeycodes.c  | grep 'ioctl('
      if (ioctl(fd,0x4B4D ,&a))

...thats ok...

but the generated bin not:

open("/dev/tty", O_RDWR)                = 3
ioctl(0x3, 0x4b33, 0xbffff84b)          = -1 (errno 22)
close(3)                                = 0
open("/dev/tty0", O_RDWR)               = 3
ioctl(0x3, 0x4b33, 0xbffff84b)          = 0
_exit(0)                                = ?

Because 0x4b33 is:

Linux calista 2.2.12 #3 Sat Sep 11 05:18:13 CEST 1999 i686 unknown

egrep '(KDGKBTYPE)|(KDSETKEYCODE)' /usr/include/linux/*.h
/usr/include/linux/kd.h:#define KDGKBTYPE       0x4B33  /* get keyboard type */
/usr/include/linux/kd.h:#define KDSETKEYCODE    0x4B4D  /* write kernel keycode table entry */
egrep '(KDGKBTYPE)|(KDSETKEYCODE)' /usr/src/linux-2.2.13/include/linux/*.h
/usr/src/linux-2.2.13/include/linux/kd.h:#define KDGKBTYPE      0x4B33  /* get keyboard type */
/usr/src/linux-2.2.13/include/linux/kd.h:#define KDSETKEYCODE   0x4B4D  /* write kernel keycode table entry */

wrong ... humm..

Greetings
Bernd

-- System Information
Debian Release: potato
Kernel Version: Linux calista 2.2.12 #3 Sat Sep 11 05:18:13 CEST 1999 i686 unknown

Versions of the packages console-tools depends on:
ii  console-data    1999.08.29-8   Keymaps, fonts, charset maps, fallback table
ii  console-tools-l 0.2.3-9        Shared libraries for Linux console and font 
ii  libc6           2.1.2-11       GNU C Library: Shared libraries and Timezone
ii  sysvinit        2.78-1         System-V like init.


Information forwarded to debian-bugs-dist@lists.debian.org, Yann Dirson <dirson@debian.org>:
Bug#53977; Package console-tools. Full text and rfc822 format available.

Acknowledgement sent to John Dalbec <jdalbec@cboss.com>:
Extra info received and forwarded to list. Copy sent to Yann Dirson <dirson@debian.org>. Full text and rfc822 format available.

Message #10 received at 53977@bugs.debian.org (full text, mbox):

From: John Dalbec <jdalbec@cboss.com>
To: 53977@bugs.debian.org
Subject: Red herring & fencepost
Date: Wed, 03 Jan 2001 23:09:19 -0500
The ioctl in the strace is a red herring.  This is part of the get_console_fd
function call.  The real issue seems to be a fencepost bug in the while loop.
Running "setkeycodes e078 112 e079 112" sets the first pair but not the second.
John



Information forwarded to debian-bugs-dist@lists.debian.org, Yann Dirson <dirson@debian.org>:
Bug#53977; Package console-tools. Full text and rfc822 format available.

Acknowledgement sent to cjw44@flatline.org.uk (Colin Watson):
Extra info received and forwarded to list. Copy sent to Yann Dirson <dirson@debian.org>. Full text and rfc822 format available.

Message #15 received at 53977@bugs.debian.org (full text, mbox):

From: cjw44@flatline.org.uk (Colin Watson)
To: John Dalbec <jdalbec@cboss.com>, 53977@bugs.debian.org
Cc: 53977-submitter@bugs.debian.org
Subject: Re: Bug#53977: Red herring & fencepost
Date: Thu, 04 Jan 2001 11:13:43 +0000
John Dalbec <jdalbec@cboss.com>, 53977@bugs.debian.org wrote:
>The ioctl in the strace is a red herring.  This is part of the
>get_console_fd function call.  The real issue seems to be a fencepost
>bug in the while loop. Running "setkeycodes e078 112 e079 112" sets the
>first pair but not the second.

In that case, this bug should be fixed now:

console-tools (1:0.2.3-14) unstable; urgency=low

[...]
  * Fixed off-by-one bug in setkeycodes, causing the last pair to be
    ignored (Closes: #53775).
[...]

 -- Yann Dirson <dirson@debian.org>  Mon, 19 Jun 2000 22:09:09 +0200

-- 
Colin Watson                                     [cjw44@flatline.org.uk]



Message sent on to Bernd Eckenfels <ecki@lina.inka.de>:
Bug#53977. Full text and rfc822 format available.

Reply sent to Bernd Eckenfels <ecki@lina.inka.de>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to Bernd Eckenfels <ecki@lina.inka.de>:
Bug acknowledged by developer. Full text and rfc822 format available.

Message #23 received at 53977-done@bugs.debian.org (full text, mbox):

From: Bernd Eckenfels <ecki@lina.inka.de>
To: 53977-done@bugs.debian.org
Subject: works in 0.2.3-14
Date: Fri, 5 Jan 2001 02:12:00 +0100
at least it works in 0.2.3-14 now.

Greetings
Bernd



Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Mon Apr 21 12:44:08 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.