Advertisement
Guest User

Untitled

a guest
Jul 17th, 2020
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.58 KB | None | 0 0
  1. diff --git a/toolkit/components/enterprisepolicies/EnterprisePolicies.js b/toolkit/components/enterprisepolicies/EnterprisePolicies.js
  2. index b4742ee123..87556bd43a 100644
  3. --- a/toolkit/components/enterprisepolicies/EnterprisePolicies.js
  4. +++ b/toolkit/components/enterprisepolicies/EnterprisePolicies.js
  5. @@ -26,6 +26,11 @@ const POLICIES_FILENAME = "policies.json";
  6.  // When true browser policy is loaded per-user from
  7.  // /run/user/$UID/appname
  8.  const PREF_PER_USER_DIR = "toolkit.policies.perUserDir";
  9. +// used to specify where to load the policies from.
  10. +// value of `1` means to use the dir `/run/user/$UID/appname`, whereas
  11. +// a value of `2` will use the profile dir, to load the `policies.json`.
  12. +// `/etc/firefox/policies/policies.json` overrides everything else.
  13. +const PREF_POLICIES_LOADFROM_DIR = "toolkit.policies.loadFrom";
  14.  // For easy testing, modify the helpers/sample.json file,
  15.  // and set PREF_ALTERNATE_PATH in firefox.js as:
  16.  // /your/repo/browser/components/enterprisepolicies/helpers/sample.json
  17. @@ -490,8 +495,11 @@ class JSONPoliciesProvider {
  18.  
  19.      try {
  20.        let perUserPath = Services.prefs.getBoolPref(PREF_PER_USER_DIR, false);
  21. -      if (perUserPath) {
  22. +      let loadFromDir = Services.prefs.getIntPref(PREF_POLICIES_LOADFROM_DIR, 0);
  23. +      if (perUserPath || loadFromDir == 1) {
  24.          configFile = Services.dirsvc.get("XREUserRunTimeDir", Ci.nsIFile);
  25. +      } else if (loadFromDir == 2) {
  26. +        configFile = Services.dirsvc.get("ProfD", Ci.nsIFile);
  27.        } else {
  28.          configFile = Services.dirsvc.get("XREAppDist", Ci.nsIFile);
  29.        }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement