Skip to content
Snippets Groups Projects
Commit 06dc97eb authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame :jack_o_lantern:
Browse files

Bug 1769030: Add a configure flag to load policies only from the local...

Bug 1769030: Add a configure flag to load policies only from the local policies.json file r=mkaply,glandium

Add a configuration flag to make Enterprise Policies mechanism only
consult a policies.json file (avoiding the Windows Registry, macOS's
file system attributes, and /etc/firefox/policies/policies.json on
other OS).

Differential Revision: https://phabricator.services.mozilla.com/D146300
parent 07424d5a
No related branches found
No related tags found
1 merge request!735Bug 42033: Rebased release onto 102.15.0esr (last 102.x release!)
......@@ -156,9 +156,12 @@ EnterprisePoliciesManager.prototype = {
_chooseProvider() {
let platformProvider = null;
if (AppConstants.platform == "win") {
if (AppConstants.platform == "win" && AppConstants.MOZ_SYSTEM_POLICIES) {
platformProvider = new WindowsGPOPoliciesProvider();
} else if (AppConstants.platform == "macosx") {
} else if (
AppConstants.platform == "macosx" &&
AppConstants.MOZ_SYSTEM_POLICIES
) {
platformProvider = new macOSPoliciesProvider();
}
let jsonProvider = new JSONPoliciesProvider();
......@@ -542,7 +545,7 @@ class JSONPoliciesProvider {
_getConfigurationFile() {
let configFile = null;
if (AppConstants.platform == "linux") {
if (AppConstants.platform == "linux" && AppConstants.MOZ_SYSTEM_POLICIES) {
let systemConfigFile = Cc["@mozilla.org/file/local;1"].createInstance(
Ci.nsIFile
);
......
......@@ -453,6 +453,13 @@ this.AppConstants = Object.freeze({
false,
#endif
MOZ_SYSTEM_POLICIES:
#ifdef MOZ_SYSTEM_POLICIES
true,
#else
false,
#endif
// Returns true for CN region build when distibution id set as 'MozillaOnline'
isChinaRepack() {
return (
......
......@@ -292,6 +292,7 @@ for var in (
"MOZ_ALLOW_ADDON_SIDELOAD",
"MOZ_BACKGROUNDTASKS",
"MOZ_SYSTEM_NSS",
"MOZ_SYSTEM_POLICIES",
"MOZ_UNSIGNED_APP_SCOPE",
"MOZ_UNSIGNED_SYSTEM_SCOPE",
"MOZ_UPDATE_AGENT",
......
......@@ -3235,3 +3235,13 @@ with only_when(compile_environment & depends(target.os)(lambda os: os != "WINNT"
set_define("HAVE_ARC4RANDOM", check_symbol("arc4random"))
set_define("HAVE_ARC4RANDOM_BUF", check_symbol("arc4random_buf"))
set_define("HAVE_MALLINFO", check_symbol("mallinfo"))
# System policies
# ==============================================================
option(
"--disable-system-policies",
help="Disable reading policies from Windows registry, macOS's file system attributes, and /etc/firefox",
)
set_config("MOZ_SYSTEM_POLICIES", True, when="--enable-system-policies")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment