Maproom / qmapshack

Consumer grade GIS software
GNU General Public License v3.0
298 stars 64 forks source link

The java version check (in BRouter setup) isn't very safe #664

Open diefau opened 10 months ago

diefau commented 10 months ago

The check for java version(s) in the BRouter setup (which was closed with #594) seems to be not very save:

on a Debian (sid) system with this java version it fails:

> java -version

openjdk version "17.0.10-ea" 2024-01-16
OpenJDK Runtime Environment (build 17.0.10-ea+6-Debian-1)
OpenJDK 64-Bit Server VM (build 17.0.10-ea+6-Debian-1, mixed mode, sharing)

and

> java --version
openjdk 17.0.10-ea 2024-01-16
OpenJDK Runtime Environment (build 17.0.10-ea+6-Debian-1)
OpenJDK 64-Bit Server VM (build 17.0.10-ea+6-Debian-1, mixed mode, sharing)

Maybe the regexps (in CRouterBRouterSetup.cpp in line 753 and 756) should be changed (a little bit more): "[\\S]+ version \"(\\d+)(\\.\\d+)*\" .*" to "[\\S]+ version \"(\\d+)(\\.\\d+)*.*\" .*" and "[\\S]+ (\\d+)(\\.\\d+)* .*" to "[\\S]+ (\\d+)(\\.\\d+)*.* .*"

(this works for the java version above) and seems a little bit safer

ossilator commented 8 months ago

note that this prevents completing the brouter setup despite the error message suggesting that this is something that can be bypassed. afaict, this makes it plain impossible to use offline brouter altogether.