GNU bug report logs - #48960
stat v8.30 - device number in decimal shown as 16bit number instead of to converted 8bit

Previous Next

Package: coreutils;

Reported by: wolfgang.rohm <at> arcor.de

Date: Fri, 11 Jun 2021 14:58:03 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Wolfgang Rohm <wolfgang.rohm <at> arcor.de>
To: bug-coreutils <at> gnu.org
Subject: stat v8.30 - device number in decimal shown as 16bit number instead
 of to converted 8bit
Date: Fri, 11 Jun 2021 09:37:54 +0200
[Message part 1 (text/plain, inline)]
Hello.

Stat prints the device number, major and minor, in hex and decimal. They 
are both 8bit numbers clamped together. While the hex number is 
perfectly fine, the decimal doesn't respect how this number has come to 
existence. There is no meaning in the decimal value, if the the hex 
value is taken as one 16bit number and then converted.

For example "fd00h" is converted to "64768d". There is no major device 
with 647 and no minor device with 768. Its just completely wrong.

So instead of converting fd00h to 64768d, both 8bit hex numbers must be 
converted each, meaning alone. The right number would be therefore 
253000, major 253 and minor 0. While the hex number needs two digits 
each (the first 0 can be ommited), the decimal needs three digits each 
(the first and second 0 can be omitted).

|stat (GNU coreutils) 8.30
Copyright © 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Geschrieben von Michael Meskes.
|

-- 
Mit freundlichen Grüßen
Wolfgang Rohm

[Message part 2 (text/html, inline)]

This bug report was last modified 3 years and 340 days ago.

Previous Next


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