From e345cd9a9a4d825132c97ac023101e538ea911d3 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Sun, 29 May 2011 15:38:17 +0000 Subject: - Ensure blank passwords for MySQL connections are passed in as NULL instead of an empty string; the MySQL manual suggests that maybe we should be doing this, and it may address Issue #1065. --- Source/SPFavoritesPreferencePane.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Source/SPFavoritesPreferencePane.m') diff --git a/Source/SPFavoritesPreferencePane.m b/Source/SPFavoritesPreferencePane.m index 5cc01682..7641e5c8 100644 --- a/Source/SPFavoritesPreferencePane.m +++ b/Source/SPFavoritesPreferencePane.m @@ -499,15 +499,15 @@ NSString *keychainAccount = [keychain accountForUser:[currentFavorite objectForKey:@"user"] host:(([[currentFavorite objectForKey:@"type"] integerValue] == SPSocketConnection)?@"localhost":[currentFavorite objectForKey:@"host"]) database:[currentFavorite objectForKey:@"database"]]; NSString *passwordValue = [keychain getPasswordForName:keychainName account:keychainAccount]; - [standardPasswordField setStringValue:passwordValue]; - [socketPasswordField setStringValue:passwordValue]; - [sshSQLPasswordField setStringValue:passwordValue]; + [standardPasswordField setStringValue:passwordValue?passwordValue:@""]; + [socketPasswordField setStringValue:passwordValue?passwordValue:@""]; + [sshSQLPasswordField setStringValue:passwordValue?passwordValue:@""]; // Retrieve the SSH keychain password if appropriate. NSString *keychainSSHName = [keychain nameForSSHForFavoriteName:[currentFavorite objectForKey:@"name"] id:[currentFavorite objectForKey:@"id"]]; NSString *keychainSSHAccount = [keychain accountForSSHUser:[currentFavorite objectForKey:@"sshUser"] sshHost:[currentFavorite objectForKey:@"sshHost"]]; - - [sshPasswordField setStringValue:[keychain getPasswordForName:keychainSSHName account:keychainSSHAccount]]; + NSString *sshPasswordValue = [keychain getPasswordForName:keychainSSHName account:keychainSSHAccount]; + [sshPasswordField setStringValue:sshPasswordValue?sshPasswordValue:@""]; favoriteNameFieldWasTouched = YES; } -- cgit v1.2.3