Page MenuHomePhabricator

D19542.id46759.diff
No OneTemporary

D19542.id46759.diff

diff --git a/scripts/ssh/ssh-connect.php b/scripts/ssh/ssh-connect.php
--- a/scripts/ssh/ssh-connect.php
+++ b/scripts/ssh/ssh-connect.php
@@ -27,7 +27,15 @@
'param' => pht('port'),
'help' => pht('Port number to connect to.'),
),
+ array(
+ 'name' => 'options',
+ 'short' => 'o',
+ 'param' => pht('options'),
+ 'repeat' => true,
+ 'help' => pht('SSH options.'),
+ ),
));
+
$unconsumed_argv = $args->getUnconsumedArgumentVector();
if (function_exists('pcntl_signal')) {
@@ -113,6 +121,25 @@
$arguments[] = $port;
}
+$options = $args->getArg('options');
+$allowed_ssh_options = array('SendEnv=GIT_PROTOCOL');
+
+if (!empty($options)) {
+ foreach ($options as $option) {
+ if (array_search($option, $allowed_ssh_options) !== false) {
+ $pattern[] = '-o %s';
+ $arguments[] = $option;
+ } else {
+ throw new Exception(
+ pht(
+ 'Disallowed ssh option "%s" given with "-o". '.
+ 'Allowed options are: %s.',
+ $option,
+ implode(', ', $allowed_ssh_options)));
+ }
+ }
+}
+
$pattern[] = '--';
$pattern[] = '%s';

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 22, 7:24 PM (14 h, 40 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6775666
Default Alt Text
D19542.id46759.diff (1 KB)

Event Timeline