• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Writing global preferences file into /Library/Preferences (OS X Lion)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Writing global preferences file into /Library/Preferences (OS X Lion)


  • Subject: Re: Writing global preferences file into /Library/Preferences (OS X Lion)
  • From: Peter C <email@hidden>
  • Date: Thu, 21 Jul 2011 11:02:06 +0800

I have think of authorization code but it seems now Apple does not want others to write into this directory. Better to change code to adapt to new settings.

Peter C


On 21 Jul 2011, at 10:30 AM, Stephen J. Butler wrote:

> On Wed, Jul 20, 2011 at 8:31 PM, Peter C <email@hidden> wrote:
>> Some of the programs I wrote save a preference file into /Library/Preferences via NSDictionary. This serves as a general settings for all users. Many other 3rd party software (Skype, Microsoft and etc) saves preferences file into this directory too. This works from 10.0 to 10.6.
>
> It was a bad design decision to assume you could ever write to this
> directory. What if your user isn't running as admin?
>
> The way to solve this issue is to use the BetterAuthorizationSample library:
>
> http://developer.apple.com/library/mac/#samplecode/BetterAuthorizationSample/Introduction/Intro.html#//apple_ref/doc/uid/DTS10004207-Intro-DontLinkElementID_2
>
> Basically, you write a helper tool that runs as root, and comunicate
> with it what settings get what values. Then the helper tool, as root,
> saves the plist.
>
> Read and understand all the included txt files before you just dive
> into the code!

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Writing global preferences file into /Library/Preferences (OS X Lion)
      • From: vincent habchi <email@hidden>
References: 
 >Writing global preferences file into /Library/Preferences (OS X Lion) (From: Peter C <email@hidden>)
 >Re: Writing global preferences file into /Library/Preferences (OS X Lion) (From: "Stephen J. Butler" <email@hidden>)

  • Prev by Date: Re: Writing global preferences file into /Library/Preferences (OS X Lion)
  • Next by Date: Re: Writing global preferences file into /Library/Preferences (OS X Lion)
  • Previous by thread: Re: Writing global preferences file into /Library/Preferences (OS X Lion)
  • Next by thread: Re: Writing global preferences file into /Library/Preferences (OS X Lion)
  • Index(es):
    • Date
    • Thread