Re: NKE and Kauth credentials... (Re: kauth_getuid returns 0?)
Re: NKE and Kauth credentials... (Re: kauth_getuid returns 0?)
- Subject: Re: NKE and Kauth credentials... (Re: kauth_getuid returns 0?)
- From: Michael Smith <email@hidden>
- Date: Wed, 17 May 2006 10:48:21 -0700
On May 17, 2006, at 10:26 AM, Russ Seehafer wrote:
Let me elaborate on what I am actually trying to accomplish:
My application starts exactly once for each mac user account on a
given computer. This user space application communicates with the
nke via a control socket. In the case of fast user switching the
nke needs to associate network traffic initiated by applications
running in a specific user's account with the instance of my
application running under that user's account.
Here is the question:
How do I determine with confidence (from within the nke) the uid of
the user that owns the process that initiated the network traffic?
You need to get this from the socket. Sadly, this isn't something
you can do with the KPI as far as I know - you'll want to ask one of
the networking folks that posts/reads here on a regular basis (I
copied Vincent) about how they recommend you get a copy of the
credential that ought to be associated with the socket at creation
time. This is what you should use to obtain the user ID.
Note, however, that user ID is not the same thing as login session
ID. It is perfectly legal to have more than one session owned by the
same user; perhaps you need to rethink your architecture? What are
you really trying to achieve?
The credential contains other information that can be used to
uniquely identify the session; it may be this that you need.
= Mike
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden