@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Drop Windows-specific SSH code

Summary: Ref T2015. This code is only relevant when attempting to run commands on a Windows host over SSH. Since SSH on Windows is extremely fragile and hard to maintain, and WinRM is a better long-term solution, drop this code (which will end up being unused when later diffs introduce the WinRM command interface).

Test Plan: This code won't be used when D10495 lands.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Projects: #drydock

Maniphest Tasks: T2015

Differential Revision: https://secure.phabricator.com/D13340

J Rhodes 827aa05a 68bb60e5

+2 -40
+2 -40
src/applications/drydock/interface/command/DrydockSSHCommandInterface.php
··· 42 42 $this->openCredentialsIfNotOpen(); 43 43 44 44 $argv = func_get_args(); 45 - 46 - if ($this->getConfig('platform') === 'windows') { 47 - // Handle Windows by executing the command under PowerShell. 48 - $command = id(new PhutilCommandString($argv)) 49 - ->setEscapingMode(PhutilCommandString::MODE_POWERSHELL); 50 - 51 - $change_directory = ''; 52 - if ($this->getWorkingDirectory() !== null) { 53 - $change_directory .= 'cd '.$this->getWorkingDirectory(); 54 - } 55 - 56 - $script = <<<EOF 57 - $change_directory 58 - $command 59 - if (\$LastExitCode -ne 0) { 60 - exit \$LastExitCode 61 - } 62 - EOF; 63 - 64 - // When Microsoft says "Unicode" they don't mean UTF-8. 65 - $script = mb_convert_encoding($script, 'UTF-16LE'); 66 - 67 - $script = base64_encode($script); 68 - 69 - $powershell = 70 - 'C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe'; 71 - $powershell .= 72 - ' -ExecutionPolicy Bypass'. 73 - ' -NonInteractive'. 74 - ' -InputFormat Text'. 75 - ' -OutputFormat Text'. 76 - ' -EncodedCommand '.$script; 77 - 78 - $full_command = $powershell; 79 - } else { 80 - // Handle UNIX by executing under the native shell. 81 - $argv = $this->applyWorkingDirectoryToArgv($argv); 82 - 83 - $full_command = call_user_func_array('csprintf', $argv); 84 - } 45 + $argv = $this->applyWorkingDirectoryToArgv($argv); 46 + $full_command = call_user_func_array('csprintf', $argv); 85 47 86 48 $command_timeout = ''; 87 49 if ($this->connectTimeout !== null) {