* definitions of uid and euid
@ 2021-02-02 17:04 Peng Yu
2021-02-02 17:54 ` Paul Smith
2021-02-03 1:49 ` Jeffrey Walton
0 siblings, 2 replies; 4+ messages in thread
From: Peng Yu @ 2021-02-02 17:04 UTC (permalink / raw)
To: libc-help
Hi,
`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.
--
Regards,
Peng
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: definitions of uid and euid
2021-02-02 17:04 definitions of uid and euid Peng Yu
@ 2021-02-02 17:54 ` Paul Smith
2021-02-03 1:49 ` Jeffrey Walton
1 sibling, 0 replies; 4+ messages in thread
From: Paul Smith @ 2021-02-02 17:54 UTC (permalink / raw)
To: Peng Yu, libc-help
On Tue, 2021-02-02 at 11:04 -0600, Peng Yu via Libc-help wrote:
> Could anybody explain the definitions of uid and euid, and provide a
> minimum working example demonstrating when they are different?
Google is helpful here I think; this is a UNIX/POSIX operating system
thing not a libc thing.
For example this answer from the first hit I got seems informative and
pretty accurate
https://stackoverflow.com/a/32456814/939557
and other answers to that question go into more details.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: definitions of uid and euid
2021-02-02 17:04 definitions of uid and euid Peng Yu
2021-02-02 17:54 ` Paul Smith
@ 2021-02-03 1:49 ` Jeffrey Walton
2021-02-03 3:24 ` Peng Yu
1 sibling, 1 reply; 4+ messages in thread
From: Jeffrey Walton @ 2021-02-03 1:49 UTC (permalink / raw)
To: libc-help
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: definitions of uid and euid
2021-02-03 1:49 ` Jeffrey Walton
@ 2021-02-03 3:24 ` Peng Yu
0 siblings, 0 replies; 4+ messages in thread
From: Peng Yu @ 2021-02-03 3:24 UTC (permalink / raw)
To: noloader; +Cc: libc-help
This document is pretty old. Is it still the most relevant document
nowadays. Given the shortcoming mentioned in the document. Nothing
has been changed to accommodate the shortcomings since then?
On 2/2/21, Jeffrey Walton via Libc-help <libc-help@sourceware.org> wrote:
> 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
>
--
Regards,
Peng
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-02-03 3:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-02 17:04 definitions of uid and euid Peng Yu
2021-02-02 17:54 ` Paul Smith
2021-02-03 1:49 ` Jeffrey Walton
2021-02-03 3:24 ` Peng Yu
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).