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