Limited support for Applicaiton Support folder as location for krb5.ini on the Mac...
authorMarshall Vale <mjv@mit.edu>
Tue, 8 Feb 2000 23:02:47 +0000 (23:02 +0000)
committerMarshall Vale <mjv@mit.edu>
Tue, 8 Feb 2000 23:02:47 +0000 (23:02 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12026 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/os/init_os_ctx.c

index 0afef471d4922bba0333a0638663930f39ce1c28..0297a7b7a930eee1b82a6f65a74f5cd50fca26c1 100644 (file)
 
 #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;