aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPSSHTunnel.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-08-08 00:52:28 +0000
committerrowanbeentje <rowan@beent.je>2009-08-08 00:52:28 +0000
commit4e86aae1cd84904e40f3cd7dab3c4cc72bab77dc (patch)
tree00cc5cb9845afcff14f8330dbca0fcde11f50c88 /Source/SPSSHTunnel.m
parent323d1dce6647a628ad8abc69fa06b03c8d9384fc (diff)
downloadsequelpro-4e86aae1cd84904e40f3cd7dab3c4cc72bab77dc.tar.gz
sequelpro-4e86aae1cd84904e40f3cd7dab3c4cc72bab77dc.tar.bz2
sequelpro-4e86aae1cd84904e40f3cd7dab3c4cc72bab77dc.zip
- Fix SSH tunnel support for private/public keys following framework upgrade changes
Diffstat (limited to 'Source/SPSSHTunnel.m')
-rw-r--r--Source/SPSSHTunnel.m12
1 files changed, 9 insertions, 3 deletions
diff --git a/Source/SPSSHTunnel.m b/Source/SPSSHTunnel.m
index 01ab721d..1705a57b 100644
--- a/Source/SPSSHTunnel.m
+++ b/Source/SPSSHTunnel.m
@@ -162,7 +162,7 @@
{
localPort = 0;
- if (connectionState != PROXY_STATE_IDLE || (!passwordInKeychain && !password)) return;
+ if (connectionState != PROXY_STATE_IDLE) return;
[debugMessages removeAllObjects];
[NSThread detachNewThreadSelector:@selector(launchTask:) toTarget: self withObject: nil ];
}
@@ -288,8 +288,10 @@
[taskEnvironment setObject:[[NSNumber numberWithInt:SPSSH_PASSWORD_USES_KEYCHAIN] stringValue] forKey:@"SP_PASSWORD_METHOD"];
[taskEnvironment setObject:keychainName forKey:@"SP_KEYCHAIN_ITEM_NAME"];
[taskEnvironment setObject:keychainAccount forKey:@"SP_KEYCHAIN_ITEM_ACCOUNT"];
- } else {
+ } else if (password) {
[taskEnvironment setObject:[[NSNumber numberWithInt:SPSSH_PASSWORD_ASKS_UI] stringValue] forKey:@"SP_PASSWORD_METHOD"];
+ } else {
+ [taskEnvironment setObject:[[NSNumber numberWithInt:SPSSH_NO_PASSWORD] stringValue] forKey:@"SP_PASSWORD_METHOD"];
}
[task setEnvironment:taskEnvironment];
@@ -538,7 +540,11 @@
case 1:
thePassword = [NSString stringWithString:[sshPasswordField stringValue]];
[sshPasswordField setStringValue:@""];
- [[delegate undoManager] removeAllActionsWithTarget:sshPasswordField];
+ if ([delegate respondsToSelector:@selector(setUndoManager:)] && [delegate undoManager]) {
+ [[delegate undoManager] removeAllActionsWithTarget:sshPasswordField];
+ } else if ([[parentWindow windowController] document] && [[[parentWindow windowController] document] undoManager]) {
+ [[[[parentWindow windowController] document] undoManager] removeAllActionsWithTarget:sshPasswordField];
+ }
requestedPassphrase = [[NSString alloc] initWithString:thePassword];
// Add to keychain if appropriate