bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "cannot execute binary file" error with Bash 5.2


From: Chet Ramey
Subject: Re: "cannot execute binary file" error with Bash 5.2
Date: Tue, 15 Nov 2022 09:34:18 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.1

On 11/14/22 2:40 PM, loic.yhuel@gmail.com wrote:

Bash Version: 5.2
Patch Level: 2
Release Status: release

Description:
         I can no longer run xxx-ct-ng.config scripts produced by crosstool-ng.
         Those just contain a few lines of script, with appended bzip2 
compressed text.
         
https://github.com/crosstool-ng/crosstool-ng/blob/master/scripts/toolchain-config.in
        Bash 5.2 changed the check_binary_file function, it seems any NUL in 
the first
         80 characters will cause the error.

Repeat-By:
        Create a test.sh with :
         #!/bin/sh
         tail -n+4 "${0}" | bzcat
         exit 0

         $ echo foo | bzip2 >> test.sh
         $ bash ./test.sh
         ./test.sh: ./test.sh: cannot execute binary file

https://savannah.gnu.org/support/index.php?110744

I attached the patch I applied.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

Attachment: binary-file-hashbang
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]