Does su always change ruid, euid and suid to the same user id?

Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
Does su always change ruid, euid and suid to the same user id, or just some of them?
I feel all of them, because the process which is executing su is always run with superuser privileges, and in which case, setuid() sets all three kinds of user ids to the same value.
Thanks.
su setuid
add a comment |Â
up vote
1
down vote
favorite
Does su always change ruid, euid and suid to the same user id, or just some of them?
I feel all of them, because the process which is executing su is always run with superuser privileges, and in which case, setuid() sets all three kinds of user ids to the same value.
Thanks.
su setuid
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Does su always change ruid, euid and suid to the same user id, or just some of them?
I feel all of them, because the process which is executing su is always run with superuser privileges, and in which case, setuid() sets all three kinds of user ids to the same value.
Thanks.
su setuid
Does su always change ruid, euid and suid to the same user id, or just some of them?
I feel all of them, because the process which is executing su is always run with superuser privileges, and in which case, setuid() sets all three kinds of user ids to the same value.
Thanks.
su setuid
asked May 4 at 0:46
Tim
22.6k63223401
22.6k63223401
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
Yes: as you say, su runs with superuser privileges, so setuid sets all three user ids.
As explained in the rationale in the POSIX spec for setuid, this behaviour is necessary: otherwise the process started by su would be able to setuid back to the original user, which is not desirable.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
Yes: as you say, su runs with superuser privileges, so setuid sets all three user ids.
As explained in the rationale in the POSIX spec for setuid, this behaviour is necessary: otherwise the process started by su would be able to setuid back to the original user, which is not desirable.
add a comment |Â
up vote
1
down vote
Yes: as you say, su runs with superuser privileges, so setuid sets all three user ids.
As explained in the rationale in the POSIX spec for setuid, this behaviour is necessary: otherwise the process started by su would be able to setuid back to the original user, which is not desirable.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Yes: as you say, su runs with superuser privileges, so setuid sets all three user ids.
As explained in the rationale in the POSIX spec for setuid, this behaviour is necessary: otherwise the process started by su would be able to setuid back to the original user, which is not desirable.
Yes: as you say, su runs with superuser privileges, so setuid sets all three user ids.
As explained in the rationale in the POSIX spec for setuid, this behaviour is necessary: otherwise the process started by su would be able to setuid back to the original user, which is not desirable.
answered May 4 at 4:17
Stephen Kitt
140k22302363
140k22302363
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f441681%2fdoes-su-always-change-ruid-euid-and-suid-to-the-same-user-id%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password