- QtWebKit does not search correct plugin path(s) (#568860)

- QtWebKit browsers crash with flash-plugin (rh#605677,webkit#40567)
This commit is contained in:
Rex Dieter 2010-06-18 15:57:12 +00:00
parent 3675bc4f5a
commit d57753c02c
4 changed files with 81 additions and 2 deletions

View File

@ -8,3 +8,4 @@ hi32-phonon-gstreamer.png
hi48-phonon-gstreamer.png
hi64-phonon-gstreamer.png
qt-everywhere-opensource-src-4.6.2.tar.gz
qt-everywhere-opensource-src-4.6.3.tar.gz

View File

@ -0,0 +1,47 @@
diff -up qt-everywhere-opensource-src-4.7.0-beta1/src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp.gtk_init qt-everywhere-opensource-src-4.7.0-beta1/src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp
--- qt-everywhere-opensource-src-4.7.0-beta1/src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp.gtk_init 2010-05-03 19:43:20.000000000 -0500
+++ qt-everywhere-opensource-src-4.7.0-beta1/src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp 2010-06-18 10:11:20.738800727 -0500
@@ -35,6 +35,8 @@
namespace WebCore {
+typedef void gtkInitFunc(int *argc, char ***argv);
+
bool PluginPackage::fetchInfo()
{
if (!load())
@@ -110,6 +112,8 @@ bool PluginPackage::load()
NP_InitializeFuncPtr NP_Initialize;
NPError npErr;
+ gtkInitFunc* gtkInit;
+
NP_Initialize = (NP_InitializeFuncPtr)m_module->resolve("NP_Initialize");
m_NPP_Shutdown = (NPP_ShutdownProcPtr)m_module->resolve("NP_Shutdown");
@@ -127,6 +131,25 @@ bool PluginPackage::load()
m_browserFuncs.getvalue = staticPluginQuirkRequiresGtkToolKit_NPN_GetValue;
}
+ // WORKAROUND: Prevent gtk based plugin crashes such as BR# 40567 by
+ // explicitly forcing the initializing of Gtk, i.e. calling gtk_init,
+ // whenver the symbol is present in the plugin library loaded above.
+ // Note that this workaround is based on code from the NSPluginClass ctor
+ // in KDE's kdebase/apps/nsplugins/viewer/nsplugin.cpp file.
+ gtkInit = (gtkInitFunc*)m_module->resolve("gtk_init");
+ if (gtkInit) {
+ // Prevent gtk_init() from replacing the X error handlers, since the Gtk
+ // handlers abort when they receive an X error, thus killing the viewer.
+#ifdef Q_WS_X11
+ int (*old_error_handler)(Display*, XErrorEvent*) = XSetErrorHandler(0);
+ int (*old_io_error_handler)(Display*) = XSetIOErrorHandler(0);
+#endif
+ gtkInit(0, 0);
+#ifdef Q_WS_X11
+ XSetErrorHandler(old_error_handler);
+ XSetIOErrorHandler(old_io_error_handler);
+#endif
+ }
#if defined(XP_UNIX)
npErr = NP_Initialize(&m_browserFuncs, &m_pluginFuncs);
#else

View File

@ -0,0 +1,19 @@
diff -up qt-everywhere-opensource-src-4.7.0-beta1/src/3rdparty/webkit/WebCore/plugins/PluginDatabase.cpp.pluginpath qt-everywhere-opensource-src-4.7.0-beta1/src/3rdparty/webkit/WebCore/plugins/PluginDatabase.cpp
--- qt-everywhere-opensource-src-4.7.0-beta1/src/3rdparty/webkit/WebCore/plugins/PluginDatabase.cpp.pluginpath 2010-05-03 19:43:20.000000000 -0500
+++ qt-everywhere-opensource-src-4.7.0-beta1/src/3rdparty/webkit/WebCore/plugins/PluginDatabase.cpp 2010-06-18 10:02:37.004788646 -0500
@@ -345,6 +345,7 @@ Vector<String> PluginDatabase::defaultPl
paths.append("/usr/lib/firefox/plugins");
paths.append("/usr/lib64/browser-plugins");
paths.append("/usr/lib/browser-plugins");
+ paths.append("/usr/lib/mozilla/plugins-wrapped");
paths.append("/usr/lib/mozilla/plugins");
paths.append("/usr/local/netscape/plugins");
paths.append("/opt/mozilla/plugins");
@@ -355,6 +356,7 @@ Vector<String> PluginDatabase::defaultPl
paths.append("/usr/lib/netscape/plugins-libc5");
paths.append("/usr/lib/netscape/plugins-libc6");
paths.append("/usr/lib64/netscape/plugins");
+ paths.append("/usr/lib64/mozilla/plugins-wrapped");
paths.append("/usr/lib64/mozilla/plugins");
paths.append("/usr/lib/nsbrowser/plugins");
paths.append("/usr/lib64/nsbrowser/plugins");

16
qt.spec
View File

@ -13,7 +13,7 @@ Summary: Qt toolkit
Name: qt
Epoch: 1
Version: 4.6.3
Release: 3%{?dist}
Release: 4%{?dist}
# See LGPL_EXCEPTIONS.txt, LICENSE.GPL3, respectively, for exception details
License: LGPLv2 with exceptions or GPLv3 with exceptions
@ -62,8 +62,12 @@ Patch55: qt-everywhere-opensource-src-4.6.2-cups.patch
Patch56: qt-everywhere-opensource-src-4.6.2-webkit-s390x.patch
# fix type cast issue on sparc64
Patch57: qt-everywhere-opensource-src-4.6.2-webkit-sparc64.patch
# qtwebkit to search nspluginwrapper paths too
Patch58: qt-everywhere-opensource-src-4.7.0-beta1-qtwebkit_pluginpath.patch
# security patches
# upstream or security patches
# https://bugs.webkit.org/show_bug.cgi?id=40567
Patch100: qt-everywhere-opensource-src-4.7.0-beta1-qtwebkit_gtk_init.patch
Patch104: qt-everywhere-opensource-src-4.6.2-cve-2010-0051-lax-css-parsing-cross-domain-theft.patch
Patch106: qt-everywhere-opensource-src-4.6.2-cve-2010-0656.patch
Patch108: qt-everywhere-opensource-src-4.6.2-cve-2010-0648.patch
@ -435,6 +439,10 @@ Qt libraries used for drawing widgets and OpenGL items.
%patch55 -p1 -b .cups-1
%patch56 -p1 -b .typecast_s390x
%patch57 -p1 -b .typecast_sparc64
%patch58 -p1 -b .qtwebkit_pluginpath
# upstream patches
%patch100 -p1 -b .qtwebkit_gtk_init
# security fixes
%patch104 -p1 -b .cve-2010-0051-lax-css-parsing-cross-domain-theft
@ -1054,6 +1062,10 @@ fi
%changelog
* Fri Jun 18 2010 Rex Dieter <rdieter@fedoraproject.org> - 4.6.3-4
- QtWebKit does not search correct plugin path(s) (#568860)
- QtWebKit browsers crash with flash-plugin (rh#605677,webkit#40567)
* Tue Jun 15 2010 Jaroslav Reznik <jreznik@redhat.com> - 4.6.3-3
- WebKit security update:
CVE-2010-1119, CVE-2010-1400, CVE-2010-1778