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

Skip to content

Commit 762781e

Browse files
committed
Minor bug fix, %TEMP% is expanded only in xp_cmdshell (MSSQL), so disabled for MySQL/PGSQL
1 parent 091e0b2 commit 762781e

1 file changed

Lines changed: 4 additions & 17 deletions

File tree

plugins/generic/misc.py

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,10 @@ def __init__(self):
4949
def getRemoteTempPath(self):
5050
if not conf.tmpPath:
5151
if kb.os == "Windows":
52-
# NOTES:
53-
#
54-
# * The system-wide temporary files directory is
55-
# C:\WINDOWS\Temp
56-
#
57-
# * MySQL runs by default as SYSTEM
58-
#
59-
# * PostgreSQL runs by default as postgres user and the
60-
# temporary files directory is C:\Documents and Settings\postgres\Local Settings\Temp,
61-
# however the system-wide folder is writable too
62-
#
63-
#infoMsg = "retrieving remote absolute path of temporary files "
64-
#infoMsg += "directory"
65-
#logger.info(infoMsg)
66-
#
67-
#conf.tmpPath = self.evalCmd("echo %TEMP%")
68-
conf.tmpPath = "%TEMP%"
52+
if kb.dbms == "Microsoft SQL Server":
53+
conf.tmpPath = "%TEMP%"
54+
else:
55+
conf.tmpPath = "C:/WINDOWS/Temp"
6956
else:
7057
conf.tmpPath = "/tmp"
7158

0 commit comments

Comments
 (0)