lkml.org 
[lkml]   [2003]   [Dec]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: task_struct and uid of a task
Date
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/

\
 
 \ /
  Last update: 2005-03-22 13:59    [W:0.027 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site