mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 1277691 - Allow security.turn_off_all_security_so_that_viruses_can_take_over_this_computer only if MOZ_DISABLE_NONLOCAL_CONNECTIONS is set. r=mrbkap
This commit is contained in:
parent
e5744b11cf
commit
7f91a2f04a
@ -2333,7 +2333,7 @@ InitializeLegacyNetscapeObject(JSContext* aCx, JS::Handle<JSObject*> aGlobal)
|
||||
// uses enablePrivilege. If you're not doing test automation, you _must_ not
|
||||
// flip this pref, or you will be exposing all your users to security
|
||||
// vulnerabilities.
|
||||
if (!Preferences::GetBool("security.turn_off_all_security_so_that_viruses_can_take_over_this_computer")) {
|
||||
if (!xpc::IsInAutomation()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -3762,9 +3762,7 @@ bool EnableUniversalXPConnect(JSContext* cx);
|
||||
inline void
|
||||
CrashIfNotInAutomation()
|
||||
{
|
||||
const char* prefName =
|
||||
"security.turn_off_all_security_so_that_viruses_can_take_over_this_computer";
|
||||
MOZ_RELEASE_ASSERT(mozilla::Preferences::GetBool(prefName));
|
||||
MOZ_RELEASE_ASSERT(IsInAutomation());
|
||||
}
|
||||
|
||||
inline XPCWrappedNativeScope*
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "nsMathUtils.h"
|
||||
#include "nsStringBuffer.h"
|
||||
#include "mozilla/dom/BindingDeclarations.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
|
||||
class nsGlobalWindow;
|
||||
class nsIPrincipal;
|
||||
@ -582,6 +583,17 @@ GetJSRuntime();
|
||||
void AddGCCallback(xpcGCCallback cb);
|
||||
void RemoveGCCallback(xpcGCCallback cb);
|
||||
|
||||
inline bool
|
||||
IsInAutomation()
|
||||
{
|
||||
const char* prefName =
|
||||
"security.turn_off_all_security_so_that_viruses_can_take_over_this_computer";
|
||||
char *s;
|
||||
return mozilla::Preferences::GetBool(prefName) &&
|
||||
(s = getenv("MOZ_DISABLE_NONLOCAL_CONNECTIONS")) &&
|
||||
!!strncmp(s, "0", 1);
|
||||
}
|
||||
|
||||
} // namespace xpc
|
||||
|
||||
namespace mozilla {
|
||||
|
Loading…
Reference in New Issue
Block a user