From f55ad4611995449d0c2b118149b439f54ae15f94 Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Mon, 20 Feb 2012 11:06:55 +0000 Subject: [PATCH] Use %TEMP% environment variable as temporary directory (--tmp-path overwrites this btw) folder with direct connection (-d). Via SQL injection, env variables do not work apparently --- plugins/generic/misc.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/plugins/generic/misc.py b/plugins/generic/misc.py index 657ee8b81..e46f17ef6 100644 --- a/plugins/generic/misc.py +++ b/plugins/generic/misc.py @@ -39,14 +39,17 @@ class Miscellaneous: def getRemoteTempPath(self): if not conf.tmpPath: if Backend.isOs(OS.WINDOWS): - self.checkDbmsOs(detailed=True) - - if Backend.getOsVersion() in ("2000", "NT"): - conf.tmpPath = "C:/WINNT/Temp" - elif Backend.getOsVersion() in ("2003", "XP"): - conf.tmpPath = "C:/Documents and Settings/All Users/Application Data/TEMP" + if conf.direct: + conf.tmpPath = "%TEMP%" else: - conf.tmpPath = "C:/Users/All Users/Application Data/TEMP" + self.checkDbmsOs(detailed=True) + + if Backend.getOsVersion() in ("2000", "NT"): + conf.tmpPath = "C:/WINNT/Temp" + elif Backend.getOsVersion() in ("2003", "XP"): + conf.tmpPath = "C:/Documents and Settings/All Users/Application Data/TEMP" + else: + conf.tmpPath = "C:/Users/All Users/Application Data/TEMP" else: conf.tmpPath = "/tmp"