Messages in this thread | | | From | Rusty Russell <> | Subject | Re: task_struct and uid of a task | Date | Wed, 31 Dec 2003 17:15:57 +1100 |
| |
In message <5.1.1.5.2.20031231155606.03376908@brain.sedal.usyd.edu.au> you write: > Previously I thought that the uid in the struct task_struct > is going to be original user id. Now I find it is not the case always as > child inherits parent uid > > Then I used p->uid. which is not true.
It should be true for non-root users, except for setuid programs which can alter it.
> Do you know any global structure that keeps the original user id (say 500, > 501 etc)? > > Or I may have to introduce another variable in this regard.
I'm not sure what problem you are having. There are only two real ways that uids can change: setuid programs, and root calling setuid or setreuid.
Adding another variable which contained the "original, unchanged" uid doesn't really make sense, since it would always be 0, the uid of init.
A little confused, but I hope that helps, Rusty. -- Anyone who quotes me in their sig is an idiot. -- Rusty Russell. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |