Hello all, this is a question regarding to the permission set on
/Library/Preferences in Leopard.

I ran this code as a non-admin user: (I am strict to myself to not use
admin accounts other then installs/updates.)
        CFPreferencesSetValue(keyName, valueString, appID,
                                                  kCFPreferencesAnyUser, 
kCFPreferencesCurrentHost);
        BOOL success = CFPreferencesSynchronize(appID,
                                                                                
        kCFPreferencesAnyUser,
                                                                                
        kCFPreferencesCurrentHost);
        if (success) NSLog(@"Preferences synchronized.");

The result:
2009-09-20 02:11:16.002 aups[1945:10b] Preferences synchronized.

What I was trying to do was to save a global parameter for my app that
is only modifiable by Admin rights. However, this was just a
proof-of-concept process and have not ran any code as Admin just yet.

I did a lot of research and was confident that this would NOT write
the plist file since it requires an Admin-user for an AnyUser domain.
But it is now in the /Library/Preferences as "com.example.test.plist"
and is the case with all the non-admin account I tried on my Leopard
iMac.
So I checked the folder permission to find out it's:
drwxrwxrwx   67 root     admin  2278 Sep 20 02:35 Preferences

I ran repair permissions but that did not change anything.
Can anyone confirm this is in fact the default permission and the
CFPreferences utilities behave such?
Or is this a known bug?

Thanks.

-- 
Ken
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to