From 08db4c1ac43c11f8d516a734b600ab9a393ff3e5 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Tue, 6 Apr 2010 21:58:30 +0000 Subject: - Improve .spf handling of blank passwords; allow empty passwords to be saved (this addresses http://spbug/l/75), and correctly restore empty passwords --- Source/TableDocument.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/TableDocument.m b/Source/TableDocument.m index 14af042e..bd12b9bf 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -273,8 +273,8 @@ [connectionController setSshUser:@""]; [connectionController setSshPort:@""]; [connectionController setDatabase:@""]; - [connectionController setPassword:@""]; - [connectionController setSshPassword:@""]; + [connectionController setPassword:nil]; + [connectionController setSshPassword:nil]; // Deselect all favorites [[connectionController valueForKeyPath:@"favoritesTable"] deselectAll:connectionController]; @@ -2877,8 +2877,8 @@ if([[spfDocData_temp objectForKey:@"save_password"] boolValue]) { NSString *pw = [self keychainPasswordForConnection:nil]; if(![pw length]) pw = [connectionController password]; - [connection setObject:pw forKey:@"password"]; - if([connectionController type] == SPSSHTunnelConnection) + if (pw) [connection setObject:pw forKey:@"password"]; + if([connectionController type] == SPSSHTunnelConnection && [connectionController sshPassword]) [connection setObject:[connectionController sshPassword] forKey:@"ssh_password"]; } -- cgit v1.2.3