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

Skip to content

Commit b7d2680

Browse files
committed
minor refactoring, issue #51
1 parent 8eefe4b commit b7d2680

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

lib/takeover/xp_cmdshell.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,9 @@ def __xpCmdshellConfigure2000(self, mode):
7676
logger.debug(debugMsg)
7777

7878
if mode == 1:
79-
cmd = "EXEC master..sp_addextendedproc 'xp_cmdshell', "
80-
cmd += "@dllname='xplog70.dll'"
79+
cmd = getSPQLSnippet(DBMS.MSSQL, "enable_xp_cmdshell_2000", ENABLE=str(mode))
8180
else:
82-
cmd = "EXEC master..sp_dropextendedproc 'xp_cmdshell'"
81+
cmd = getSPQLSnippet(DBMS.MSSQL, "disable_xp_cmdshell_2000", ENABLE=str(mode))
8382

8483
return cmd
8584

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
EXEC master..sp_dropextendedproc 'xp_cmdshell';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
EXEC master..sp_addextendedproc 'xp_cmdshell', @dllname='xplog70.dll';

0 commit comments

Comments
 (0)