From evanc@synapse.net Sat Dec 6 10:09:57 1997 Received: from MIT.EDU (PACIFIC-CARRIER-ANNEX.MIT.EDU [18.69.0.28]) by rt-11.MIT.EDU (8.7.5/8.7.3) with SMTP id KAA14344 for ; Sat, 6 Dec 1997 10:09:57 -0500 Received: from conductor.synapse.net 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 cello.synapse.net (199.84.54.81) by conductor.synapse.net 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() >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 >Originator: >Organization: >Release: >Environment: >Description: >How-To-Repeat: >Fix: >Audit-Trail: State-Changed-From-To: open-closed State-Changed-By: tlyu State-Changed-When: Mon Dec 8 16:58:27 1997 State-Changed-Why: appended to [503] >Unformatted: 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 changed. 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 :-) Evan