[File] "script executable" misdetection

Christoph Biedl astron.com.bwoj at manchmal.in-ulm.de
Wed Dec 21 19:08:19 UTC 2022


Hello,

during some tests I encountered the following:

    $ printf '#!\xdb\x0e' | file -
    /dev/stdin: a \333\016 script executable (binary data)

This was introduced in 

commit e2b34d5c7232ae3a0fdc898e9893e36c647efbbb (HEAD, refs/bisect/bad)
Author: Christos Zoulas <christos at zoulas.com>
Date:   Sun Oct 9 17:47:36 2022 +0000

    Use string/w to merge many patterns; make their strength ~30 equal for env
    and non env scripts but less to the more specific commands. Move a specific
    command to commands from scripts.

Basically everything that starts with "#!" is now considered some
script. Perhaps limit this to cases where the following characters are
7bit printable?

    Christoph
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20221221/6f81cb5a/attachment.asc>


More information about the File mailing list