Don't open the tz file if we're running setuid or setgid to prevent infomration

leakage.

Submitted by:	Julian Assange
This commit is contained in:
imp 1997-03-24 06:09:50 +00:00
parent 4ea8eab386
commit 52677342d6

View File

@ -305,7 +305,9 @@ register struct state * const sp;
doaccess = TRUE;
name = fullname;
}
if (doaccess && access(name, R_OK) != 0)
/* XXX Should really be issetguid(), but we don't have that */
if (doaccess &&
(getuid() != geteuid() || getgid() != getegid()) )
return -1;
if ((fid = open(name, OPEN_MODE)) == -1)
return -1;