Title: [154473] trunk/Source/WebKit2
Revision
154473
Author
[email protected]
Date
2013-08-22 21:39:55 -0700 (Thu, 22 Aug 2013)

Log Message

Need to disable FakeSYSVSHM when sandboxing is not enabled
https://bugs.webkit.org/show_bug.cgi?id=120182
<rdar://problem/14814461>

Patch by Simon Cooper <[email protected]> on 2013-08-22
Reviewed by Alexey Proskuryakov.

When not in a sandbox do not enable the FakeSYSVSHIM. This
allows LocalConnection to work when Flash Player is run in
"Unsafe Mode".

* PluginProcess/mac/PluginProcessShim.mm:
(WebKit::shim_disabled):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (154472 => 154473)


--- trunk/Source/WebKit2/ChangeLog	2013-08-23 03:21:03 UTC (rev 154472)
+++ trunk/Source/WebKit2/ChangeLog	2013-08-23 04:39:55 UTC (rev 154473)
@@ -1,3 +1,18 @@
+2013-08-22  Simon Cooper  <[email protected]>
+
+        Need to disable FakeSYSVSHM when sandboxing is not enabled
+        https://bugs.webkit.org/show_bug.cgi?id=120182
+        <rdar://problem/14814461>
+
+        Reviewed by Alexey Proskuryakov.
+
+        When not in a sandbox do not enable the FakeSYSVSHIM. This
+        allows LocalConnection to work when Flash Player is run in
+        "Unsafe Mode".
+
+        * PluginProcess/mac/PluginProcessShim.mm:
+        (WebKit::shim_disabled):
+
 2013-08-22  Andy Estes  <[email protected]>
 
         <https://webkit.org/b/120180> Fix issues with OTHER_LDFLAGS in various .xcconfig files

Modified: trunk/Source/WebKit2/PluginProcess/mac/PluginProcessShim.mm (154472 => 154473)


--- trunk/Source/WebKit2/PluginProcess/mac/PluginProcessShim.mm	2013-08-23 03:21:03 UTC (rev 154472)
+++ trunk/Source/WebKit2/PluginProcess/mac/PluginProcessShim.mm	2013-08-23 04:39:55 UTC (rev 154473)
@@ -37,6 +37,16 @@
 #include <sys/ipc.h>
 #include <sys/mman.h>
 
+#undef __APPLE_API_PRIVATE
+#include <sandbox.h>
+
+#ifndef _SANDBOX_PRIVATE_H_
+enum sandbox_filter_type {
+        SANDBOX_FILTER_NONE,
+};
+extern "C" int sandbox_check(pid_t pid, const char *operation, enum sandbox_filter_type type, ...);
+#endif
+
 namespace WebKit {
 
 extern "C" void WebKitPluginProcessShimInitialize(const PluginProcessShimCallbacks& callbacks);
@@ -178,8 +188,11 @@
 
         if (keyExistsAndHasValidFormat && prefValue)
             isFakeSHMDisabled = true;
+        else if (sandbox_check(getpid(), NULL, SANDBOX_FILTER_NONE) == 1)
+            isFakeSHMDisabled = false;  // Sandboxed
         else
-            isFakeSHMDisabled = false;
+            isFakeSHMDisabled = true;   // Not Sandboxed
+
     });
 
     return isFakeSHMDisabled;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to