trt (05/13/82)
Opening a restricted file as the SUID, then reverting to the RUID is still a security hole if the open file descriptor is available to a RUID-specifiable program (e.g. a shell escape). Steve Bellovin long ago pointed out that: fd = open(SECRETFILE, 2); if (fd < 0) could not open... ioctl(fd, FIOCLEX, NULL); is a wise way to open such files. Tom Truscott