mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-25 11:03:47 +03:00
Patch for an Issue #1047
This commit is contained in:
parent
0cb7852754
commit
8947f2df96
|
@ -8,12 +8,14 @@ See the file 'doc/COPYING' for copying permission
|
|||
import os
|
||||
|
||||
from lib.core.common import Backend
|
||||
from lib.core.common import checkFile
|
||||
from lib.core.common import decloakToTemp
|
||||
from lib.core.common import randomStr
|
||||
from lib.core.data import kb
|
||||
from lib.core.data import logger
|
||||
from lib.core.data import paths
|
||||
from lib.core.enums import OS
|
||||
from lib.core.exception import SqlmapSystemException
|
||||
from lib.core.exception import SqlmapUnsupportedFeatureException
|
||||
from lib.request import inject
|
||||
from plugins.generic.takeover import Takeover as GenericTakeover
|
||||
|
@ -60,14 +62,20 @@ class Takeover(GenericTakeover):
|
|||
errMsg = "unsupported feature on versions of PostgreSQL before 8.2"
|
||||
raise SqlmapUnsupportedFeatureException(errMsg)
|
||||
|
||||
if Backend.isOs(OS.WINDOWS):
|
||||
_ = os.path.join(self.udfLocalFile, "postgresql", "windows", "%d" % Backend.getArch(), majorVer, "lib_postgresqludf_sys.dll_")
|
||||
self.udfLocalFile = decloakToTemp(_)
|
||||
self.udfSharedLibExt = "dll"
|
||||
else:
|
||||
_ = os.path.join(self.udfLocalFile, "postgresql", "linux", "%d" % Backend.getArch(), majorVer, "lib_postgresqludf_sys.so_")
|
||||
self.udfLocalFile = decloakToTemp(_)
|
||||
self.udfSharedLibExt = "so"
|
||||
try:
|
||||
if Backend.isOs(OS.WINDOWS):
|
||||
_ = os.path.join(self.udfLocalFile, "postgresql", "windows", "%d" % Backend.getArch(), majorVer, "lib_postgresqludf_sys.dll_")
|
||||
checkFile(_)
|
||||
self.udfLocalFile = decloakToTemp(_)
|
||||
self.udfSharedLibExt = "dll"
|
||||
else:
|
||||
_ = os.path.join(self.udfLocalFile, "postgresql", "linux", "%d" % Backend.getArch(), majorVer, "lib_postgresqludf_sys.so_")
|
||||
checkFile(_)
|
||||
self.udfLocalFile = decloakToTemp(_)
|
||||
self.udfSharedLibExt = "so"
|
||||
except SqlmapSystemException:
|
||||
errMsg = "unsupported feature on PostgreSQL %s (%s-bit)" % (majorVer, Backend.getArch())
|
||||
raise SqlmapUnsupportedFeatureException(errMsg)
|
||||
|
||||
def udfCreateFromSharedLib(self, udf, inpRet):
|
||||
if udf in self.udfToCreate:
|
||||
|
|
Loading…
Reference in New Issue
Block a user