Title: [232169] trunk/Source/WebKit
Revision
232169
Author
[email protected]
Date
2018-05-24 16:42:15 -0700 (Thu, 24 May 2018)

Log Message

Update plugin search path to look for user installed plugins
https://bugs.webkit.org/show_bug.cgi?id=185960

Reviewed by Brent Fulgham.

Now that UIProcess may be sandboxed, the home directory is no longer the user home directory.
Update the path to still look for plugins in the user home directory.

* UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
(WebKit::PluginInfoStore::pluginsDirectories):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (232168 => 232169)


--- trunk/Source/WebKit/ChangeLog	2018-05-24 23:42:02 UTC (rev 232168)
+++ trunk/Source/WebKit/ChangeLog	2018-05-24 23:42:15 UTC (rev 232169)
@@ -1,3 +1,16 @@
+2018-05-24  Youenn Fablet  <[email protected]>
+
+        Update plugin search path to look for user installed plugins
+        https://bugs.webkit.org/show_bug.cgi?id=185960
+
+        Reviewed by Brent Fulgham.
+
+        Now that UIProcess may be sandboxed, the home directory is no longer the user home directory.
+        Update the path to still look for plugins in the user home directory.
+
+        * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
+        (WebKit::PluginInfoStore::pluginsDirectories):
+
 2018-05-24  Jiewen Tan  <[email protected]>
 
         Adopt SecKeyProxy SPI in certificate based challenge response code

Modified: trunk/Source/WebKit/UIProcess/Plugins/mac/PluginInfoStoreMac.mm (232168 => 232169)


--- trunk/Source/WebKit/UIProcess/Plugins/mac/PluginInfoStoreMac.mm	2018-05-24 23:42:02 UTC (rev 232168)
+++ trunk/Source/WebKit/UIProcess/Plugins/mac/PluginInfoStoreMac.mm	2018-05-24 23:42:15 UTC (rev 232169)
@@ -32,6 +32,7 @@
 #import "NetscapePluginModule.h"
 #import "SandboxUtilities.h"
 #import <WebCore/PluginBlacklist.h>
+#import <pwd.h>
 #import <wtf/HashSet.h>
 #import <wtf/RetainPtr.h>
 #import <wtf/text/CString.h>
@@ -43,9 +44,13 @@
 Vector<String> PluginInfoStore::pluginsDirectories()
 {
     Vector<String> pluginsDirectories;
+    pluginsDirectories.reserveInitialCapacity(2);
 
-    pluginsDirectories.append([NSHomeDirectory() stringByAppendingPathComponent:@"Library/Internet Plug-Ins"]);
-    pluginsDirectories.append("/Library/Internet Plug-Ins");
+    ASCIILiteral pluginPath { "/Library/Internet Plug-Ins" };
+
+    if (auto* pw = getpwuid(getuid()))
+        pluginsDirectories.uncheckedAppend(makeString(pw->pw_dir, pluginPath));
+    pluginsDirectories.uncheckedAppend(pluginPath);
     
     return pluginsDirectories;
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to