diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPConnectionController.m | 2 | ||||
-rw-r--r-- | Source/SPSSHTunnel.m | 8 |
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 { |