(self)
| 100 | |
| 101 | @stackedmethod |
| 102 | def _xpCmdshellTest(self): |
| 103 | threadData = getCurrentThreadData() |
| 104 | pushValue(threadData.disableStdOut) |
| 105 | threadData.disableStdOut = True |
| 106 | |
| 107 | logger.info("testing if xp_cmdshell extended procedure is usable") |
| 108 | output = self.xpCmdshellEvalCmd("echo 1") |
| 109 | |
| 110 | if output == "1": |
| 111 | logger.info("xp_cmdshell extended procedure is usable") |
| 112 | elif isNoneValue(output) and conf.dbmsCred: |
| 113 | errMsg = "it seems that the temporary directory ('%s') used for " % self.getRemoteTempPath() |
| 114 | errMsg += "storing console output within the back-end file system " |
| 115 | errMsg += "does not have writing permissions for the DBMS process. " |
| 116 | errMsg += "You are advised to manually adjust it with option " |
| 117 | errMsg += "'--tmp-path' or you won't be able to retrieve " |
| 118 | errMsg += "the command(s) output" |
| 119 | logger.error(errMsg) |
| 120 | elif isNoneValue(output): |
| 121 | logger.error("unable to retrieve xp_cmdshell output") |
| 122 | else: |
| 123 | logger.info("xp_cmdshell extended procedure is usable") |
| 124 | |
| 125 | threadData.disableStdOut = popValue() |
| 126 | |
| 127 | def xpCmdshellWriteFile(self, fileContent, tmpPath, randDestFile): |
| 128 | echoedLines = [] |
no test coverage detected