From 762781e94dc8257307a5a7dce6985c769da3a69e Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Thu, 13 May 2010 10:40:15 +0000 Subject: [PATCH] Minor bug fix, %TEMP% is expanded only in xp_cmdshell (MSSQL), so disabled for MySQL/PGSQL --- plugins/generic/misc.py | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/plugins/generic/misc.py b/plugins/generic/misc.py index 8ec3d5f07..fac8a018a 100644 --- a/plugins/generic/misc.py +++ b/plugins/generic/misc.py @@ -49,23 +49,10 @@ class Miscellaneous: def getRemoteTempPath(self): if not conf.tmpPath: if kb.os == "Windows": - # NOTES: - # - # * The system-wide temporary files directory is - # C:\WINDOWS\Temp - # - # * MySQL runs by default as SYSTEM - # - # * PostgreSQL runs by default as postgres user and the - # temporary files directory is C:\Documents and Settings\postgres\Local Settings\Temp, - # however the system-wide folder is writable too - # - #infoMsg = "retrieving remote absolute path of temporary files " - #infoMsg += "directory" - #logger.info(infoMsg) - # - #conf.tmpPath = self.evalCmd("echo %TEMP%") - conf.tmpPath = "%TEMP%" + if kb.dbms == "Microsoft SQL Server": + conf.tmpPath = "%TEMP%" + else: + conf.tmpPath = "C:/WINDOWS/Temp" else: conf.tmpPath = "/tmp"