Skip to content

Commit 9c5357a

Browse files
committed
#2437 disable keychain access when passwords are being sent as cleartext
1 parent fc4ff91 commit 9c5357a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Source/SPKeychain.m

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,23 @@
3838

3939
@implementation SPKeychain
4040

41+
- (id)init
42+
{
43+
if (!(self = [super init])) {
44+
return nil;
45+
}
46+
47+
NSString *cleartext = [NSProcessInfo processInfo].environment[@"LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN"];
48+
if (cleartext != nil) {
49+
NSLog(@"LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN is set. Disabling keychain access. See Issue #2437");
50+
51+
[self release];
52+
return nil;
53+
}
54+
55+
return self;
56+
}
57+
4158
/**
4259
* Add the supplied password to the user's Keychain using the supplied name and account.
4360
*/

0 commit comments

Comments
 (0)