2010-08-26 Stanislav Brabec <sbrabec@suse.cz>
authormrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Aug 2010 21:34:01 +0000 (21:34 +0000)
committermrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Aug 2010 21:34:01 +0000 (21:34 +0000)
        Reviewed by Martin Robinson.

        [GTK] [PATCH] plugin loading invalid symlink evaluation deadlock
        https://bugs.webkit.org/show_bug.cgi?id=44683

        Fix symlink resolution in PluginPackageGtk.

        * plugins/gtk/PluginPackageGtk.cpp:
        (WebCore::PluginPackage::load): g_file_resolve_relative_path must be called with a
        a directory, not a file.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@66138 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/plugins/gtk/PluginPackageGtk.cpp

index 28bb1a4..8239db1 100644 (file)
@@ -1,3 +1,16 @@
+2010-08-26   Stanislav Brabec  <sbrabec@suse.cz>
+
+        Reviewed by Martin Robinson.
+
+        [GTK] [PATCH] plugin loading invalid symlink evaluation deadlock
+        https://bugs.webkit.org/show_bug.cgi?id=44683
+
+        Fix symlink resolution in PluginPackageGtk.
+
+        * plugins/gtk/PluginPackageGtk.cpp:
+        (WebCore::PluginPackage::load): g_file_resolve_relative_path must be called with a
+        a directory, not a file.
+
 2010-08-26  Andy Estes  <aestes@apple.com>
 
         Reviewed by Eric Carlson.
index 97553a1..d0218fb 100644 (file)
@@ -113,9 +113,9 @@ bool PluginPackage::load()
     GOwnPtr<gchar> finalPath(g_strdup(m_path.utf8().data()));
     while (g_file_test(finalPath.get(), G_FILE_TEST_IS_SYMLINK)) {
         GOwnPtr<GFile> file(g_file_new_for_path(finalPath.get()));
+        GOwnPtr<GFile> dir(g_file_get_parent(file.get()));
         GOwnPtr<gchar> linkPath(g_file_read_link(finalPath.get(), 0));
-
-        GOwnPtr<GFile> resolvedFile(g_file_resolve_relative_path(file.get(), linkPath.get()));
+        GOwnPtr<GFile> resolvedFile(g_file_resolve_relative_path(dir.get(), linkPath.get()));
         finalPath.set(g_file_get_path(resolvedFile.get()));
     }