From 42d3d08b2285812ded74856c8e7d8f8253c3cab6 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Sat, 27 Feb 2010 17:48:19 -0500 Subject: [PATCH] macos prefs pane krb5 auth setup 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 Tested-by: Derrick Brashear --- src/platform/DARWIN/AFSPreference/PListManager.m | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/platform/DARWIN/AFSPreference/PListManager.m b/src/platform/DARWIN/AFSPreference/PListManager.m index e6c1aa90a..f90f5bdf4 100644 --- a/src/platform/DARWIN/AFSPreference/PListManager.m +++ b/src/platform/DARWIN/AFSPreference/PListManager.m @@ -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 @@ -110,7 +112,7 @@ } // 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]; -- 2.39.5