Fix various issues with SSH receivers

Summary:
  - Original command is in SSH_ORIGINAL_COMMAND, not normal argv.
  - Use PhutilShellLexer to parse it.
  - Fix a protocol encoding issue with ConduitSSHWorkflow. I think I'm going to make this protocol accept multiple commands anyway because SSH pipes are crazy expensive to build (even locally, they're ~300ms).

Test Plan: With other changes, successfully executed "arc list --conduit-uri=ssh://localhost:2222".

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T550

Differential Revision: https://secure.phabricator.com/D4232
This commit is contained in:
epriestley
2012-12-19 11:11:32 -08:00
parent e78898970a
commit 6dd0169873
3 changed files with 36 additions and 24 deletions

View File

@@ -31,9 +31,10 @@ final class ConduitSSHWorkflow extends PhabricatorSSHWorkflow {
throw new Exception("Invalid JSON input.");
}
$params = $raw_params;
$params = idx($raw_params, 'params', array());
$params = json_decode($params, true);
$metadata = idx($params, '__conduit__', array());
unset($params['__conduit__']);
$metadata = idx($raw_params, '__conduit__', array());
$call = null;
$error_code = null;