CrowdStrike / falcon-scripts

Scripts to streamline the deployment and use of the CrowdStrike Falcon sensor
The Unlicense
142 stars 83 forks source link

Update curl version logic #174

Closed carlosmmatos closed 1 year ago

carlosmmatos commented 1 year ago

The main issue with the existing logic is that we're comparing versions as integers, which isn't an accurate way to do version comparison. The reason is that version numbers are not integers; they're a series of integers. If version numbers were just integers, version 1.11 would be less than version 2.0 and also version 1.2. But it's not, because the 11 in 1.11 is not a single digit but two digits.

example:

curl 8.0.1 will be less than 7.55.0 because the comparison is:

if 801 < 7550