RESOLVED FIXED 164103
PluginInfoStore::loadPluginsIfNecessary can still load plugins multiple times
https://bugs.webkit.org/show_bug.cgi?id=164103
Summary PluginInfoStore::loadPluginsIfNecessary can still load plugins multiple times
Michael Catanzaro
Reported 2016-10-27 19:08:31 PDT
PluginInfoStore::loadPluginsIfNecessary is trying hard to make sure plugin paths are unique, but it's possible for two unique paths to refer to the same directory. For instance, on Arch, /usr/lib64 is a symlink to /usr/lib. So all plugins that we find when scanning /usr/lib64/mozilla/plugins/ get found again when scanning /usr/lib/mozilla/plugins/ because it's the same directory.
Attachments
Patch (3.28 KB, patch)
2016-10-31 09:39 PDT, Carlos Garcia Campos
mcatanzaro: review+
cgarcia: commit-queue-
Updated patch using realpath (2.66 KB, patch)
2016-11-01 04:47 PDT, Carlos Garcia Campos
no flags
Fix EFL build (2.82 KB, patch)
2016-11-01 04:55 PDT, Carlos Garcia Campos
mcatanzaro: review+
Carlos Garcia Campos
Comment 1 2016-10-31 07:20:44 PDT
I guess we could follow symlinks when adding paths to uniquePluginPaths
Carlos Garcia Campos
Comment 2 2016-10-31 07:33:24 PDT
Looking at about:plugins in firefox, it seems they follow symlinks, because the plugin path they show is always the symlink destination.
Carlos Garcia Campos
Comment 3 2016-10-31 09:39:03 PDT
WebKit Commit Bot
Comment 4 2016-10-31 09:41:13 PDT
This patch modifies one of the wasm.json files. Please ensure that any changes in one have been mirrored to the other. You can find the wasm.json files at "Source/JavaScriptCore/wasm/wasm.json" and "JSTests/wasm/wasm.json".
Michael Catanzaro
Comment 5 2016-10-31 10:42:28 PDT
Comment on attachment 293429 [details] Patch Wow, the readlink API is terrible.
Michael Catanzaro
Comment 6 2016-10-31 10:44:22 PDT
Don't break EFL, looks like a missing #include: ../../Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp: In function 'WTF::String WebKit::followSymlink(const WTF::String&)': ../../Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:69:50: error: 'filenameToString' was not declared in this scope return filenameToString(buffer.data()); ^ Also a question: this works not only when the last component of the pathname is not a symlink, but also when an intermediate component is a symlink, right? Since that's the case we're trying to fix.
Carlos Garcia Campos
Comment 7 2016-11-01 04:34:15 PDT
Comment on attachment 293429 [details] Patch Good point, we readlink only works if the given path is a link, we need realpath instead.
Carlos Garcia Campos
Comment 8 2016-11-01 04:47:08 PDT
Created attachment 293548 [details] Updated patch using realpath The patch is indeed simpler now :-)
Carlos Garcia Campos
Comment 9 2016-11-01 04:55:07 PDT
Created attachment 293549 [details] Fix EFL build filenameToString is GTK+ specific.
Michael Catanzaro
Comment 10 2016-11-01 05:17:54 PDT
Comment on attachment 293549 [details] Fix EFL build View in context: https://bugs.webkit.org/attachment.cgi?id=293549&action=review Bonus points if you tested this manually. > Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:64 > + String pluginPath = String::fromUTF8(normalizedPath); Looking at the comment above the definition of filenameToString, I think it'd be better to copy that function into FileSystemEfl and use it here unconditionally.
Carlos Garcia Campos
Comment 11 2016-11-02 02:47:41 PDT
(In reply to comment #10) > Comment on attachment 293549 [details] > Fix EFL build > > View in context: > https://bugs.webkit.org/attachment.cgi?id=293549&action=review > > Bonus points if you tested this manually. > > > Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:64 > > + String pluginPath = String::fromUTF8(normalizedPath); > > Looking at the comment above the definition of filenameToString, I think > it'd be better to copy that function into FileSystemEfl and use it here > unconditionally. We already have that :-P stringFromFileSystemRepresentation()
Carlos Garcia Campos
Comment 12 2016-11-02 02:52:02 PDT
Note You need to log in before you can comment on or make changes to this bug.