Subject: Re: Addition to force open to open only regular files
To: Bill Studenmund <>
From: Greg Hudson <ghudson@MIT.EDU>
List: tech-kern
Date: 11/28/2000 22:25:02
> So why not just make things easy and add a syscall to get it???

Note that the saved ID is not the original ruid.  It's a copy of the
euid as of the beginning of the program.  However, the saved ID does
let you recover by the original ruid after a possible euid/ruid swap;
whichever of the ruid and the euid does *not* match the saved ID was
the original ruid.

Of course, a setuid program may have done setuid(something other than
getuid()) and discarded all knowledge of the original uid, and then it
might do a hostname lookup.  But I don't know of any legitimate reason
to do that unless you really do want to give the user a shell as
another user (e.g. if you're "su").