summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-15 21:14:31 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-15 21:14:31 +0000
commitec564041244869f31d2f681135d60a8fce3d5cb1 (patch)
tree214b0225fbaa888e2a5c1d827efc8a1898f89c29
parentdded2c661060371215ee1c9816c9394f6d39788d (diff)
downloadchromium_src-ec564041244869f31d2f681135d60a8fce3d5cb1.zip
chromium_src-ec564041244869f31d2f681135d60a8fce3d5cb1.tar.gz
chromium_src-ec564041244869f31d2f681135d60a8fce3d5cb1.tar.bz2
linux: defend against "netscape" within plugin path
Flash misbehaves if you load it from a path containing "netscape", so we try to avoid and warn the user if necessary. BUG=20758,21900 Review URL: http://codereview.chromium.org/206009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26265 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/glue/plugins/plugin_list_linux.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/webkit/glue/plugins/plugin_list_linux.cc b/webkit/glue/plugins/plugin_list_linux.cc
index bdc0bf8..4f72ab1 100644
--- a/webkit/glue/plugins/plugin_list_linux.cc
+++ b/webkit/glue/plugins/plugin_list_linux.cc
@@ -117,6 +117,22 @@ void PluginList::LoadPluginsFromDir(const FilePath& path,
if (DebugPluginLoading())
LOG(ERROR) << "Resolved " << orig_path.value() << " -> " << path.value();
+ // Flash stops working if the containing directory involves 'netscape'.
+ // No joke. So use the other path if it's better.
+ static const char kFlashPlayerFilename[] = "libflashplayer.so";
+ static const char kNetscapeInPath[] = "/netscape/";
+ if (path.BaseName().value() == kFlashPlayerFilename &&
+ path.value().find(kNetscapeInPath) != std::string::npos) {
+ if (orig_path.value().find(kNetscapeInPath) == std::string::npos) {
+ // Go back to the old path.
+ path = orig_path;
+ } else {
+ LOG(ERROR) << "Flash misbehaves when used from a directory containing "
+ << kNetscapeInPath << ", so skipping " << orig_path.value();
+ continue;
+ }
+ }
+
// Get mtime.
file_util::FileInfo info;
if (!file_util::GetFileInfo(path, &info))