From: Derrick Brashear Date: Sat, 27 Feb 2010 22:48:19 +0000 (-0500) Subject: macos prefs pane krb5 auth setup X-Git-Tag: openafs-devel-1_5_73~119 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=42d3d08b2285812ded74856c8e7d8f8253c3cab6;p=packages%2Fo%2Fopenafs.git 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 --- 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];