Closed AndrewFasano closed 2 weeks 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
) ?
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.
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
@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 :(
Fixes #552