fixup security check to work on OSX

This commit is contained in:
darin%netscape.com 2002-11-06 23:14:10 +00:00
Родитель af6fc51fe9
Коммит e94321a746
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -92,7 +92,12 @@ ipcIOLayerConnect(PRFileDesc* fd, const PRNetAddr* a, PRIntervalTime timeout)
return PR_FAILURE;
}
if (st.st_uid != getuid() && st.st_uid != geteuid()) {
//
// on some systems (OSX), fstat returns an UID of 0. this does not
// mean that the socket was created by root, but even if it were that
// would not be a security violation. root must be trusted anyways.
//
if (st.st_uid != 0 && st.st_uid != getuid() && st.st_uid != geteuid()) {
NS_ERROR("userid check failed");
return PR_FAILURE;
}