public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: Jeffrey Walton <noloader@gmail.com>
To: libc-help <libc-help@sourceware.org>
Subject: Re: definitions of uid and euid
Date: Tue, 2 Feb 2021 20:49:05 -0500	[thread overview]
Message-ID: <CAH8yC8=5hAqxk55TOo0M8_vp0viR0uVd6_YevfZWejDc1EWeoQ@mail.gmail.com> (raw)
In-Reply-To: <CABrM6wkBrkz1DiyBWAqK=Nqj8e3=bs=NurR-eK7RF4Y6Ob_idA@mail.gmail.com>

On Tue, Feb 2, 2021 at 12:22 PM Peng Yu via Libc-help
<libc-help@sourceware.org> wrote:
>
> `man getuid` says the following without explaining what real user ID
> and effective user ID are.
>
> - getuid() returns the real user ID of the calling process.
> - geteuid() returns the effective user ID of the calling process.
>
> Could anybody explain the definitions of uid and euid, and provide a
> minimum working example demonstrating when they are different? Thanks.

Also see Chen, Wagner and Dean's
https://www.usenix.org/conference/11th-usenix-security-symposium/setuid-demystified:

   Access control in Unix systems is mainly based on
   user IDs, yet the system calls that modify user IDs
   (uid-setting system calls), such as setuid, are poorly
   designed, insufficiently documented, and widely
   misunderstood and misused. This has caused many
   security vulnerabilities in application programs.
   ...

Jeff

  parent reply	other threads:[~2021-02-03  1:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-02 17:04 Peng Yu
2021-02-02 17:54 ` Paul Smith
2021-02-03  1:49 ` Jeffrey Walton [this message]
2021-02-03  3:24   ` Peng Yu

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='CAH8yC8=5hAqxk55TOo0M8_vp0viR0uVd6_YevfZWejDc1EWeoQ@mail.gmail.com' \
    --to=noloader@gmail.com \
    --cc=libc-help@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).