File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212import collections
1313import contextlib
1414import copy
15+ import distutils .version
1516import functools
1617import getpass
1718import hashlib
@@ -586,7 +587,7 @@ def isVersionWithin(versionList):
586587
587588 @staticmethod
588589 def isVersionGreaterOrEqualThan (version ):
589- return Backend .getVersion () is not None and str (Backend .getVersion ()) >= str (version )
590+ return Backend .getVersion () is not None and version is not None and distutils . version . LooseVersion ( str (Backend .getVersion ()) or ' ' ) >= distutils . version . LooseVersion ( str (version ) or ' ' )
590591
591592 @staticmethod
592593 def isOs (os ):
Original file line number Diff line number Diff line change 1818from thirdparty .six import unichr as _unichr
1919
2020# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21- VERSION = "1.4.12.34 "
21+ VERSION = "1.4.12.35 "
2222TYPE = "dev" if VERSION .count ('.' ) > 2 and VERSION .split ('.' )[- 1 ] != '0' else "stable"
2323TYPE_COLORS = {"dev" : 33 , "stable" : 90 , "pip" : 34 }
2424VERSION_STRING = "sqlmap/%s#%s" % ('.' .join (VERSION .split ('.' )[:- 1 ]) if VERSION .count ('.' ) > 2 and VERSION .split ('.' )[- 1 ] == '0' else VERSION , TYPE )
Original file line number Diff line number Diff line change 55See the file 'LICENSE' for copying permission
66"""
77
8+ import distutils .version
89import os
910
1011from lib .core .agent import agent
@@ -37,13 +38,13 @@ def udfSetRemotePath(self):
3738
3839 banVer = kb .bannerFp ["dbmsVersion" ]
3940
40- if banVer >= "5.0.67" :
41+ if distutils . version . LooseVersion ( banVer ) >= distutils . version . LooseVersion ( "5.0.67" ) :
4142 if self .__plugindir is None :
4243 logger .info ("retrieving MySQL plugin directory absolute path" )
4344 self .__plugindir = unArrayizeValue (inject .getValue ("SELECT @@plugin_dir" ))
4445
4546 # On MySQL 5.1 >= 5.1.19 and on any version of MySQL 6.0
46- if self .__plugindir is None and banVer >= "5.1.19" :
47+ if self .__plugindir is None and distutils . version . LooseVersion ( banVer ) >= distutils . version . LooseVersion ( "5.1.19" ) :
4748 logger .info ("retrieving MySQL base directory absolute path" )
4849
4950 # Reference: http://dev.mysql.com/doc/refman/5.1/en/server-options.html#option_mysqld_basedir
Original file line number Diff line number Diff line change 55See the file 'LICENSE' for copying permission
66"""
77
8+ import distutils .version
89import os
910
1011from lib .core .common import Backend
@@ -50,9 +51,9 @@ def udfSetLocalPaths(self):
5051
5152 banVer = kb .bannerFp ["dbmsVersion" ]
5253
53- if banVer >= "10" :
54+ if distutils . version . LooseVersion ( banVer ) >= distutils . version . LooseVersion ( "10" ) :
5455 majorVer = banVer .split ('.' )[0 ]
55- elif banVer >= "8.2" and '.' in banVer :
56+ elif distutils . version . LooseVersion ( banVer ) >= distutils . version . LooseVersion ( "8.2" ) and '.' in banVer :
5657 majorVer = '.' .join (banVer .split ('.' )[:2 ])
5758 else :
5859 errMsg = "unsupported feature on versions of PostgreSQL before 8.2"
You can’t perform that action at this time.
0 commit comments