Bug 1049688 - Allow override of MOZ_DISABLE_NONLOCAL_CONNECTIONS. r=froydnj

This commit is contained in:
Nils Ohlmeier [:drno] 2014-09-22 09:48:00 -04:00
parent 49ba656c2e
commit 32a116fde1
5 changed files with 29 additions and 9 deletions

View File

@ -508,8 +508,11 @@ class Automation(object):
else:
env['MOZ_CRASHREPORTER_DISABLE'] = '1'
# Crash on non-local network connections.
env['MOZ_DISABLE_NONLOCAL_CONNECTIONS'] = '1'
# Crash on non-local network connections by default.
# MOZ_DISABLE_NONLOCAL_CONNECTIONS can be set to "0" to temporarily
# enable non-local connections for the purposes of local testing. Don't
# override the user's choice here. See bug 1049688.
env.setdefault('MOZ_DISABLE_NONLOCAL_CONNECTIONS', '1')
env['GNOME_DISABLE_CRASH_DIALOG'] = '1'
env['XRE_NO_WINDOWS_CRASH_DIALOG'] = '1'

View File

@ -432,8 +432,11 @@ def environment(xrePath, env=None, crashreporter=True, debugger=False, dmdPath=N
else:
env['MOZ_CRASHREPORTER_DISABLE'] = '1'
# Crash on non-local network connections.
env['MOZ_DISABLE_NONLOCAL_CONNECTIONS'] = '1'
# Crash on non-local network connections by default.
# MOZ_DISABLE_NONLOCAL_CONNECTIONS can be set to "0" to temporarily
# enable non-local connections for the purposes of local testing. Don't
# override the user's choice here. See bug 1049688.
env.setdefault('MOZ_DISABLE_NONLOCAL_CONNECTIONS', '1')
# Set WebRTC logging in case it is not set yet
env.setdefault('NSPR_LOG_MODULES', 'signaling:5,mtransport:5,datachannel:5')

View File

@ -74,8 +74,11 @@ class RemoteAutomation(Automation):
else:
env['MOZ_CRASHREPORTER_DISABLE'] = '1'
# Crash on non-local network connections.
env['MOZ_DISABLE_NONLOCAL_CONNECTIONS'] = '1'
# Crash on non-local network connections by default.
# MOZ_DISABLE_NONLOCAL_CONNECTIONS can be set to "0" to temporarily
# enable non-local connections for the purposes of local testing.
# Don't override the user's choice here. See bug 1049688.
env.setdefault('MOZ_DISABLE_NONLOCAL_CONNECTIONS', '1')
return env

View File

@ -1185,7 +1185,15 @@ nsSocketTransport::InitiateSocket()
{
SOCKET_LOG(("nsSocketTransport::InitiateSocket [this=%p]\n", this));
static bool crashOnNonLocalConnections = !!getenv("MOZ_DISABLE_NONLOCAL_CONNECTIONS");
static int crashOnNonLocalConnections = -1;
if (crashOnNonLocalConnections == -1) {
const char *s = getenv("MOZ_DISABLE_NONLOCAL_CONNECTIONS");
if (s) {
crashOnNonLocalConnections = !!strncmp(s, "0", 1);
} else {
crashOnNonLocalConnections = 0;
}
}
nsresult rv;
bool isLocal;

View File

@ -861,8 +861,11 @@ class XPCShellTests(object):
# Capturing backtraces is very slow on some platforms, and it's
# disabled by automation.py too
self.env["NS_TRACE_MALLOC_DISABLE_STACKS"] = "1"
# Don't permit remote connections.
self.env["MOZ_DISABLE_NONLOCAL_CONNECTIONS"] = "1"
# Don't permit remote connections by default.
# MOZ_DISABLE_NONLOCAL_CONNECTIONS can be set to "0" to temporarily
# enable non-local connections for the purposes of local testing.
# Don't override the user's choice here. See bug 1049688.
self.env.setdefault('MOZ_DISABLE_NONLOCAL_CONNECTIONS', '1')
def buildEnvironment(self):
"""