bug-bash
[Top][All Lists]
Advanced

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

"cannot execute binary file" error with Bash 5.2


From: loic . yhuel
Subject: "cannot execute binary file" error with Bash 5.2
Date: Mon, 14 Nov 2022 20:40:07 +0100
User-agent: Heirloom mailx 12.5 7/5/10

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -O2 -flto=auto -ffat-lto-objects -fexceptions -g 
-grecord-gcc-switches -pipe -Wall -Werror=format-security 
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS 
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic 
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
uname output: Linux sah1lpt664 6.0.5-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Wed 
Oct 26 15:55:21 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-redhat-linux-gnu

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



reply via email to

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