Subject: lib/22815: file(1) doesn't correctly print release of 1.6Z+ binaries
To: None <gnats-bugs@gnats.NetBSD.org>
From: dieter <dieter@opensource.rave.org>
List: netbsd-bugs
Date: 09/16/2003 15:25:51
>Number:         22815
>Category:       lib
>Synopsis:       file(1) doesn't correctly print release of 1.6Z+ binaries
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 16 13:26:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     dieter Roelants
>Release:        NetBSD 1.6ZB
>Organization:

>Environment:
System: NetBSD okuma 1.6ZB NetBSD 1.6ZB (OKUMA) #39: Mon Sep 15 18:49:35 CEST 2003 root@okuma:/usr/src/sys/arch/i386/compile/OKUMA i386
Architecture: i386
Machine: i386
>Description:

	When querying the file type of a NetBSD 1.6ZB binary,
	file(1) prints ``Z\'' instead of ``ZB''.

>How-To-Repeat:

$ file /bin/ls
/bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for NetBSD 1.6Z\, dynamically linked (uses shared libs), stripped

>Fix:

--- /usr/src/dist/file/src/readelf.c.orig	2003-09-16 15:08:43.000000000 +0200
+++ /usr/src/dist/file/src/readelf.c	2003-09-16 15:09:31.000000000 +0200
@@ -377,7 +377,7 @@
 				    == -1)
 					return size;
 			} else if (ver_rel != 0 && ver_rel <= 52) {
-				if (file_printf(ms, "Z%c", 'A' + ver_rel - 1)
+				if (file_printf(ms, "Z%c", 'A' + ver_rel - 27)
 				    == -1)
 					return size;
 			} else if (ver_rel != 0) {

>Release-Note:
>Audit-Trail:
>Unformatted: