[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser/tor-browser-68.9.0esr-10.0-1] squash! Bug 32418: Allow updates to be disabled via an enterprise policy.



commit 686bbbd739c930ee49f6d4ba3909628c22340385
Author: Kathy Brade <brade@xxxxxxxxxxxxxxxxx>
Date:   Thu May 28 10:14:55 2020 -0400

    squash! Bug 32418: Allow updates to be disabled via an enterprise policy.
    
    On Linux, avoid reading policies from /etc/firefox/policies/policies.json
---
 .../components/enterprisepolicies/EnterprisePolicies.js    | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/toolkit/components/enterprisepolicies/EnterprisePolicies.js b/toolkit/components/enterprisepolicies/EnterprisePolicies.js
index 5276725703f6..afbfadffbf29 100644
--- a/toolkit/components/enterprisepolicies/EnterprisePolicies.js
+++ b/toolkit/components/enterprisepolicies/EnterprisePolicies.js
@@ -2,9 +2,9 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-// To avoid accessing the Windows Registry or macOS' file system attributes,
-// Tor Browser only supports policies.json.
-#define JSON_POLICIES_ONLY MOZ_PROXY_BYPASS_PROTECTION
+// To ensure that policies intended for Firefox or another browser will not
+// be used, Tor Browser only looks for policies in ${InstallDir}/distribution
+#define AVOID_SYSTEM_POLICIES MOZ_PROXY_BYPASS_PROTECTION
 
 const { XPCOMUtils } = ChromeUtils.import(
   "resource://gre/modules/XPCOMUtils.jsm"
@@ -15,7 +15,7 @@ const { AppConstants } = ChromeUtils.import(
 );
 
 XPCOMUtils.defineLazyModuleGetters(this, {
-#ifndef JSON_POLICIES_ONLY
+#ifndef AVOID_SYSTEM_POLICIES
   WindowsGPOParser: "resource://gre/modules/policies/WindowsGPOParser.jsm",
   macOSPoliciesParser:
     "resource://gre/modules/policies/macOSPoliciesParser.jsm",
@@ -117,7 +117,7 @@ EnterprisePoliciesManager.prototype = {
 
   _chooseProvider() {
     let provider = null;
-#ifndef JSON_POLICIES_ONLY
+#ifndef AVOID_SYSTEM_POLICIES
     if (AppConstants.platform == "win") {
       provider = new WindowsGPOPoliciesProvider();
     } else if (AppConstants.platform == "macosx") {
@@ -481,6 +481,7 @@ class JSONPoliciesProvider {
   _getConfigurationFile() {
     let configFile = null;
 
+#ifndef AVOID_SYSTEM_POLICIES
     if (AppConstants.platform == "linux") {
       let systemConfigFile = Cc["@mozilla.org/file/local;1"].createInstance(
         Ci.nsIFile
@@ -493,6 +494,7 @@ class JSONPoliciesProvider {
         return systemConfigFile;
       }
     }
+#endif
 
     try {
       configFile = Services.dirsvc.get("XREAppDist", Ci.nsIFile);
@@ -569,7 +571,7 @@ class JSONPoliciesProvider {
   }
 }
 
-#ifndef JSON_POLICIES_ONLY
+#ifndef AVOID_SYSTEM_POLICIES
 class WindowsGPOPoliciesProvider {
   constructor() {
     this._policies = null;



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits