2020-01-21 16:15:25 +00:00
|
|
|
diff -up thunderbird-68.1.1/extensions/pref/autoconfig/src/nsReadConfig.cpp.1170092 thunderbird-68.1.1/extensions/pref/autoconfig/src/nsReadConfig.cpp
|
|
|
|
--- thunderbird-68.1.1/extensions/pref/autoconfig/src/nsReadConfig.cpp.1170092 2019-09-24 16:36:11.000000000 +0200
|
|
|
|
+++ thunderbird-68.1.1/extensions/pref/autoconfig/src/nsReadConfig.cpp 2019-10-03 11:27:33.905512072 +0200
|
|
|
|
@@ -246,8 +246,20 @@ nsresult nsReadConfig::openAndEvaluateJS
|
2019-08-01 18:37:12 +00:00
|
|
|
if (NS_FAILED(rv)) return rv;
|
|
|
|
|
|
|
|
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);
|
|
|
|
+
|
|
|
|
+ rv = jsFile->AppendNative(NS_LITERAL_CSTRING("pref"));
|
|
|
|
+ NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
+ rv = jsFile->AppendNative(nsDependentCString(aFileName));
|
|
|
|
+ NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
+ rv = NS_NewLocalFileInputStream(getter_AddRefs(inStr), jsFile);
|
|
|
|
+ NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
+ }
|
|
|
|
} else {
|
|
|
|
nsAutoCString location("resource://gre/defaults/autoconfig/");
|
|
|
|
location += aFileName;
|
2020-01-21 16:15:25 +00:00
|
|
|
diff -up thunderbird-68.1.1/modules/libpref/Preferences.cpp.1170092 thunderbird-68.1.1/modules/libpref/Preferences.cpp
|
|
|
|
--- thunderbird-68.1.1/modules/libpref/Preferences.cpp.1170092 2019-09-24 16:36:50.000000000 +0200
|
|
|
|
+++ thunderbird-68.1.1/modules/libpref/Preferences.cpp 2019-10-03 11:27:33.906512075 +0200
|
|
|
|
@@ -4436,6 +4436,8 @@ static nsresult pref_ReadDefaultPrefs(co
|
2019-08-01 18:37:12 +00:00
|
|
|
//
|
|
|
|
// Thus, in the omni.jar case, we always load app-specific default
|
|
|
|
// preferences from omni.jar, whether or not `$app == $gre`.
|
|
|
|
+ // At very end load configuration from system config location:
|
|
|
|
+ // - /etc/firefox/pref/*.js
|
|
|
|
|
2020-01-21 16:15:25 +00:00
|
|
|
nsresult rv = NS_ERROR_FAILURE;
|
2019-08-01 18:37:12 +00:00
|
|
|
nsZipFind* findPtr;
|
2020-01-21 16:15:25 +00:00
|
|
|
diff -up thunderbird-68.1.1/toolkit/xre/nsXREDirProvider.cpp.1170092 thunderbird-68.1.1/toolkit/xre/nsXREDirProvider.cpp
|
|
|
|
--- thunderbird-68.1.1/toolkit/xre/nsXREDirProvider.cpp.1170092 2019-09-24 16:37:39.000000000 +0200
|
|
|
|
+++ thunderbird-68.1.1/toolkit/xre/nsXREDirProvider.cpp 2019-10-03 11:33:45.858681620 +0200
|
|
|
|
@@ -524,6 +524,21 @@ nsXREDirProvider::GetFile(const char* aP
|
2019-08-01 18:37:12 +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
|
|
|
|
+
|
|
|
|
if (NS_FAILED(rv) || !file) return NS_ERROR_FAILURE;
|
|
|
|
|
|
|
|
if (ensureFilePermissions) {
|
2020-01-21 16:15:25 +00:00
|
|
|
@@ -880,6 +895,16 @@ nsresult nsXREDirProvider::GetFilesInter
|
2019-08-01 18:37:12 +00:00
|
|
|
LoadDirIntoArray(mXULAppDir, kAppendPrefDir, directories);
|
|
|
|
LoadDirsIntoArray(mAppBundleDirectories, kAppendPrefDir, directories);
|
|
|
|
|
|
|
|
+ // Add /etc/<application>/pref/ directory if it exists
|
|
|
|
+ nsCOMPtr<nsIFile> systemPrefDir;
|
|
|
|
+ rv = NS_GetSpecialDirectory(NS_APP_PREFS_SYSTEM_CONFIG_DIR,
|
|
|
|
+ getter_AddRefs(systemPrefDir));
|
|
|
|
+ if (NS_SUCCEEDED(rv)) {
|
|
|
|
+ rv = systemPrefDir->AppendNative(NS_LITERAL_CSTRING("pref"));
|
|
|
|
+ if (NS_SUCCEEDED(rv))
|
|
|
|
+ directories.AppendObject(systemPrefDir);
|
|
|
|
+ }
|
|
|
|
+
|
2020-01-21 16:15:25 +00:00
|
|
|
rv = NS_NewArrayEnumerator(aResult, directories, NS_GET_IID(nsIFile));
|
2019-08-01 18:37:12 +00:00
|
|
|
} else if (!strcmp(aProperty, NS_APP_CHROME_DIR_LIST)) {
|
|
|
|
// NS_APP_CHROME_DIR_LIST is only used to get default (native) icons
|
2020-01-21 16:15:25 +00:00
|
|
|
diff -up thunderbird-68.1.1/xpcom/io/nsAppDirectoryServiceDefs.h.1170092 thunderbird-68.1.1/xpcom/io/nsAppDirectoryServiceDefs.h
|
|
|
|
--- thunderbird-68.1.1/xpcom/io/nsAppDirectoryServiceDefs.h.1170092 2019-09-24 16:37:44.000000000 +0200
|
|
|
|
+++ thunderbird-68.1.1/xpcom/io/nsAppDirectoryServiceDefs.h 2019-10-03 11:27:33.907512077 +0200
|
2019-08-01 18:37:12 +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
|
|
|
|
+#define NS_APP_PREFS_SYSTEM_CONFIG_DIR "PrefSysConf" // Directory with system-wide configuration
|
|
|
|
|
|
|
|
#define NS_APP_USER_PROFILE_50_DIR "ProfD"
|
|
|
|
#define NS_APP_USER_PROFILE_LOCAL_50_DIR "ProfLD"
|