aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-10-06 21:43:12 +0000
committerrowanbeentje <rowan@beent.je>2010-10-06 21:43:12 +0000
commitb763c421f6fc2fc693ccbf89ffe38c64cd977ab8 (patch)
tree78f895186693fb305bff00f2ab73f2f0b36aa2b4 /Source
parentc42b7483546e0cdfa1dd82cdda1d18313e6af111 (diff)
downloadsequelpro-b763c421f6fc2fc693ccbf89ffe38c64cd977ab8.tar.gz
sequelpro-b763c421f6fc2fc693ccbf89ffe38c64cd977ab8.tar.bz2
sequelpro-b763c421f6fc2fc693ccbf89ffe38c64cd977ab8.zip
- Update SSH connections to pick up custom ports configured in SSH config files; thanks to Stefan Schüßer for this patch.
- Tweak SSH Master Mode to use the "ControlMaster auto" setting instead of -M - Update localizable strings
Diffstat (limited to 'Source')
-rw-r--r--Source/SPConnectionController.m2
-rw-r--r--Source/SPSSHTunnel.m8
2 files changed, 6 insertions, 4 deletions
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m
index 44b35d8d..b9d53025 100644
--- a/Source/SPConnectionController.m
+++ b/Source/SPConnectionController.m
@@ -328,7 +328,7 @@
[self setSshHost:[[self sshHost] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]];
// Set up the tunnel details
- sshTunnel = [[SPSSHTunnel alloc] initToHost:[self sshHost] port:([[self sshPort] length]?[[self sshPort] integerValue]:22) login:[self sshUser] tunnellingToPort:([[self port] length]?[[self port] integerValue]:3306) onHost:[self host]];
+ sshTunnel = [[SPSSHTunnel alloc] initToHost:[self sshHost] port:[[self sshPort] integerValue] login:[self sshUser] tunnellingToPort:([[self port] length]?[[self port] integerValue]:3306) onHost:[self host]];
[sshTunnel setParentWindow:[tableDocument parentWindow]];
// Add keychain or plaintext password as appropriate - note the checks in initiateConnection.
diff --git a/Source/SPSSHTunnel.m b/Source/SPSSHTunnel.m
index 807d507e..fd0fcb9b 100644
--- a/Source/SPSSHTunnel.m
+++ b/Source/SPSSHTunnel.m
@@ -42,7 +42,7 @@
*/
- (id) initToHost:(NSString *) theHost port:(NSInteger) thePort login:(NSString *) theLogin tunnellingToPort:(NSInteger) targetPort onHost:(NSString *) targetHost
{
- if (!theHost || !thePort || !targetPort || !targetHost) return nil;
+ if (!theHost || !targetPort || !targetHost) return nil;
self = [super init];
@@ -292,7 +292,7 @@
taskArguments = [[NSMutableArray alloc] init];
[taskArguments addObject:@"-N"]; // Tunnel only
[taskArguments addObject:@"-v"]; // Verbose mode for messages
- [taskArguments addObject:@"-M"]; // Places the ssh client into 'master' mode for connection sharing
+ [taskArguments addObject:@"-o ControlMaster=auto"]; // Support 'master' mode for connection sharing
[taskArguments addObject:@"-o ExitOnForwardFailure=yes"];
[taskArguments addObject:[NSString stringWithFormat:@"-o ConnectTimeout=%ld", (long)connectionTimeout]];
[taskArguments addObject:@"-o NumberOfPasswordPrompts=3"];
@@ -305,7 +305,9 @@
[taskArguments addObject:[NSString stringWithFormat:@"-o ServerAliveInterval=%ld", (long)ceil(keepAliveInterval)]];
[taskArguments addObject:@"-o ServerAliveCountMax=1"];
}
- [taskArguments addObject:[NSString stringWithFormat:@"-p %ld", (long)sshPort]];
+ if (sshPort) {
+ [taskArguments addObject:[NSString stringWithFormat:@"-p %ld", (long)sshPort]];
+ }
if ([sshLogin length]) {
[taskArguments addObject:[NSString stringWithFormat:@"%@@%@", sshLogin, sshHost]];
} else {