ReFirmLabs / binwalk

Firmware Analysis Tool
MIT License
10.85k stars 1.54k forks source link

Update deps.sh lsb_relase to avoid ID_LIKE field #553

Closed AndrewFasano closed 2 weeks ago

AndrewFasano commented 3 years ago

Fixes #552

Ayowel commented 3 years ago

Wondering if distributions exist where there is a space between the key name and the = ? Doesn't happen as far as I'm aware but I'm wondering if this change could break binwalk in such cases or if the file is guaranteed to have this formatting.

Additionally, is it not a good occasion to try to get a more accurate matching by enforcing start of line (^) and = at the end of the match for all looked-up keys (VERSION_ID, DISTRIB_ID, and DISTRIB_RELEASE) ?

AndrewFasano commented 3 years ago

Thanks for the suggestion @Ayowel - I added a second commit to make the matching logic consistent for all 4 keys and also to ignore any irrelevant whitespace.

edi33416 commented 2 years ago

Imho, the expansion of the $distro variable in the test blocks (like at line 44) should be inside quotes ".

So the test

if [ $distro = "Kali" ]

becomes

if [ "$distro" = "Kali" ]

Now, even if $distro contains space characters ( ), the test syntax is corect

AndrewFasano commented 2 years ago

@edi33416 Yeah, you're right, that would be better - but I'm not sure that's really related to #552. Maybe it's worth opening another PR with that change?

I was trying to keep this PR super simple in the hopes of getting it merged, though that strategy doesn't seem to be working :(