aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAbhi Beckert <abhi@abhibeckert.com>2017-03-03 15:08:25 +1000
committerGitHub <noreply@github.com>2017-03-03 15:08:25 +1000
commitbaa9d677f242927f68a91ad52b9dee6873489c45 (patch)
treec0ac84fe78c01fb1e4385e59319931abe5528b65
parent4b9ce74930c385269089f78d4f2cb237b85c16b6 (diff)
parent9c5357a28e27b74a6df7bfeeb24015073d5993e5 (diff)
downloadsequelpro-baa9d677f242927f68a91ad52b9dee6873489c45.tar.gz
sequelpro-baa9d677f242927f68a91ad52b9dee6873489c45.tar.bz2
sequelpro-baa9d677f242927f68a91ad52b9dee6873489c45.zip
Merge pull request #2714 from abhibeckert/master
#2437 disable keychain access when passwords are being sent as cleartext
-rw-r--r--Source/SPKeychain.m17
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/SPKeychain.m b/Source/SPKeychain.m
index 066f4011..49e2de69 100644
--- a/Source/SPKeychain.m
+++ b/Source/SPKeychain.m
@@ -38,6 +38,23 @@
@implementation SPKeychain
+- (id)init
+{
+ if (!(self = [super init])) {
+ return nil;
+ }
+
+ NSString *cleartext = [NSProcessInfo processInfo].environment[@"LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN"];
+ if (cleartext != nil) {
+ NSLog(@"LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN is set. Disabling keychain access. See Issue #2437");
+
+ [self release];
+ return nil;
+ }
+
+ return self;
+}
+
/**
* Add the supplied password to the user's Keychain using the supplied name and account.
*/