Package: file
Version: 5.11-2
Severity: normal

Dear Maintainer,

In some cases, 'file' misreports an explicitly declared '#!/bin/sh'
POSIX shell script as 'data'.  My best guess is that these large
files contain self-extracting binary payload which is being found by
'file', but they are most certainly still shell scripts and IMHO,
an explicit '#!' (shebang, magic interpreter) line should NEVER
be overriden by any analysis algorithm in 'file', unless it is to
provide more details. (and this is new behaviour in 'wheezy') (i.e.
it seems that some new algorithm has been given higher precedent
than simply reporting the shebang interpreter contents)


$ lsb_release -ds
Debian GNU/Linux 7.0 (wheezy)

$ file --version
file-5.11
magic file from /home/sdowdy/.magic:/usr/share/file/magic

$ cat /home/sdowdy/.magic
cat: /home/sdowdy/.magic: No such file or directory
(i.e. no user overrides, and i haven't touched /usr/share/file/magic*)

(any of Dell's DUP .BIN kits exhibit this issue, so i provide one as an example)
$ wget 
http://downloads.dell.com/FOLDER00797936M/1/R710_BIOS_VCNMH_LN32_6.3.0.BIN
...
2013-05-06 14:31:23 (1.16 MB/s) - `R710_BIOS_VCNMH_LN32_6.3.0.BIN' saved 
[5103874/5103874]

$ file R710_BIOS_VCNMH_LN32_6.3.0.BIN
R710_BIOS_VCNMH_LN32_6.3.0.BIN: data

(on 'squeeze', this is not misreported as data, but correctly as POSIX shell 
script)

  [squeeze:begin]
  pick:tmp# lsb_release -ds
  Debian GNU/Linux 6.0.6 (squeeze)
  pick:tmp# wget 
http://downloads.dell.com/FOLDER00797936M/1/R710_BIOS_VCNMH_LN32_6.3.0.BIN
  2013-05-06 15:07:21 (1.16 MB/s) - "R710_BIOS_VCNMH_LN32_6.3.0.BIN" saved 
[5103874/5103874]

  pick:tmp# file R710_BIOS_VCNMH_LN32_6.3.0.BIN
  R710_BIOS_VCNMH_LN32_6.3.0.BIN: POSIX shell script text executable
  [squeeze:end]

$ head -2 R710_BIOS_VCNMH_LN32_6.3.0.BIN
#!/bin/sh


$ head -10 R710_BIOS_VCNMH_LN32_6.3.0.BIN | file -
/dev/stdin: POSIX shell script, ASCII text executable
(correctly reported if we strip the binary payload)


thanks,
--stephen

-- System Information:
Debian Release: 7.0
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-4-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/dash

Versions of packages file depends on:
ii  libc6      2.13-38
ii  libmagic1  5.11-2
ii  zlib1g     1:1.2.7.dfsg-13

file recommends no packages.

file suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to