Commit c8fa954d authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Keychain: check osx version at runtime to avoid impossible properties

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent c30f4c6b
...@@ -28,7 +28,7 @@ libkwallet_plugin_la_LIBADD = $(DBUS_LIBS) $(LIBM) ...@@ -28,7 +28,7 @@ libkwallet_plugin_la_LIBADD = $(DBUS_LIBS) $(LIBM)
libkeychain_plugin_la_SOURCES = keystore/keychain.m libkeychain_plugin_la_SOURCES = keystore/keychain.m
libkeychain_plugin_la_OBJCFLAGS = $(AM_CFLAGS) -fobjc-arc 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 if HAVE_OSX
keystore_LTLIBRARIES += libkeychain_plugin.la keystore_LTLIBRARIES += libkeychain_plugin.la
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import <Security/Security.h> #import <Security/Security.h>
#import <Cocoa/Cocoa.h>
static int Open(vlc_object_t *); static int Open(vlc_object_t *);
...@@ -203,9 +204,15 @@ static NSString * ErrorForStatus(OSStatus status) ...@@ -203,9 +204,15 @@ static NSString * ErrorForStatus(OSStatus status)
return message; return message;
} }
#define OSX_MAVERICKS (NSAppKitVersionNumber >= 1265)
extern const CFStringRef kSecAttrAccessible;
static void SetAccessibilityForQuery(vlc_keystore *p_keystore, static void SetAccessibilityForQuery(vlc_keystore *p_keystore,
NSMutableDictionary *query) NSMutableDictionary *query)
{ {
if (!OSX_MAVERICKS)
return;
int accessibilityType = var_InheritInteger(p_keystore, "keychain-accessibility-type"); int accessibilityType = var_InheritInteger(p_keystore, "keychain-accessibility-type");
switch (accessibilityType) { switch (accessibilityType) {
case 1: case 1:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment