Wrong version comparaison
Bug #586321 reported by
Guillaume Rousse
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OCS Inventory: Unified Unix Agent |
Fix Released
|
Medium
|
mortheres |
Bug Description
Vmsystem.pm use the following code to check dmidecode version:
if ( `dmidecode -V 2>/dev/null` >= 2.7 )
However, this result in a numeric comparaison version, which is wrong, as illustrated by the following one-liner:
perl -e 'print "foo" if 2.10 >= 2.7'
The check has to be done through version module, and forcing a double-dotted version comparison. The attached patch fix this issue.
Changed in ocsinventory-unix-agent: | |
importance: | Undecided → Medium |
assignee: | nobody → mortheres (mortheres) |
Changed in ocsinventory-unix-agent: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Hi,
Thank you for the patch and the report. The problem is that your patch only works under perl 5.10 and not on perl 5.8 because the 'version' module is not integrated in Perl 5.8 :( :( :( . OCS Unix agent have to stay with perl 5.8 for the moment because of compatibility with older systems and so we will have to take a look to find a sexy solution for version numbers comparison in Perl 5.8...
Kind regards,
--
Guillaume