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

Skip to content

Commit f7d15cb

Browse files
committed
Official naming is HSQLDB (and/or HyperSQL)
1 parent aeb83ba commit f7d15cb

15 files changed

Lines changed: 44 additions & 44 deletions

File tree

lib/controller/handler.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from lib.core.settings import MAXDB_ALIASES
2121
from lib.core.settings import SYBASE_ALIASES
2222
from lib.core.settings import DB2_ALIASES
23-
from lib.core.settings import HSQL_ALIASES
23+
from lib.core.settings import HSQLDB_ALIASES
2424
from lib.utils.sqlalchemy import SQLAlchemy
2525

2626
from plugins.dbms.mssqlserver import MSSQLServerMap
@@ -43,8 +43,8 @@
4343
from plugins.dbms.sybase.connector import Connector as SybaseConn
4444
from plugins.dbms.db2 import DB2Map
4545
from plugins.dbms.db2.connector import Connector as DB2Conn
46-
from plugins.dbms.hsql import HSQLMap
47-
from plugins.dbms.hsql.connector import Connector as HSQLConn
46+
from plugins.dbms.hsqldb import HSQLDBMap
47+
from plugins.dbms.hsqldb.connector import Connector as HSQLDBConn
4848

4949
def setHandler():
5050
"""
@@ -63,7 +63,7 @@ def setHandler():
6363
(DBMS.MAXDB, MAXDB_ALIASES, MaxDBMap, MaxDBConn),
6464
(DBMS.SYBASE, SYBASE_ALIASES, SybaseMap, SybaseConn),
6565
(DBMS.DB2, DB2_ALIASES, DB2Map, DB2Conn),
66-
(DBMS.HSQL, HSQL_ALIASES, HSQLMap, HSQLConn),
66+
(DBMS.HSQLDB, HSQLDB_ALIASES, HSQLDBMap, HSQLDBConn),
6767
]
6868

6969
_ = max(_ if (Backend.getIdentifiedDbms() or "").lower() in _[1] else None for _ in items)

lib/core/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ def concatQuery(self, query, unpack=True):
525525
else:
526526
return query
527527

528-
if Backend.getIdentifiedDbms() in (DBMS.MYSQL, DBMS.HSQL):
528+
if Backend.getIdentifiedDbms() in (DBMS.MYSQL, DBMS.HSQLDB):
529529
if fieldsExists:
530530
concatenatedQuery = concatenatedQuery.replace("SELECT ", "CONCAT('%s'," % kb.chars.start, 1)
531531
concatenatedQuery += ",'%s')" % kb.chars.stop

lib/core/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3448,7 +3448,7 @@ def _(value):
34483448
retVal = retVal.decode("utf-16-le")
34493449
except UnicodeDecodeError:
34503450
pass
3451-
elif Backend.isDbms(DBMS.HSQL):
3451+
elif Backend.isDbms(DBMS.HSQLDB):
34523452
try:
34533453
retVal = retVal.decode("utf-16-be")
34543454
except UnicodeDecodeError:

lib/core/dicts.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from lib.core.settings import MAXDB_ALIASES
2121
from lib.core.settings import SYBASE_ALIASES
2222
from lib.core.settings import DB2_ALIASES
23-
from lib.core.settings import HSQL_ALIASES
23+
from lib.core.settings import HSQLDB_ALIASES
2424

2525
FIREBIRD_TYPES = {
2626
"261": "BLOB",
@@ -138,7 +138,7 @@
138138
DBMS.MAXDB: (MAXDB_ALIASES, None, None, "maxdb"),
139139
DBMS.SYBASE: (SYBASE_ALIASES, "python-pymssql", "http://pymssql.sourceforge.net/", "sybase"),
140140
DBMS.DB2: (DB2_ALIASES, "python ibm-db", "http://code.google.com/p/ibm-db/", "ibm_db_sa"),
141-
DBMS.HSQL: (HSQL_ALIASES, "python jaydebeapi", "https://pypi.python.org/pypi/JayDeBeApi/", "hsql"),
141+
DBMS.HSQLDB: (HSQLDB_ALIASES, "python jaydebeapi", "https://pypi.python.org/pypi/JayDeBeApi/", "hsqldb"),
142142
}
143143

144144
FROM_DUMMY_TABLE = {
@@ -147,7 +147,7 @@
147147
DBMS.FIREBIRD: " FROM RDB$DATABASE",
148148
DBMS.MAXDB: " FROM VERSIONS",
149149
DBMS.DB2: " FROM SYSIBM.SYSDUMMY1",
150-
DBMS.HSQL: " FROM INFORMATION_SCHEMA.SYSTEM_USERS"
150+
DBMS.HSQLDB: " FROM INFORMATION_SCHEMA.SYSTEM_USERS"
151151
}
152152

153153
SQL_STATEMENTS = {

lib/core/enums.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class DBMS:
3333
PGSQL = "PostgreSQL"
3434
SQLITE = "SQLite"
3535
SYBASE = "Sybase"
36-
HSQL = "HyperSQL"
36+
HSQLDB = "HyperSQL"
3737

3838
class DBMS_DIRECTORY_NAME:
3939
ACCESS = "access"
@@ -46,7 +46,7 @@ class DBMS_DIRECTORY_NAME:
4646
PGSQL = "postgresql"
4747
SQLITE = "sqlite"
4848
SYBASE = "sybase"
49-
HSQL = "hsql"
49+
HSQLDB = "hsqldb"
5050

5151
class CUSTOM_LOGGING:
5252
PAYLOAD = 9

lib/core/settings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
SYBASE_SYSTEM_DBS = ("master", "model", "sybsystemdb", "sybsystemprocs")
164164
DB2_SYSTEM_DBS = ("NULLID", "SQLJ", "SYSCAT", "SYSFUN", "SYSIBM", "SYSIBMADM", "SYSIBMINTERNAL", "SYSIBMTS",\
165165
"SYSPROC", "SYSPUBLIC", "SYSSTAT", "SYSTOOLS")
166-
HSQL_SYSTEM_DBS = ("INFORMATION_SCHEMA", "SYSTEM_LOB")
166+
HSQLDB_SYSTEM_DBS = ("INFORMATION_SCHEMA", "SYSTEM_LOB")
167167

168168
MSSQL_ALIASES = ("microsoft sql server", "mssqlserver", "mssql", "ms")
169169
MYSQL_ALIASES = ("mysql", "my")
@@ -175,11 +175,11 @@
175175
MAXDB_ALIASES = ("maxdb", "sap maxdb", "sap db")
176176
SYBASE_ALIASES = ("sybase", "sybase sql server")
177177
DB2_ALIASES = ("db2", "ibm db2", "ibmdb2")
178-
HSQL_ALIASES = ("hsql", "hsqldb", "hs", "hypersql")
178+
HSQLDB_ALIASES = ("hsql", "hsqldb", "hs", "hypersql")
179179

180180
DBMS_DIRECTORY_DICT = dict((getattr(DBMS, _), getattr(DBMS_DIRECTORY_NAME, _)) for _ in dir(DBMS) if not _.startswith("_"))
181181

182-
SUPPORTED_DBMS = MSSQL_ALIASES + MYSQL_ALIASES + PGSQL_ALIASES + ORACLE_ALIASES + SQLITE_ALIASES + ACCESS_ALIASES + FIREBIRD_ALIASES + MAXDB_ALIASES + SYBASE_ALIASES + DB2_ALIASES + HSQL_ALIASES
182+
SUPPORTED_DBMS = MSSQL_ALIASES + MYSQL_ALIASES + PGSQL_ALIASES + ORACLE_ALIASES + SQLITE_ALIASES + ACCESS_ALIASES + FIREBIRD_ALIASES + MAXDB_ALIASES + SYBASE_ALIASES + DB2_ALIASES + HSQLDB_ALIASES
183183
SUPPORTED_OS = ("linux", "windows")
184184

185185
USER_AGENT_ALIASES = ("ua", "useragent", "user-agent")
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@
66
"""
77

88
from lib.core.enums import DBMS
9-
from lib.core.settings import HSQL_SYSTEM_DBS
9+
from lib.core.settings import HSQLDB_SYSTEM_DBS
1010
from lib.core.unescaper import unescaper
11-
from plugins.dbms.hsql.enumeration import Enumeration
12-
from plugins.dbms.hsql.filesystem import Filesystem
13-
from plugins.dbms.hsql.fingerprint import Fingerprint
14-
from plugins.dbms.hsql.syntax import Syntax
15-
from plugins.dbms.hsql.takeover import Takeover
11+
from plugins.dbms.hsqldb.enumeration import Enumeration
12+
from plugins.dbms.hsqldb.filesystem import Filesystem
13+
from plugins.dbms.hsqldb.fingerprint import Fingerprint
14+
from plugins.dbms.hsqldb.syntax import Syntax
15+
from plugins.dbms.hsqldb.takeover import Takeover
1616
from plugins.generic.misc import Miscellaneous
1717

18-
class HSQLMap(Syntax, Fingerprint, Enumeration, Filesystem, Miscellaneous, Takeover):
18+
class HSQLDBMap(Syntax, Fingerprint, Enumeration, Filesystem, Miscellaneous, Takeover):
1919
"""
2020
This class defines MySQL methods
2121
"""
2222

2323
def __init__(self):
24-
self.excludeDbsList = HSQL_SYSTEM_DBS
24+
self.excludeDbsList = HSQLDB_SYSTEM_DBS
2525
self.sysUdfs = {
2626
# UDF name: UDF return data-type
2727
"sys_exec": { "return": "int" },
@@ -36,4 +36,4 @@ def __init__(self):
3636
Miscellaneous.__init__(self)
3737
Takeover.__init__(self)
3838

39-
unescaper[DBMS.HSQL] = Syntax.escape
39+
unescaper[DBMS.HSQLDB] = Syntax.escape
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def __init__(self):
3333
def connect(self):
3434
self.initConnection()
3535
try:
36-
jar = './thirdparty/hsql/hsqldb.jar'
36+
jar = './thirdparty/hsqldb/hsqldb.jar'
3737
args='-Djava.class.path=%s' % jar
3838
jvm_path = jpype.getDefaultJVMPath()
3939
jpype.startJVM(jvm_path, args)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ def __init__(self):
1313
GenericFilesystem.__init__(self)
1414

1515
def readFile(self, rFile):
16-
errMsg = "Not implemented in HSQL"
16+
errMsg = "Not implemented in HSQLDB"
1717
raise SqlmapUnsupportedFeatureException(errMsg)
1818

1919
def writeFile(self, wFile, dFile, fileType=None, forceCheck=False):
20-
errMsg = "Not implemented in HSQL"
20+
errMsg = "Not implemented in HSQLDB"
2121
raise SqlmapUnsupportedFeatureException(errMsg)

0 commit comments

Comments
 (0)