mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: auntvini <auntvini@sedal.usyd.edu.au>
Cc: linux-kernel@vger.kernel.org
Subject: Re: task_struct and uid of a task
Date: Wed, 31 Dec 2003 17:15:57 +1100	[thread overview]
Message-ID: <20031231061928.944B22C08B@lists.samba.org> (raw)
In-Reply-To: Your message of "Wed, 31 Dec 2003 16:13:05 +1100." <5.1.1.5.2.20031231155606.03376908@brain.sedal.usyd.edu.au>

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.

  reply	other threads:[~2003-12-31  6:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-31  5:13 auntvini
2003-12-31  6:15 ` Rusty Russell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-12-30 20:06 sena
     [not found] ` <20031231124528.GA2837@lnx-holt>
2004-01-04 14:34   ` sena
2004-01-04 15:19   ` sena

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031231061928.944B22C08B@lists.samba.org \
    --to=rusty@rustcorp.com.au \
    --cc=auntvini@sedal.usyd.edu.au \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®