Skip Menu |

Download (untitled) / with headers
text/plain 2.1KiB
From Sat Dec 6 10:09:57 1997
Received: from MIT.EDU (PACIFIC-CARRIER-ANNEX.MIT.EDU []) by rt-11.MIT.EDU (8.7.5/8.7.3) with SMTP id KAA14344 for <bugs@RT-11.MIT.EDU>; Sat, 6 Dec 1997 10:09:57 -0500
Received: from by MIT.EDU with SMTP
id AA02954; Sat, 6 Dec 97 10:09:59 EST
Received: (qmail 10038 invoked from network); 6 Dec 1997 15:09:52 -0000
Received: from (
by with SMTP; 6 Dec 1997 15:09:52 -0000
Message-Id: <>
Date: Sat, 6 Dec 1997 10:09:51 -0500 (EST)
From: Evan Champion <>
To: krb5-bugs@MIT.EDU
Subject: More on the BSD/OS setreuid()

Show quoted text
>Number: 511
>Category: pending
>Synopsis: More on the BSD/OS setreuid()
>Confidential: yes
>Severity: serious
>Priority: medium
>Responsible: gnats-admin
>State: closed
>Class: sw-bug
>Submitter-Id: unknown
>Arrival-Date: Sat Dec 06 10:10:01 EST 1997
>Last-Modified: Mon Dec 08 16:58:42 EST 1997

State-Changed-From-To: open-closed
State-Changed-By: tlyu
State-Changed-When: Mon Dec 8 16:58:27 1997
appended to [503]

Show quoted text
As an FYI, I was digging through the BSD/OS kernel source to find out what
setreuid() _really_ does, and found this...

* Partially emulate old setreuid usage of exchanging ruid and euid.
* We assume that the intent of setting ruid is to be able to get
* back setuid privilege. So we make sure that we will be able to
* do so, but do not actually set the ruid.

setreuid() is actually implemented as seteuid(). The real uid is never

Now, this code is only included if you have COMPAT_43 or COMPAT_BSDI11
defined. COMPAT_43 is not defined by default, and my kernels don't have
COMPAT_BSDI11 defined.

Even more interesting, in libc's compat-43 part, setruid() is implemented
as setreuid(ruid, -1), when setreuid() never sets the real id :-)