File tree Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 12
12
import collections
13
13
import contextlib
14
14
import copy
15
+ import distutils .version
15
16
import functools
16
17
import getpass
17
18
import hashlib
@@ -586,7 +587,7 @@ def isVersionWithin(versionList):
586
587
587
588
@staticmethod
588
589
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 ' ' )
590
591
591
592
@staticmethod
592
593
def isOs (os ):
Original file line number Diff line number Diff line change 18
18
from thirdparty .six import unichr as _unichr
19
19
20
20
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21
- VERSION = "1.4.12.34 "
21
+ VERSION = "1.4.12.35 "
22
22
TYPE = "dev" if VERSION .count ('.' ) > 2 and VERSION .split ('.' )[- 1 ] != '0' else "stable"
23
23
TYPE_COLORS = {"dev" : 33 , "stable" : 90 , "pip" : 34 }
24
24
VERSION_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 5
5
See the file 'LICENSE' for copying permission
6
6
"""
7
7
8
+ import distutils .version
8
9
import os
9
10
10
11
from lib .core .agent import agent
@@ -37,13 +38,13 @@ def udfSetRemotePath(self):
37
38
38
39
banVer = kb .bannerFp ["dbmsVersion" ]
39
40
40
- if banVer >= "5.0.67" :
41
+ if distutils . version . LooseVersion ( banVer ) >= distutils . version . LooseVersion ( "5.0.67" ) :
41
42
if self .__plugindir is None :
42
43
logger .info ("retrieving MySQL plugin directory absolute path" )
43
44
self .__plugindir = unArrayizeValue (inject .getValue ("SELECT @@plugin_dir" ))
44
45
45
46
# 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" ) :
47
48
logger .info ("retrieving MySQL base directory absolute path" )
48
49
49
50
# 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 5
5
See the file 'LICENSE' for copying permission
6
6
"""
7
7
8
+ import distutils .version
8
9
import os
9
10
10
11
from lib .core .common import Backend
@@ -50,9 +51,9 @@ def udfSetLocalPaths(self):
50
51
51
52
banVer = kb .bannerFp ["dbmsVersion" ]
52
53
53
- if banVer >= "10" :
54
+ if distutils . version . LooseVersion ( banVer ) >= distutils . version . LooseVersion ( "10" ) :
54
55
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 :
56
57
majorVer = '.' .join (banVer .split ('.' )[:2 ])
57
58
else :
58
59
errMsg = "unsupported feature on versions of PostgreSQL before 8.2"
You can’t perform that action at this time.
0 commit comments