Provide system wide config dir (mozbz#1170092), Allow lock preferences from .js files (mozbz#440908)

This commit is contained in:
Martin Stransky 2016-03-21 16:45:35 +01:00
parent 4bed479594
commit b33c1cc33c
3 changed files with 27 additions and 88 deletions

View File

@ -87,7 +87,7 @@
Summary: Mozilla Firefox Web browser
Name: firefox
Version: 45.0.1
Release: 2%{?pre_tag}%{?dist}
Release: 3%{?pre_tag}%{?dist}
URL: https://www.mozilla.org/projects/firefox/
License: MPLv1.1 or GPLv2+ or LGPLv2+
Group: Applications/Internet
@ -280,7 +280,7 @@ cd %{tarballdir}
%patch301 -p1 -b .1205199
%patch302 -p1 -b .1228540
%patch303 -p1 -b .1228540-1
#%patch224 -p1 -b .1170092
%patch224 -p1 -b .1170092
%if 0%{?fedora} > 23
%patch304 -p2 -b .1253216
@ -289,7 +289,7 @@ cd %{tarballdir}
# Debian extension patch
%patch400 -p1 -b .debian-addon
#%patch401 -p1 -b .js-pref-lock
%patch401 -p1 -b .js-pref-lock
%patch500 -p1
@ -794,6 +794,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
#---------------------------------------------------------------------
%changelog
* Mon Mar 21 2016 Martin Stransky <stransky@redhat.com> - 45.0.1-3
- Provide system wide config dir (mozbz#1170092)
- Allow lock preferences from .js files (mozbz#440908)
* Mon Mar 21 2016 Martin Stransky <stransky@redhat.com> - 45.0.1-2
- Fixed rhbz#1293874 - use a Debian patch for disabled extension
signing

View File

@ -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"