| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
It is a driver for a network card. Here is the scenario:
The system starts up and during startup the Startup Item runs code to get
the driver setup. One part of this is that the Startup Item grabs the last
used information from some preference plists and sends that information down
to the driver.
Now here is my conundrum: I can't have just one set of preference plists
because one of our requirements is that each user must have their own
preferences. I can't have just one set of preference plists for all users
because of security considerations (such as file permissions), on the OS.
So I have to have each individual user have their own preferences (located
in /Users/%username%/Library/Preferences/). Because of this when the
Startup Item runs it has to get the preferences into the driver sometime
during or right after login so the user can start the internet or access the
network. When the Startup Item calls NSUserName() (which according to the
documentation and I quote: "Returns the logon name of the current user."),
returns root (the owner of the process), not the logon name of the current
user. When I run NSHomeDirectory it gives me the roots home directory, this
doesn't help me because I need the current User Name to get the path for the
preferences.
Note I do not need to load the preferences before login (as Eric pointed
out), I can wait until right after login, but the fact still remains when I
need to get the path for preferences like say:
/Users/johnfarmer/Library/Preferences/... I need to get the user name for
John Farmer so I can create the path to access the user's plist. I can
however get the user name from the Preference Pane, but I can't have the
user opening the Preference Pane everytime they login just to startup the
network.
Long story short: I need to get a user name during or after the login
process so that I can get the user name of the currently logged in user so I
can load the preferences of the logged in user to access the network.
| References: | |
| >Re: Getting the User/Owner of another process (From: "John Farmer" <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.