Re: Fast User Switching in Panther...
Re: Fast User Switching in Panther...
- Subject: Re: Fast User Switching in Panther...
- From: Alec Carlson <email@hidden>
- Date: Tue, 05 Aug 2003 12:26:42 -0500
Karl,
It is not a daemon - it is a Cocoa background application. It was written to
be multi-user friendly, but it depends on being able to identify and
differentiate from one user to another. Just because I need to know the ID
of the different users doesn't equate to it being single user centric. I
don't care who the users are or how many of them there are - I just need to
differentiate one from another and I need to be able to change contexts
based on who is using the Mac. I understand the multi-user issues. I don't
understand why there is no API for me to figure out who those users are...
The following works in all cases where the client is making a request:
getpwuid( getuid() )
But I need something to identify the person using the Mac without requiring
any client interaction. And if that user changes because of a fast switch,
I'd like to be notified...
Alec
on 8/5/03 11:42 AM, Karl Kuehn at email@hidden wrote:
>
If it is a daemon process providing services to all users:
>
>
Why does it start up with the user login and not with a startup item
>
(ie /Library/StartupItems)? This would give it a system user as the
>
process owner rather than an individual user. Then have another GUI
>
process that intermediates between the daemon and the user (or multiple
>
users in this case).
>
>
Why does it store preferences in the users preference location and
>
not in /Library/Preferences (at the root)? This is where daemon
>
processes should look.
>
>
I think that you are stuck thinking in a single-user-centric mode and
>
need to re-think for a multi-user environment. Maybe if you were to
>
give the list some more specifics on what you are doing, we could help
>
you re-factor your thinking on this project.
>
>
Karl Kuehn
>
email@hidden
>
>
On Tuesday, August 5, 2003, at 11:52 AM, Alec Carlson wrote:
>
>
> OK, here's a scenario:
>
>
>
> 1. The Mac is powered off
>
> 2. UserA powers the Mac up and logs into Panther
>
> 3. As part of the OS startup process, a background server application
>
> is
>
> launched. It will be run in a process owned by UserA.
>
> 4. UserB comes over and fast switches the Mac to his account. UserB
>
> starts
>
> using the Mac.
>
> 5. Sometime in the future, the background application running in
>
> UserA's
>
> context gets a timed event which causes it to want to look up
>
> something from
>
> the users Preference file. It executes the following:
>
>
>
> userPrefs = [[NSUserDefaults standardUserDefaults]
>
> persistentDomainForName:@2com.company.prefs2]
>
>
>
> The intent is to get the user defaults of the user currently using the
>
> Mac -
>
> the person interacting with the GUI since his preferences are the
>
> important
>
> ones. That would be UserB. However, since the background app is
>
> running in
>
> UserA9s context, this call returns UserA9s preferences, not UserB9s.
>
> Since
>
> UserA has 3left the building2, his prefs don9t really matter...
>
>
>
> Now, I could use the NSUserDefaults 3- (id) initWithUser2 method but
>
> that
>
> begs the question of how does the background app figure out that UserB
>
> is
>
> now in control of the Mac and not UserA ? In addition, It9s possible
>
> that
>
> the background app running in UserA9s context does not have read
>
> access to
>
> UserB9s preference files - that would be another problem (but I can get
>
> around that one...)
>
>
>
> Any suggestions for resolving this ?
>
>
>
> What I9d like to see:
>
>
>
> 1. An API for determining who the last login or fast-switch user is.
>
> 2. Or an API to get the owner name of the 3Window Manager2 process (I9m
>
> assuming there is only one Window Manager running at a time)
>
> 3. and callback registration to allow notifications of user switching
>
>
>
> Comments welcome...
>
>
>
> Alec
>
> _______________________________________________
>
> cocoa-dev mailing list | email@hidden
>
> Help/Unsubscribe/Archives:
>
> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
> Do not post admin requests to the list. They will be ignored.
>
>
-----------------------------------------------------------------------
Time is Short, and the Water Rises
-----------------------------------------------------------------------
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.