Bug 1672219 - nsServerSocket fd should not be inheritable by the child process r=necko-reviewers,dragana

Differential Revision: https://phabricator.services.mozilla.com/D94263
This commit is contained in:
Valentin Gosu 2020-10-23 06:44:33 +00:00
parent 92ae4518de
commit 237dbb5237

View File

@ -184,6 +184,7 @@ void nsServerSocket::OnSocketReady(PRFileDesc* fd, int16_t outFlags) {
mCondition = NS_ERROR_UNEXPECTED;
return;
}
PR_SetFDInheritable(clientFD, false);
NetAddr clientAddr(&prClientAddr);
// Accept succeeded, create socket transport and notify consumer
@ -352,6 +353,8 @@ nsServerSocket::InitWithAddress(const PRNetAddr* aAddr, int32_t aBackLog) {
return ErrorAccordingToNSPR(PR_GetError());
}
PR_SetFDInheritable(mFD, false);
PRSocketOptionData opt;
opt.option = PR_SockOpt_Reuseaddr;