From ecb1dc32351e091f5c359ecc3f905d5b71118e9c Mon Sep 17 00:00:00 2001 From: Marshall Vale Date: Tue, 8 Feb 2000 23:02:47 +0000 Subject: [PATCH] Limited support for Applicaiton Support folder as location for krb5.ini on the Mac added git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12026 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/os/init_os_ctx.c | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/src/lib/krb5/os/init_os_ctx.c b/src/lib/krb5/os/init_os_ctx.c index 0afef471d..0297a7b7a 100644 --- a/src/lib/krb5/os/init_os_ctx.c +++ b/src/lib/krb5/os/init_os_ctx.c @@ -31,11 +31,13 @@ #ifdef macintosh OSErr -GetMacProfileFileSpec (FSSpec* outFileSpec, StringPtr inName) +GetMacProfileFileSpec (FSSpec* outFileSpec, StringPtr inName, UInt32 whichFolder) { OSErr err; - err = FindFolder (kOnSystemDisk, kPreferencesFolderType, kCreateFolder, + + + err = FindFolder (kOnSystemDisk, whichFolder, kCreateFolder, &(outFileSpec -> vRefNum) , &(outFileSpec -> parID)); if (err == noErr) { @@ -202,15 +204,29 @@ os_get_default_config_files(pfiles, secure) { profile_filespec_t* files; #ifdef macintosh - files = malloc(3 * sizeof(FSSpec)); + files = malloc(5 * sizeof(FSSpec)); + if (files != 0) { - OSErr err = GetMacProfileFileSpec(&(files [0]), "\pKerberos5 Configuration"); + OSErr err = GetMacProfileFileSpec(&(files [2]), "\pKerberos5 Configuration", kApplicationSupportFolderType); + if (err == noErr) { + err = GetMacProfileFileSpec( &(files [3]), "\pkrb5.ini", kApplicationSupportFolderType); + } + + if (err == noErr) { + files[4].vRefNum = 0; + files[4].parID = 0; + files[4].name[0] = '\0'; + } else { + files[2].vRefNum = 0; + files[2].parID = 0; + files[2].name[0] = '\0'; + } + + err = GetMacProfileFileSpec(&(files [0]), "\pKerberos5 Configuration", kPreferencesFolderType); if (err == noErr) { - err = GetMacProfileFileSpec( &(files [1]), "\pkrb5.ini"); + err = GetMacProfileFileSpec( &(files [1]), "\pkrb5.ini", kPreferencesFolderType); } - files[2].vRefNum = 0; - files[2].parID = 0; - files[2].name[0] = '\0'; + if (err != noErr) { free (files); return ENFILE; -- 2.26.2