macos prefs pane krb5 auth setup
authorDerrick Brashear <shadow@dementia.org>
Sat, 27 Feb 2010 22:48:19 +0000 (17:48 -0500)
committerDerrick Brashear <shadow@dementia.org>
Sat, 27 Feb 2010 23:32:11 +0000 (15:32 -0800)
when we configure krb5-at-login, don't inadvertantly reorder the list.
replace inline.

FIXES 126628

Change-Id: I23de38dadeae6a01d6f97d84e7bb6d9e75e99510
Reviewed-on: http://gerrit.openafs.org/1408
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/platform/DARWIN/AFSPreference/PListManager.m

index e6c1aa9..f90f5bd 100644 (file)
@@ -27,7 +27,8 @@
        SInt32                                  osxMJVers = 0;
        SInt32                                  osxMnVers = 0;
        FileUtil                                *futil = nil;
-       
+       SInt32                                  object_index = 0;
+
        //check system 
        if (Gestalt(gestaltSystemVersionMajor, &osxMJVers) != noErr || Gestalt(gestaltSystemVersionMinor, &osxMnVers) != noErr) @throw [NSException exceptionWithName:@"PListManager:krb5TiketAtLoginTime" 
                                                                                                                                                                                                                                                                                                                   reason:@"Error getting system version"
@@ -82,8 +83,9 @@
        }
        
        //Make change
-       [mechanismsArray removeObject:toRemove];
-       [mechanismsArray addObject:toAdd];
+       object_index = [mechanismsArray indexOfObject: toRemove];
+       [mechanismsArray replaceObjectAtIndex:object_index withObject:toAdd];
+
        //write plist
        plistData  = [NSPropertyListSerialization dataFromPropertyList:plist
                                                                                                                        format:NSPropertyListXMLFormat_v1_0
                }
                // chmod on tmp file
                [futil autorizedChown:TMP_FILE owner:@"root" group:@"wheel"];
-               //mov ethe file 
+               //move the file 
                [futil autorizedMoveFile:TMP_FILE toPath:AUTH_FILE_DIR];
        }
        [futil release];