2019-05-15 14:14:03 +00:00
|
|
|
diff -up firefox-67.0/extensions/pref/autoconfig/src/nsReadConfig.cpp.1170092 firefox-67.0/extensions/pref/autoconfig/src/nsReadConfig.cpp
|
|
|
|
--- firefox-67.0/extensions/pref/autoconfig/src/nsReadConfig.cpp.1170092 2019-05-14 01:08:09.000000000 +0200
|
|
|
|
+++ firefox-67.0/extensions/pref/autoconfig/src/nsReadConfig.cpp 2019-05-15 15:10:23.860653275 +0200
|
|
|
|
@@ -246,8 +246,20 @@ nsresult nsReadConfig::openAndEvaluateJS
|
2019-01-28 13:53:26 +00:00
|
|
|
if (NS_FAILED(rv)) return rv;
|
2016-03-21 13:40:15 +00:00
|
|
|
|
2019-01-28 13:53:26 +00:00
|
|
|
rv = NS_NewLocalFileInputStream(getter_AddRefs(inStr), jsFile);
|
|
|
|
- if (NS_FAILED(rv)) return rv;
|
|
|
|
+ if (NS_FAILED(rv)) {
|
|
|
|
+ // Look for cfg file in /etc/<application>/pref
|
|
|
|
+ rv = NS_GetSpecialDirectory(NS_APP_PREFS_SYSTEM_CONFIG_DIR,
|
|
|
|
+ getter_AddRefs(jsFile));
|
|
|
|
+ NS_ENSURE_SUCCESS(rv, rv);
|
2016-03-21 13:40:15 +00:00
|
|
|
+
|
2019-01-28 13:53:26 +00:00
|
|
|
+ rv = jsFile->AppendNative(NS_LITERAL_CSTRING("pref"));
|
|
|
|
+ NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
+ rv = jsFile->AppendNative(nsDependentCString(aFileName));
|
|
|
|
+ NS_ENSURE_SUCCESS(rv, rv);
|
2017-09-25 08:49:39 +00:00
|
|
|
|
2019-01-28 13:53:26 +00:00
|
|
|
+ rv = NS_NewLocalFileInputStream(getter_AddRefs(inStr), jsFile);
|
|
|
|
+ NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
+ }
|
|
|
|
} else {
|
|
|
|
nsAutoCString location("resource://gre/defaults/autoconfig/");
|
|
|
|
location += aFileName;
|
2019-05-15 14:14:03 +00:00
|
|
|
diff -up firefox-67.0/modules/libpref/Preferences.cpp.1170092 firefox-67.0/modules/libpref/Preferences.cpp
|
|
|
|
--- firefox-67.0/modules/libpref/Preferences.cpp.1170092 2019-05-15 15:10:23.860653275 +0200
|
|
|
|
+++ firefox-67.0/modules/libpref/Preferences.cpp 2019-05-15 15:11:58.160110320 +0200
|
|
|
|
@@ -4417,6 +4417,9 @@ float MOZ_MAYBE_UNUSED GetPref<float>(co
|
2018-01-23 19:25:55 +00:00
|
|
|
//
|
|
|
|
// Thus, in the omni.jar case, we always load app-specific default
|
|
|
|
// preferences from omni.jar, whether or not `$app == $gre`.
|
2019-05-15 14:14:03 +00:00
|
|
|
+ //
|
2016-03-21 13:40:15 +00:00
|
|
|
+ // At very end load configuration from system config location:
|
|
|
|
+ // - /etc/firefox/pref/*.js
|
|
|
|
|
2019-05-15 14:14:03 +00:00
|
|
|
nsresult rv = NS_ERROR_FAILURE;
|
2018-01-23 19:25:55 +00:00
|
|
|
nsZipFind* findPtr;
|
2019-05-15 14:14:03 +00:00
|
|
|
diff -up firefox-67.0/toolkit/xre/nsXREDirProvider.cpp.1170092 firefox-67.0/toolkit/xre/nsXREDirProvider.cpp
|
|
|
|
--- firefox-67.0/toolkit/xre/nsXREDirProvider.cpp.1170092 2019-05-14 01:08:35.000000000 +0200
|
|
|
|
+++ firefox-67.0/toolkit/xre/nsXREDirProvider.cpp 2019-05-15 15:10:23.861653269 +0200
|
|
|
|
@@ -60,6 +60,7 @@
|
2016-03-21 13:40:15 +00:00
|
|
|
#endif
|
|
|
|
#ifdef XP_UNIX
|
2019-03-12 11:32:07 +00:00
|
|
|
# include <ctype.h>
|
|
|
|
+# include "nsIXULAppInfo.h"
|
2016-03-21 13:40:15 +00:00
|
|
|
#endif
|
2016-03-21 15:45:35 +00:00
|
|
|
#ifdef XP_IOS
|
2019-03-12 11:32:07 +00:00
|
|
|
# include "UIKitDirProvider.h"
|
2019-05-15 14:14:03 +00:00
|
|
|
@@ -524,6 +525,21 @@ nsXREDirProvider::GetFile(const char* aP
|
2016-03-21 13:40:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-01-28 13:53:26 +00:00
|
|
|
+
|
2016-03-21 13:40:15 +00:00
|
|
|
+#if defined(XP_UNIX)
|
|
|
|
+ if (!strcmp(aProperty, NS_APP_PREFS_SYSTEM_CONFIG_DIR)) {
|
|
|
|
+ nsCString sysConfigDir = NS_LITERAL_CSTRING("/etc/");
|
|
|
|
+ nsCOMPtr<nsIXULAppInfo> appInfo = do_GetService("@mozilla.org/xre/app-info;1");
|
|
|
|
+ if (!appInfo)
|
|
|
|
+ return NS_ERROR_NOT_AVAILABLE;
|
|
|
|
+ nsCString appName;
|
|
|
|
+ appInfo->GetName(appName);
|
|
|
|
+ ToLowerCase(appName);
|
|
|
|
+ sysConfigDir.Append(appName);
|
|
|
|
+ return NS_NewNativeLocalFile(sysConfigDir, false, aFile);
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
|
|
+
|
2019-01-28 13:53:26 +00:00
|
|
|
if (NS_FAILED(rv) || !file) return NS_ERROR_FAILURE;
|
2016-03-21 13:40:15 +00:00
|
|
|
|
2019-01-28 13:53:26 +00:00
|
|
|
if (ensureFilePermissions) {
|
2019-05-15 14:14:03 +00:00
|
|
|
@@ -880,6 +896,16 @@ nsresult nsXREDirProvider::GetFilesInter
|
2019-01-28 13:53:26 +00:00
|
|
|
LoadDirIntoArray(mXULAppDir, kAppendPrefDir, directories);
|
|
|
|
LoadDirsIntoArray(mAppBundleDirectories, kAppendPrefDir, directories);
|
2018-10-18 11:43:49 +00:00
|
|
|
|
2016-03-21 13:40:15 +00:00
|
|
|
+ // Add /etc/<application>/pref/ directory if it exists
|
|
|
|
+ nsCOMPtr<nsIFile> systemPrefDir;
|
2019-01-28 13:53:26 +00:00
|
|
|
+ rv = NS_GetSpecialDirectory(NS_APP_PREFS_SYSTEM_CONFIG_DIR,
|
|
|
|
+ getter_AddRefs(systemPrefDir));
|
2016-03-21 13:40:15 +00:00
|
|
|
+ if (NS_SUCCEEDED(rv)) {
|
|
|
|
+ rv = systemPrefDir->AppendNative(NS_LITERAL_CSTRING("pref"));
|
|
|
|
+ if (NS_SUCCEEDED(rv))
|
2019-01-28 13:53:26 +00:00
|
|
|
+ directories.AppendObject(systemPrefDir);
|
2016-03-21 13:40:15 +00:00
|
|
|
+ }
|
2018-10-18 11:43:49 +00:00
|
|
|
+
|
|
|
|
rv = NS_NewArrayEnumerator(aResult, directories, NS_GET_IID(nsIFile));
|
2019-01-28 13:53:26 +00:00
|
|
|
} else if (!strcmp(aProperty, NS_APP_CHROME_DIR_LIST)) {
|
|
|
|
// NS_APP_CHROME_DIR_LIST is only used to get default (native) icons
|
2019-05-15 14:14:03 +00:00
|
|
|
diff -up firefox-67.0/xpcom/io/nsAppDirectoryServiceDefs.h.1170092 firefox-67.0/xpcom/io/nsAppDirectoryServiceDefs.h
|
|
|
|
--- firefox-67.0/xpcom/io/nsAppDirectoryServiceDefs.h.1170092 2019-05-14 01:08:28.000000000 +0200
|
|
|
|
+++ firefox-67.0/xpcom/io/nsAppDirectoryServiceDefs.h 2019-05-15 15:10:24.044652216 +0200
|
2019-01-28 13:53:26 +00:00
|
|
|
@@ -62,6 +62,7 @@
|
|
|
|
#define NS_APP_PREFS_DEFAULTS_DIR_LIST "PrefDL"
|
|
|
|
#define NS_APP_PREFS_OVERRIDE_DIR \
|
|
|
|
"PrefDOverride" // Directory for per-profile defaults
|
2016-03-21 13:40:15 +00:00
|
|
|
+#define NS_APP_PREFS_SYSTEM_CONFIG_DIR "PrefSysConf" // Directory with system-wide configuration
|
|
|
|
|
2019-01-28 13:53:26 +00:00
|
|
|
#define NS_APP_USER_PROFILE_50_DIR "ProfD"
|
|
|
|
#define NS_APP_USER_PROFILE_LOCAL_50_DIR "ProfLD"
|