Re: NSUsersDefault and users
Re: NSUsersDefault and users
- Subject: Re: NSUsersDefault and users
- From: Chris Parker <email@hidden>
- Date: Tue, 6 Nov 2001 08:56:40 -0800
This is actually a known problem with NSUserDefaults in that it doesn't
pick up the effective user id. You may work around this with the
underlying CFPreferences calls, as they do.
.chris
On Monday, November 5, 2001, at 04:30 PM, Julien Jalon wrote:
I was trying something with my application (DNSUpdate) and found a
problem with the user identification by the FoundationKit while playing
with User defaults... I think the problem is also the cause of some
other problems I have.
Let me explain:
DNSUpdate launch a daemon as root (using the SecurityFramework).
the daemon register and use some defaults but... the defaults plist
file is stored in the user preferences folder (the one who launched
DNSUpdate).
Since the daemon is launched as root, the plist file normally has to be
stored in the root preferences folder. The daemon acts as if it was
launched by the user (Except it has root priviledges...).
My question: how to be sure the daemon acts as if it was launched at
boot time and so acts as a program launched by root? (e.g.
[NSUserDefaults standardUserDefaults] points to the defaults file in
the root preferences folder!)
(I know that I can use the -initWithUser: method of NSUserDefaults as a
workaround but I don't want that... I want my tool to behave as
expected).
--Julien Jalon
PS: As a side question, how to make [NSUserDefaults
standardUserDefaults] point to /Library/Preferences instead of
~root/Library/Preferences?
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev