Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cea9d1c

Browse files
committed
Patch related to the #2890
1 parent 94c170d commit cea9d1c

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

lib/core/common.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3562,7 +3562,7 @@ def safeSQLIdentificatorNaming(name, isTable=False):
35623562
_ = isTable and Backend.getIdentifiedDbms() in (DBMS.MSSQL, DBMS.SYBASE)
35633563

35643564
if _:
3565-
retVal = re.sub(r"(?i)\A\[?%s\]?\." % DEFAULT_MSSQL_SCHEMA, "", retVal)
3565+
retVal = re.sub(r"(?i)\A\[?%s\]?\." % DEFAULT_MSSQL_SCHEMA, "%s." % DEFAULT_MSSQL_SCHEMA, retVal)
35663566

35673567
if retVal.upper() in kb.keywords or (retVal or " ")[0].isdigit() or not re.match(r"\A[A-Za-z0-9_@%s\$]+\Z" % ('.' if _ else ""), retVal): # MsSQL is the only DBMS where we automatically prepend schema to table name (dot is normal)
35683568
retVal = unsafeSQLIdentificatorNaming(retVal)
@@ -3573,8 +3573,12 @@ def safeSQLIdentificatorNaming(name, isTable=False):
35733573
retVal = "\"%s\"" % retVal
35743574
elif Backend.getIdentifiedDbms() in (DBMS.ORACLE,):
35753575
retVal = "\"%s\"" % retVal.upper()
3576-
elif Backend.getIdentifiedDbms() in (DBMS.MSSQL, DBMS.SYBASE) and ((retVal or " ")[0].isdigit() or not re.match(r"\A\w+\Z", retVal, re.U)):
3577-
retVal = "[%s]" % retVal
3576+
elif Backend.getIdentifiedDbms() in (DBMS.MSSQL, DBMS.SYBASE):
3577+
parts = retVal.split('.', 1)
3578+
for i in xrange(len(parts)):
3579+
if ((parts[i] or " ")[0].isdigit() or not re.match(r"\A\w+\Z", parts[i], re.U)):
3580+
parts[i] = "[%s]" % parts[i]
3581+
retVal = '.'.join(parts)
35783582

35793583
if _ and DEFAULT_MSSQL_SCHEMA not in retVal and '.' not in re.sub(r"\[[^]]+\]", "", retVal):
35803584
retVal = "%s.%s" % (DEFAULT_MSSQL_SCHEMA, retVal)

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lib.core.enums import OS
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.2.1.11"
22+
VERSION = "1.2.1.12"
2323
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2424
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2525
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

txt/checksum.md5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ a7b0c8e5a18a3abe8803999dcfc4664f lib/controller/handler.py
2727
1e5532ede194ac9c083891c2f02bca93 lib/controller/__init__.py
2828
e3a3f5218b2e52dd0afafdfc9fed2002 lib/core/agent.py
2929
62fade52c1524364e6e0653c31143a9c lib/core/bigarray.py
30-
85de1b2ef240f740478841185f0743c2 lib/core/common.py
30+
8bfcc9511c4956ad22b62aa2c8f6386e lib/core/common.py
3131
2a40d5b5997265daa890545d4a4a59b9 lib/core/convert.py
3232
9f87391b6a3395f7f50830b391264f27 lib/core/data.py
3333
72016ea5c994a711a262fd64572a0fcd lib/core/datatype.py
@@ -46,7 +46,7 @@ ffa5f01f39b17c8d73423acca6cfe86a lib/core/readlineng.py
4646
0c3eef46bdbf87e29a3f95f90240d192 lib/core/replication.py
4747
a7db43859b61569b601b97f187dd31c5 lib/core/revision.py
4848
fcb74fcc9577523524659ec49e2e964b lib/core/session.py
49-
9f41a4088761dda067b7575f0cd4a7eb lib/core/settings.py
49+
1887ce5c0983ffbeda639e3110a54521 lib/core/settings.py
5050
d0adc28a38e43a787df4471f7f027413 lib/core/shell.py
5151
63491be462c515a1a3880c27c2acc4a2 lib/core/subprocessng.py
5252
505aaa61e1bba3c3d4567c3e667699e3 lib/core/target.py

0 commit comments

Comments
 (0)