diff options
author | Martin Stransky <stransky@redhat.com> | 2016-03-21 16:45:35 +0100 |
---|---|---|
committer | Martin Stransky <stransky@redhat.com> | 2016-03-21 16:45:35 +0100 |
commit | b33c1cc33c302432f880d3479fab358244023046 (patch) | |
tree | 8b126a0d374f28ca62b75a6181ace7accb56b086 /mozilla-1170092.patch | |
parent | WIP - more debian/upstream patches (diff) | |
download | librewolf-fedora-ff-b33c1cc33c302432f880d3479fab358244023046.tar.gz librewolf-fedora-ff-b33c1cc33c302432f880d3479fab358244023046.tar.bz2 librewolf-fedora-ff-b33c1cc33c302432f880d3479fab358244023046.zip |
Provide system wide config dir (mozbz#1170092), Allow lock preferences from .js files (mozbz#440908)
Diffstat (limited to 'mozilla-1170092.patch')
-rw-r--r-- | mozilla-1170092.patch | 105 |
1 files changed, 20 insertions, 85 deletions
diff --git a/mozilla-1170092.patch b/mozilla-1170092.patch index ed4d3ce..2b10f06 100644 --- a/mozilla-1170092.patch +++ b/mozilla-1170092.patch @@ -1,17 +1,7 @@ -# HG changeset patch -# User Jan Horak <jhorak@redhat.com> -# Parent f986e55c4e0b41c6b50bd74d287614b564d7895f -# Bug 1170092 - Read default prefs also from /etc/firefox/defaults/pref - -diff --git a/extensions/pref/autoconfig/src/nsReadConfig.cpp b/extensions/pref/autoconfig/src/nsReadConfig.cpp ---- a/extensions/pref/autoconfig/src/nsReadConfig.cpp -+++ b/extensions/pref/autoconfig/src/nsReadConfig.cpp -@@ -240,18 +240,30 @@ nsresult nsReadConfig::openAndEvaluateJS - if (NS_FAILED(rv)) - return rv; - - rv = jsFile->AppendNative(nsDependentCString(aFileName)); - if (NS_FAILED(rv)) +diff -up firefox-45.0.1/extensions/pref/autoconfig/src/nsReadConfig.cpp.1170092 firefox-45.0.1/extensions/pref/autoconfig/src/nsReadConfig.cpp +--- firefox-45.0.1/extensions/pref/autoconfig/src/nsReadConfig.cpp.1170092 2016-03-15 23:37:54.000000000 +0100 ++++ firefox-45.0.1/extensions/pref/autoconfig/src/nsReadConfig.cpp 2016-03-21 16:10:42.540417899 +0100 +@@ -245,8 +245,20 @@ nsresult nsReadConfig::openAndEvaluateJS return rv; rv = NS_NewLocalFileInputStream(getter_AddRefs(inStr), jsFile); @@ -34,20 +24,10 @@ diff --git a/extensions/pref/autoconfig/src/nsReadConfig.cpp b/extensions/pref/a } else { nsAutoCString location("resource://gre/defaults/autoconfig/"); - location += aFileName; - - nsCOMPtr<nsIURI> uri; - rv = NS_NewURI(getter_AddRefs(uri), location); - NS_ENSURE_SUCCESS(rv, rv); -diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp ---- a/modules/libpref/Preferences.cpp -+++ b/modules/libpref/Preferences.cpp -@@ -1228,16 +1228,18 @@ static nsresult pref_InitInitialObjects( - // - jar:$app/omni.jar!/defaults/preferences/*.js - // - $app/defaults/preferences/*.js - // and in non omni.jar case: - // - $app/defaults/preferences/*.js - // When $app == $gre, we additionally load, in omni.jar case: +diff -up firefox-45.0.1/modules/libpref/Preferences.cpp.1170092 firefox-45.0.1/modules/libpref/Preferences.cpp +--- firefox-45.0.1/modules/libpref/Preferences.cpp.1170092 2016-03-21 16:10:42.540417899 +0100 ++++ firefox-45.0.1/modules/libpref/Preferences.cpp 2016-03-21 16:13:29.145888710 +0100 +@@ -1214,6 +1214,8 @@ static nsresult pref_InitInitialObjects( // - jar:$gre/omni.jar!/defaults/preferences/*.js // Thus, in omni.jar case, we always load app-specific default preferences // from omni.jar, whether or not $app == $gre. @@ -56,38 +36,18 @@ diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp nsZipFind *findPtr; nsAutoPtr<nsZipFind> find; - nsTArray<nsCString> prefEntries; - const char *entryName; - uint16_t entryNameLen; - - nsRefPtr<nsZipArchive> jarReader = mozilla::Omnijar::GetReader(mozilla::Omnijar::GRE); -diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp ---- a/toolkit/xre/nsXREDirProvider.cpp -+++ b/toolkit/xre/nsXREDirProvider.cpp -@@ -47,16 +47,17 @@ - #ifdef XP_MACOSX - #include "nsILocalFileMac.h" - // for chflags() - #include <sys/stat.h> - #include <unistd.h> +diff -up firefox-45.0.1/toolkit/xre/nsXREDirProvider.cpp.1170092 firefox-45.0.1/toolkit/xre/nsXREDirProvider.cpp +--- firefox-45.0.1/toolkit/xre/nsXREDirProvider.cpp.1170092 2016-03-15 23:37:46.000000000 +0100 ++++ firefox-45.0.1/toolkit/xre/nsXREDirProvider.cpp 2016-03-21 16:12:06.498655156 +0100 +@@ -51,6 +51,7 @@ #endif #ifdef XP_UNIX #include <ctype.h> +#include "nsIXULAppInfo.h" #endif - - #if defined(XP_MACOSX) - #define APP_REGISTRY_NAME "Application Registry" - #elif defined(XP_WIN) - #define APP_REGISTRY_NAME "registry.dat" - #else - #define APP_REGISTRY_NAME "appreg" -@@ -438,16 +439,30 @@ nsXREDirProvider::GetFile(const char* aP - rv = tmp; - } - tmp = EnsureDirectoryExists(file); - if (NS_FAILED(tmp)) { - rv = tmp; + #ifdef XP_IOS + #include "UIKitDirProvider.h" +@@ -457,6 +458,20 @@ nsXREDirProvider::GetFile(const char* aP } } } @@ -108,17 +68,7 @@ diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp if (NS_FAILED(rv) || !file) return NS_ERROR_FAILURE; - if (ensureFilePermissions) { - bool fileToEnsureExists; - bool isWritable; - if (NS_SUCCEEDED(file->Exists(&fileToEnsureExists)) && fileToEnsureExists - && NS_SUCCEEDED(file->IsWritable(&isWritable)) && !isWritable) { -@@ -713,16 +728,24 @@ nsXREDirProvider::GetFilesInternal(const - rv = NS_NewArrayEnumerator(aResult, directories); - } - else if (!strcmp(aProperty, NS_APP_PREFS_DEFAULTS_DIR_LIST)) { - nsCOMArray<nsIFile> directories; - +@@ -753,6 +768,14 @@ nsXREDirProvider::GetFilesInternal(const LoadDirIntoArray(mXULAppDir, kAppendPrefDir, directories); LoadDirsIntoArray(mAppBundleDirectories, kAppendPrefDir, directories); @@ -133,20 +83,10 @@ diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp rv = NS_NewArrayEnumerator(aResult, directories); } - else if (!strcmp(aProperty, NS_EXT_PREFS_DEFAULTS_DIR_LIST)) { - nsCOMArray<nsIFile> directories; - - LoadDirsIntoArray(mExtensionDirectories, - kAppendPrefDir, directories); -diff --git a/xpcom/io/nsAppDirectoryServiceDefs.h b/xpcom/io/nsAppDirectoryServiceDefs.h ---- a/xpcom/io/nsAppDirectoryServiceDefs.h -+++ b/xpcom/io/nsAppDirectoryServiceDefs.h -@@ -61,16 +61,17 @@ - - #define NS_SHARED "SHARED" - - #define NS_APP_PREFS_50_DIR "PrefD" // Directory which contains user prefs - #define NS_APP_PREFS_50_FILE "PrefF" +diff -up firefox-45.0.1/xpcom/io/nsAppDirectoryServiceDefs.h.1170092 firefox-45.0.1/xpcom/io/nsAppDirectoryServiceDefs.h +--- firefox-45.0.1/xpcom/io/nsAppDirectoryServiceDefs.h.1170092 2016-03-15 23:37:47.000000000 +0100 ++++ firefox-45.0.1/xpcom/io/nsAppDirectoryServiceDefs.h 2016-03-21 16:10:42.541417902 +0100 +@@ -67,6 +67,7 @@ #define NS_APP_PREFS_DEFAULTS_DIR_LIST "PrefDL" #define NS_EXT_PREFS_DEFAULTS_DIR_LIST "ExtPrefDL" #define NS_APP_PREFS_OVERRIDE_DIR "PrefDOverride" // Directory for per-profile defaults @@ -154,8 +94,3 @@ diff --git a/xpcom/io/nsAppDirectoryServiceDefs.h b/xpcom/io/nsAppDirectoryServi #define NS_APP_USER_PROFILE_50_DIR "ProfD" #define NS_APP_USER_PROFILE_LOCAL_50_DIR "ProfLD" - - #define NS_APP_USER_CHROME_DIR "UChrm" - #define NS_APP_USER_SEARCH_DIR "UsrSrchPlugns" - - #define NS_APP_LOCALSTORE_50_FILE "LclSt" |