• 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: "Stephen J. Butler" <email@hidden>
  • Date: Wed, 20 Jul 2011 21:30:31 -0500

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: Peter C <email@hidden>
References: 
 >Writing global preferences file into /Library/Preferences (OS X Lion) (From: Peter C <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