Debian Bug report logs - #517485
manpages: console_ioctl(4) lies about KDGETLED

version graph

Package: manpages; Maintainer for manpages is Martin Schulze <joey@debian.org>; Source for manpages is src:manpages.

Reported by: Alan Curry <pacman@kosh.dhis.org>

Date: Sat, 28 Feb 2009 05:42:02 UTC

Severity: normal

Tags: fixed-upstream

Fixed in version manpages/3.20-1

Done: Joey Schulze <joey@infodrom.org>

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, Martin Schulze <joey@debian.org>:
Bug#517485; Package manpages. (Sat, 28 Feb 2009 05:42:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alan Curry <pacman@kosh.dhis.org>:
New Bug report received and forwarded. Copy sent to Martin Schulze <joey@debian.org>. (Sat, 28 Feb 2009 05:42:04 GMT) Full text and rfc822 format available.

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

From: Alan Curry <pacman@kosh.dhis.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: manpages: console_ioctl(4) lies about KDGETLED
Date: Sat, 28 Feb 2009 00:39:48 -0500
Package: manpages
Severity: normal


This description:

>       KDGETLED
>	      Get state of LEDs.  argp points to a long.  The lower three bits
>	      of *argp are set to the state of the LEDs, as follows:
>
>		  LED_CAP	0x04   caps lock led
>		  LEC_NUM	0x02   num lock led
>		  LED_SCR	0x01   scroll lock led

is wrong. The kernel only stores a single byte *argp, so if you give it the
address of a long, you won't necessarily find the results in the low 3 bits
of the long. (It happens to work out that way if you are little-endian.)
Change "long" to "char" and the description will be correct.

Demonstration program (run it on a big-endian machine to see that the actual
behavior is not what the man page says):

#include <stdio.h>
#include <sys/ioctl.h>
#include <linux/kd.h>

int main(void)
{
  int ioctlret;
  long longval;

  longval = -1;

  ioctlret = ioctl(0, KDGETLED, &longval);
  printf("ioctlret=%d longval=%08lx\n", ioctlret, longval);

  return 0;
}

-- System Information:
Debian Release: 5.0
  APT prefers stable
  APT policy: (99, 'stable')
Architecture: powerpc (ppc)

Kernel: Linux 2.6.28.2
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

manpages depends on no packages.

manpages recommends no packages.

Versions of packages manpages suggests:
ii  man-db [man-browser]          2.5.2-4    on-line manual pager




Information forwarded to debian-bugs-dist@lists.debian.org, Martin Schulze <joey@debian.org>:
Bug#517485; Package manpages. (Sat, 28 Feb 2009 10:03:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to mtk.manpages@gmail.com:
Extra info received and forwarded to list. Copy sent to Martin Schulze <joey@debian.org>. (Sat, 28 Feb 2009 10:03:02 GMT) Full text and rfc822 format available.

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

From: Michael Kerrisk <mtk.manpages@googlemail.com>
To: Alan Curry <pacman@kosh.dhis.org>, 517485@bugs.debian.org
Cc: control <control@bugs.debian.org>
Subject: Re: Bug#517485: manpages: console_ioctl(4) lies about KDGETLED
Date: Sat, 28 Feb 2009 23:01:16 +1300
tags 517485 fixed-upstream
thanks

Hello Alan,

On 2/28/09, Alan Curry <pacman@kosh.dhis.org> wrote:
> Package: manpages
> Severity: normal
>
>
> This description:
>
>>       KDGETLED
>>	      Get state of LEDs.  argp points to a long.  The lower three bits
>>	      of *argp are set to the state of the LEDs, as follows:
>>
>>		  LED_CAP	0x04   caps lock led
>>		  LEC_NUM	0x02   num lock led
>>		  LED_SCR	0x01   scroll lock led
>
> is wrong. The kernel only stores a single byte *argp, so if you give it the
> address of a long, you won't necessarily find the results in the low 3 bits
> of the long. (It happens to work out that way if you are little-endian.)
> Change "long" to "char" and the description will be correct.
>
> Demonstration program (run it on a big-endian machine to see that the actual
> behavior is not what the man page says):
>
> #include <stdio.h>
> #include <sys/ioctl.h>
> #include <linux/kd.h>
>
> int main(void)
> {
>   int ioctlret;
>   long longval;
>
>   longval = -1;
>
>   ioctlret = ioctl(0, KDGETLED, &longval);
>   printf("ioctlret=%d longval=%08lx\n", ioctlret, longval);
>
>   return 0;
> }

Thanks for the excellently documented report!  As you suggest, I have
changed "long" to "char", and the change will be in ustream 3.20.

Cheers,

Michael

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
git://git.kernel.org/pub/scm/docs/man-pages/man-pages.git
man-pages online: http://www.kernel.org/doc/man-pages/online_pages.html
Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html




Tags added: fixed-upstream Request was from Michael Kerrisk <mtk.manpages@googlemail.com> to control@bugs.debian.org. (Sat, 28 Feb 2009 10:03:03 GMT) Full text and rfc822 format available.

Reply sent to Joey Schulze <joey@infodrom.org>:
You have taken responsibility. (Sun, 26 Apr 2009 10:12:09 GMT) Full text and rfc822 format available.

Notification sent to Alan Curry <pacman@kosh.dhis.org>:
Bug acknowledged by developer. (Sun, 26 Apr 2009 10:12:10 GMT) Full text and rfc822 format available.

Message #17 received at 517485-close@bugs.debian.org (full text, mbox):

From: Joey Schulze <joey@infodrom.org>
To: 517485-close@bugs.debian.org
Subject: Bug#517485: fixed in manpages 3.20-1
Date: Sun, 26 Apr 2009 10:02:41 +0000
Source: manpages
Source-Version: 3.20-1

We believe that the bug you reported is fixed in the latest version of
manpages, which is due to be installed in the Debian FTP archive:

manpages-dev_3.20-1_all.deb
  to pool/main/m/manpages/manpages-dev_3.20-1_all.deb
manpages_3.20-1.diff.gz
  to pool/main/m/manpages/manpages_3.20-1.diff.gz
manpages_3.20-1.dsc
  to pool/main/m/manpages/manpages_3.20-1.dsc
manpages_3.20-1_all.deb
  to pool/main/m/manpages/manpages_3.20-1_all.deb
manpages_3.20.orig.tar.gz
  to pool/main/m/manpages/manpages_3.20.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 517485@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Joey Schulze <joey@infodrom.org> (supplier of updated manpages package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sun, 26 Apr 2009 11:36:34 +0200
Source: manpages
Binary: manpages manpages-dev
Architecture: source all
Version: 3.20-1
Distribution: unstable
Urgency: low
Maintainer: Martin Schulze <joey@debian.org>
Changed-By: Joey Schulze <joey@infodrom.org>
Description: 
 manpages   - Manual pages about using a GNU/Linux system
 manpages-dev - Manual pages about using GNU/Linux for development
Closes: 516677 517074 517485 519209 519230 520904
Changes: 
 manpages (3.20-1) unstable; urgency=low
 .
   * New upstream version
     . Add explicit character set encoding to first line of several
       manpages (closes: Bug#519209)
     . Fix type of 'offset' argument in seekdir(3) and return type in
       telldir (closes: Bug#519230)
     . Small fix to description in strftime(3) (closes: Bug#516677)
     . Fix 'argp' type for KDGETLED description in console_ioctl(4)
       (closes: Bug#517485)
     . Add description of /srv in hier(7) (closes: Bug#520904)
     . Fix types used to declare sin6_family and sin6_port in ipv6(7)
       (closes: Bug#517074)
   * Corrected fclose(3)
Checksums-Sha1: 
 03fa98f500d63bad215d1aa54ea840b1629157cf 964 manpages_3.20-1.dsc
 e85794d5f613f8d70ac83a92a626eb5ca91465af 1590787 manpages_3.20.orig.tar.gz
 4351e33a2116f749181a2386bace0dbe9d8cff00 48327 manpages_3.20-1.diff.gz
 a32965aaa7633303c2e96328ffaac652d6705cfa 713822 manpages_3.20-1_all.deb
 4b5211c2297342a64a420bd24e9883c40490919a 1555264 manpages-dev_3.20-1_all.deb
Checksums-Sha256: 
 74704b80b6472549572e3903f850ebd6b73f2576e5cb9daf9d4cb81f6cffea26 964 manpages_3.20-1.dsc
 4351a0537c7d05f23e1c17f99b62e4b75d1d81a9c99347821bca0bbb5794ed09 1590787 manpages_3.20.orig.tar.gz
 010a879e44692acea4d7ef103ad0e340863799d2511d14a8f86e7a518f68e9c4 48327 manpages_3.20-1.diff.gz
 75a576115a5ccd8f8624171507ab736d831161b0b850ab7fd9435d62c8d91c43 713822 manpages_3.20-1_all.deb
 f84b168719f293efaccfc379bd0f07313efe23b7b9f732ef01fab409386b8a65 1555264 manpages-dev_3.20-1_all.deb
Files: 
 676509b49bc7740897adb400d2c8c802 964 doc important manpages_3.20-1.dsc
 2df4c07be521ef7c2579eeaae677ad8c 1590787 doc important manpages_3.20.orig.tar.gz
 e7791092c3a2b721b36f75ca21a4d23a 48327 doc important manpages_3.20-1.diff.gz
 18d26a0f0bd2b5c8eed4aeeba3421abd 713822 doc important manpages_3.20-1_all.deb
 696caf409bc48e9193d395f08ae4696f 1555264 doc optional manpages-dev_3.20-1_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iD8DBQFJ9CvOW5ql+IAeqTIRArxjAKCFOzN3tWq2Ajij6sjBryP+Ne4i9ACfQ6dy
4zmFH3XqZqqRy2gbVfu6E+w=
=/jco
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Mon, 25 May 2009 07:40:46 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri Apr 18 06:28:36 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.