Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Allowing "Change All" after application updates



On Sep 1, 2006, at 2:52 PM, David Teare wrote:

Hi all,

I have a question about how I can update my application in such a way that when the new version runs, the user is asked if they would like to "Change All".

Currently what happens is when my application is updated, this "Change All" dialog never appears, and the poor user then needs to click "Allow Always" on every individual keychain item.

I've read the archives and saw that these files were important for this process:

		/var/db/CodeEquivalenceCandidates
		/var/db/CodeEquivalenceDatabase

My application does *NOT* appear in these. Do I need to do something special to be added?

The CodeEquivalenceCandidates file tells the (Apple) Installer to automagically establish code equivalences during (upgrade) installs. Essentially, if a (code) file gets changed during an Installer run, and it's on that list, and the Installer runs as root (after the user okayed the Admin dialog), then Installer tells the system that the old and new programs are equivalent. If that works out, you won't see a "Change All" dialog but you won't see any other dialog either. (There is currently no canonical way for third parties to get on this list, other than pestering your DTS guy I suppose. Note that *removing* the CodeEquivalenceCandidates file is equivalent to putting everything on it. But the next software update is likely to re-create the file.)


If a program asks for a keychain item that has been "okayed" for an earlier version, then the system puts up the "Change All" dialog. You don't need to be on the Candidates list for this to work. Note that the resulting equivalence only applies to the user clicking the "Change All" button (obviously).

A clue that might help is after my app is updated and access is granted to the keychain item, if I look at the "Access Control" sheet of the entry in keychain access, I see my application listed twice. One version is "unknown", and the other is the correct new version.

An "unknown" version usually means that the remembered path-to that program doesn't have the program there, any more. The version isn't actually remembered in the item's ACL; only the code hash and path are. So Keychain Access just looks where the path points and fishes out the version - or says "unknown" if it can't for some reason.

What this tells me is that OS X doesn't realize that the two apps are "equivalent". It is as if OS X thinks they are completely different applications.

The canonical logic for this goes vaguely like this: if the requesting code has the same name as valid ACL entry, but not the same code hash (which would allow access implicitly), then the system puts up the "Change All" dialog (if it can, obviously - but if it can put up the "Always Allow" dialog, it should be able to put up "Change All", too). There's not much wiggle room here; chances are that the recorded name of the App is different. Note that the name (as of Tiger) is simply the filename (or name of the bundle directory), so if you rename it, you won't get a match. (In other words, the system won't take the canonical name from the Info.plist. It takes the directory/file name.)


All of this will change, incidentally, in Leopard with the advent of Code Signing. Learn how to sign your code, and you'll never see those silly dialogs again.

Cheers
-- perry
---------------------------------------------------------------------------
Perry The Cynic email@hidden
To a blind optimist, an optimistic realist must seem like an Accursed Cynic.
---------------------------------------------------------------------------




_______________________________________________
Do not post admin requests to the list. They will be ignored.
Apple-cdsa mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/apple-cdsa/email@hidden

This email sent to email@hidden
References: 
 >Allowing "Change All" after application updates (From: David Teare <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.