Subject: re: Addition to force open to open only regular files
To: Jarom r Dolecek <dolecek@ibis.cz>
From: matthew green <mrg@eterna.com.au>
List: tech-kern
Date: 11/13/2000 19:46:33
   matthew green wrote:
   > the problem is that the *library* has no idea what the program has done,
   > therefore can not know what uid is the right one to use for the operation
   > at hand...
   
   The "right" uid to use is real uid (one returned by getuid()), isn't it ?
   Can it get screwed somehow ? Of course, we need to restore euid
   to same value as it was before, so do:
   
   	uid_t euid_before = geteuid();
   	seteuid(getuid());
   	process $HOSTALIAS file
   	seteuid(euid_before);
   
   or can this cause problems under any scenario ? (besides beeing
   inherently thread-unsafe, of course)


this doesn't work.


you're asking that the library trust it's caller.  that will never be
the case....as much as we would like it to be.


.mrg.