NSUsersDefault and users
NSUsersDefault and users
- Subject: NSUsersDefault and users
- From: Julien Jalon <email@hidden>
- Date: Tue, 6 Nov 2001 01:30:08 +0100
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?