On Ubuntu 20.04 (at least) /etc/os-release contains two lines which start with ID leading to an incorrect OS name being detected by the fallback implementation of lsb_release in deps.sh.
When os-release contains
ID=ubuntu
ID_LIKE=debian
the implementation of lsb_release will incorrectly return "ubuntu debian" when it should have returned "ubuntu".
Since deps.sh doesn't quote the $distro variable, this leads to a syntax error as $distro then contains a space.
The following minimal dockerfile will reproduce the issue:
FROM ubuntu:20.04
RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -qq install -y --no-install-recommends git ca-certificates
RUN git clone https://github.com/ReFirmLabs/binwalk
WORKDIR /binwalk
RUN bash ./deps.sh --yes
On Ubuntu 20.04 (at least) /etc/os-release contains two lines which start with
ID
leading to an incorrect OS name being detected by the fallback implementation of lsb_release in deps.sh.When os-release contains
the implementation of lsb_release will incorrectly return "ubuntu debian" when it should have returned "ubuntu".
Since deps.sh doesn't quote the $distro variable, this leads to a syntax error as $distro then contains a space.
The following minimal dockerfile will reproduce the issue:
Which leads to the following error: