View Single Post

   
  #7 (permalink)  
Old 01-16-2008, 08:02 PM
Vishwas Pai
 
Posts: n/a
Default Re: original user id

iam.techy@gmail.com wrote:
> Actually real uid is not what I wanted.. I wanted the original
> user id. For example If I logged in as user "X", and then did a 'su' to
> 'Y', so now i am as user Y, and all my basic credentials are of 'Y'. If
> I open a file using vi, the uid of this vi process is 'Y', but if you
> look at it, its session leader is the base shell from where Y got
> su'ed. so if I get get session leader through p_sid, I can get 'X'
> (through some small juggelary).. So my basic requirement is met.
> Now I want the same even if any process in Y does setsid() and changes
> itself to session leader.. How do I get 'X' for it now ?
> Same in the case of daemon, they arent associated with any session, so
> how do I know who started this daemon..
> I hope I confused u more ..


Thanks for explaining, but I'm not a PM expert. Hope
someone else would help you on this. But do not use
data structure traversing as a solution - as they
tend to be highly unportable/unreliable (esp. with
PM).

--vishwas.
Reply With Quote