diff options
author | Matthieu Patou <mat@matws.net> | 2010-08-15 18:31:28 +0400 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2010-10-03 01:15:04 +0000 |
commit | ab6e3fce040f9ad27cbce44e9038a24f15b601c8 (patch) | |
tree | ab99a431c9610927b5d0d26335d2712b509fd6dc /source4/heimdal/lib/krb5/config_file.c | |
parent | 197a1514d62494cc8b862d169c841a26e04b8925 (diff) | |
download | samba-ab6e3fce040f9ad27cbce44e9038a24f15b601c8.tar.gz samba-ab6e3fce040f9ad27cbce44e9038a24f15b601c8.tar.bz2 samba-ab6e3fce040f9ad27cbce44e9038a24f15b601c8.zip |
s4:heimdal: import lorikeet-heimdal-201009250123 (commit 42cabfb5b683dbcb97d583c397b897507689e382)
I based this on Matthieu's import of lorikeet-heimdal, and then
updated it to this commit.
Andrew Bartlett
Diffstat (limited to 'source4/heimdal/lib/krb5/config_file.c')
-rw-r--r-- | source4/heimdal/lib/krb5/config_file.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/source4/heimdal/lib/krb5/config_file.c b/source4/heimdal/lib/krb5/config_file.c index 4eb4e12fad..22d0b90bd8 100644 --- a/source4/heimdal/lib/krb5/config_file.c +++ b/source4/heimdal/lib/krb5/config_file.c @@ -239,7 +239,12 @@ parse_binding(struct fileptr *f, unsigned *lineno, char *p, return ret; } -#ifdef __APPLE__ +#if defined(__APPLE__) + +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 +#define HAVE_CFPROPERTYLISTCREATEWITHSTREAM 1 +#endif + static char * cfstring2cstring(CFStringRef string) { @@ -293,7 +298,6 @@ parse_plist_config(krb5_context context, const char *path, krb5_config_section * { CFReadStreamRef s; CFDictionaryRef d; - CFErrorRef e; CFURLRef url; url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, (UInt8 *)path, strlen(path), FALSE); @@ -315,7 +319,11 @@ parse_plist_config(krb5_context context, const char *path, krb5_config_section * return ENOENT; } - d = (CFDictionaryRef)CFPropertyListCreateWithStream (kCFAllocatorDefault, s, 0, kCFPropertyListImmutable, NULL, &e); +#ifdef HAVE_CFPROPERTYLISTCREATEWITHSTREAM + d = (CFDictionaryRef)CFPropertyListCreateWithStream(NULL, s, 0, kCFPropertyListImmutable, NULL, NULL); +#else + d = (CFDictionaryRef)CFPropertyListCreateFromStream(NULL, s, 0, kCFPropertyListImmutable, NULL, NULL); +#endif CFRelease(s); if (d == NULL) { krb5_clear_error_message(context); @@ -447,8 +455,9 @@ krb5_config_parse_file_multi (krb5_context context, fname = newfname; } #else /* KRB5_USE_PATH_TOKENS */ - asprintf(&newfname, "%%{USERCONFIG}/%s", &fname[1]); - if (newfname == NULL) { + if (asprintf(&newfname, "%%{USERCONFIG}%s", &fname[1]) < 0 || + newfname == NULL) + { krb5_set_error_message(context, ENOMEM, N_("malloc: out of memory", "")); return ENOMEM; |