Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14076701
D19542.id46759.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D19542.id46759.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D19542: Add parsing for ssh options (-o) which are passed when using GIT v2 wire protocol by git command (SSH transport)
Attached
Detach File
Event Timeline
Log In to Comment