Title: [208273] trunk/Source/WebKit2
Revision
208273
Author
carlo...@webkit.org
Date
2016-11-02 02:48:56 -0700 (Wed, 02 Nov 2016)

Log Message

PluginInfoStore::loadPluginsIfNecessary can still load plugins multiple times
https://bugs.webkit.org/show_bug.cgi?id=164103

Reviewed by Michael Catanzaro.

Follow symlinks when scanning plugins to avoid duplicates.

* UIProcess/Plugins/gtk/PluginInfoCache.cpp: Bump the cache version to ensure duplicated plugins are removed
from the cache.
* UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
(WebKit::PluginInfoStore::pluginPathsInDirectory): Use realpath() to always return the actual file path.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (208272 => 208273)


--- trunk/Source/WebKit2/ChangeLog	2016-11-02 09:41:38 UTC (rev 208272)
+++ trunk/Source/WebKit2/ChangeLog	2016-11-02 09:48:56 UTC (rev 208273)
@@ -1,5 +1,19 @@
 2016-11-02  Carlos Garcia Campos  <cgar...@igalia.com>
 
+        PluginInfoStore::loadPluginsIfNecessary can still load plugins multiple times
+        https://bugs.webkit.org/show_bug.cgi?id=164103
+
+        Reviewed by Michael Catanzaro.
+
+        Follow symlinks when scanning plugins to avoid duplicates.
+
+        * UIProcess/Plugins/gtk/PluginInfoCache.cpp: Bump the cache version to ensure duplicated plugins are removed
+        from the cache.
+        * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
+        (WebKit::PluginInfoStore::pluginPathsInDirectory): Use realpath() to always return the actual file path.
+
+2016-11-02  Carlos Garcia Campos  <cgar...@igalia.com>
+
         [GTK] Plugin process crash in WebKit::NetscapePluginX11::visibilityDidChange with evince browser plugin
         https://bugs.webkit.org/show_bug.cgi?id=164204
 

Modified: trunk/Source/WebKit2/UIProcess/Plugins/gtk/PluginInfoCache.cpp (208272 => 208273)


--- trunk/Source/WebKit2/UIProcess/Plugins/gtk/PluginInfoCache.cpp	2016-11-02 09:41:38 UTC (rev 208272)
+++ trunk/Source/WebKit2/UIProcess/Plugins/gtk/PluginInfoCache.cpp	2016-11-02 09:48:56 UTC (rev 208273)
@@ -35,7 +35,7 @@
 
 namespace WebKit {
 
-static const unsigned gSchemaVersion = 2;
+static const unsigned gSchemaVersion = 3;
 
 PluginInfoCache& PluginInfoCache::singleton()
 {

Modified: trunk/Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp (208272 => 208273)


--- trunk/Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp	2016-11-02 09:41:38 UTC (rev 208272)
+++ trunk/Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp	2016-11-02 09:48:56 UTC (rev 208273)
@@ -35,6 +35,8 @@
 #include "PluginSearchPath.h"
 #include "ProcessExecutablePath.h"
 #include <WebCore/FileSystem.h>
+#include <limits.h>
+#include <stdlib.h>
 
 #if PLATFORM(GTK)
 #include "PluginInfoCache.h"
@@ -52,11 +54,11 @@
 Vector<String> PluginInfoStore::pluginPathsInDirectory(const String& directory)
 {
     Vector<String> result;
-    Vector<String> pluginPaths = listDirectory(directory, String("*.so"));
-    Vector<String>::const_iterator end = pluginPaths.end();
-    for (Vector<String>::const_iterator it = pluginPaths.begin(); it != end; ++it) {
-        if (fileExists(*it))
-            result.append(*it);
+    char normalizedPath[PATH_MAX];
+    for (const auto& path : listDirectory(directory, String("*.so"))) {
+        CString filename = fileSystemRepresentation(path);
+        if (realpath(filename.data(), normalizedPath))
+            result.append(stringFromFileSystemRepresentation(normalizedPath));
     }
 
     return result;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to