[vlc-commits] Keychain: check osx version at runtime to avoid impossible properties
Jean-Baptiste Kempf
git at videolan.org
Wed Dec 21 20:25:03 CET 2016
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Dec 21 20:22:54 2016 +0100| [c8fa954d257fd177d4a81069431b771919d33e87] | committer: Jean-Baptiste Kempf
Keychain: check osx version at runtime to avoid impossible properties
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c8fa954d257fd177d4a81069431b771919d33e87
---
modules/keystore/Makefile.am | 2 +-
modules/keystore/keychain.m | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/modules/keystore/Makefile.am b/modules/keystore/Makefile.am
index c7a3867..987f8a3 100644
--- a/modules/keystore/Makefile.am
+++ b/modules/keystore/Makefile.am
@@ -28,7 +28,7 @@ libkwallet_plugin_la_LIBADD = $(DBUS_LIBS) $(LIBM)
libkeychain_plugin_la_SOURCES = keystore/keychain.m
libkeychain_plugin_la_OBJCFLAGS = $(AM_CFLAGS) -fobjc-arc
-libkeychain_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(keystoredir)' -Wl,-framework,Foundation -Wl,-framework,Security
+libkeychain_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(keystoredir)' -Wl,-framework,Foundation -Wl,-framework,Security -Wl,-framework,Cocoa
if HAVE_OSX
keystore_LTLIBRARIES += libkeychain_plugin.la
diff --git a/modules/keystore/keychain.m b/modules/keystore/keychain.m
index 9b9be73..d0f7362 100644
--- a/modules/keystore/keychain.m
+++ b/modules/keystore/keychain.m
@@ -30,6 +30,7 @@
#import <Foundation/Foundation.h>
#import <Security/Security.h>
+#import <Cocoa/Cocoa.h>
static int Open(vlc_object_t *);
@@ -203,9 +204,15 @@ static NSString * ErrorForStatus(OSStatus status)
return message;
}
+#define OSX_MAVERICKS (NSAppKitVersionNumber >= 1265)
+extern const CFStringRef kSecAttrAccessible;
+
static void SetAccessibilityForQuery(vlc_keystore *p_keystore,
NSMutableDictionary *query)
{
+ if (!OSX_MAVERICKS)
+ return;
+
int accessibilityType = var_InheritInteger(p_keystore, "keychain-accessibility-type");
switch (accessibilityType) {
case 1:
More information about the vlc-commits
mailing list