From d7b145656a098b61834019cdd78eca9dad742f41 Mon Sep 17 00:00:00 2001 From: Narcis Beleuzu Date: Thu, 24 Oct 2019 15:10:12 +0300 Subject: [PATCH] Backed out changeset 6dde6dcea46a (bug 1583466) for bustages on nsXREDirProvider.cpp . CLOSED TREE --- .../enterprisepolicies/EnterprisePolicies.js | 10 +--------- toolkit/xre/nsXREDirProvider.cpp | 11 +---------- xpcom/build/nsXULAppAPI.h | 7 ------- 3 files changed, 2 insertions(+), 26 deletions(-) diff --git a/toolkit/components/enterprisepolicies/EnterprisePolicies.js b/toolkit/components/enterprisepolicies/EnterprisePolicies.js index 9ef6fa193131..45378909622c 100644 --- a/toolkit/components/enterprisepolicies/EnterprisePolicies.js +++ b/toolkit/components/enterprisepolicies/EnterprisePolicies.js @@ -23,9 +23,6 @@ XPCOMUtils.defineLazyModuleGetters(this, { // ${InstallDir}/distribution folder. const POLICIES_FILENAME = "policies.json"; -// When true browser policy is loaded per-user from -// /run/user/$UID/appname -const PREF_PER_USER_DIR = "toolkit.policies.perUserDir"; // For easy testing, modify the helpers/sample.json file, // and set PREF_ALTERNATE_PATH in firefox.js as: // /your/repo/browser/components/enterprisepolicies/helpers/sample.json @@ -458,12 +455,7 @@ class JSONPoliciesProvider { _getConfigurationFile() { let configFile = null; try { - let perUserPath = Services.prefs.getBoolPref(PREF_PER_USER_DIR, false); - if (perUserPath) { - configFile = Services.dirsvc.get("XREUserRunTimeDir", Ci.nsIFile); - } else { - configFile = Services.dirsvc.get("XREAppDist", Ci.nsIFile); - } + configFile = Services.dirsvc.get("XREAppDist", Ci.nsIFile); configFile.append(POLICIES_FILENAME); } catch (ex) { // Getting the correct directory will fail in xpcshell tests. This should diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp index 979bd1484833..c3164f204ffd 100644 --- a/toolkit/xre/nsXREDirProvider.cpp +++ b/toolkit/xre/nsXREDirProvider.cpp @@ -45,7 +45,6 @@ #include "mozilla/Omnijar.h" #include "mozilla/Preferences.h" #include "mozilla/Telemetry.h" -#include "nsPrintfCString.h" #include @@ -104,7 +103,7 @@ nsCOMPtr gDataDirProfile = nullptr; // These are required to allow nsXREDirProvider to be usable in xpcshell tests. // where gAppData is null. -#if defined(XP_MACOSX) || defined(XP_WIN) || defined(XP_UNIX) +#if defined(XP_MACOSX) || defined(XP_WIN) static const char* GetAppName() { if (gAppData) { return gAppData->name; @@ -462,14 +461,6 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent, #endif } else if (!strcmp(aProperty, XRE_USER_SYS_EXTENSION_DEV_DIR)) { return GetSysUserExtensionsDevDirectory(aFile); - } else if (!strcmp(aProperty, XRE_USER_RUNTIME_DIR)) { -#ifdef MOZ_WIDGET_GTK - nsPrintfCString path("/run/user/%d/%s/", getuid(), GetAppName()); - ToLowerCase(path); - return NS_NewNativeLocalFile(path, false, aFile); -#else - return NS_ERROR_FAILURE; -#endif } else if (!strcmp(aProperty, XRE_APP_DISTRIBUTION_DIR)) { bool persistent = false; rv = GetFile(NS_GRE_DIR, &persistent, getter_AddRefs(file)); diff --git a/xpcom/build/nsXULAppAPI.h b/xpcom/build/nsXULAppAPI.h index e1f0fd050472..121eb992812e 100644 --- a/xpcom/build/nsXULAppAPI.h +++ b/xpcom/build/nsXULAppAPI.h @@ -141,13 +141,6 @@ */ #define XRE_ADDON_APP_DIR "XREAddonAppDir" -/** - * A directory service key which specifies the distribution specific files for - * the application unique for each user. - * It's located at /run/user/$UID// - */ -#define XRE_USER_RUNTIME_DIR "XREUserRunTimeDir" - /** * A directory service key which provides the update directory. Callers should * fall back to appDir.