Title: [233497] trunk/Source/WebKit
Revision
233497
Author
[email protected]
Date
2018-07-03 20:32:06 -0700 (Tue, 03 Jul 2018)

Log Message

Remove quarantine for Webex plugin
https://bugs.webkit.org/show_bug.cgi?id=187050
rdar://problem/41478189

Reviewed by Brent Fulgham.

Update the Plugin Info.plist to not do quarantine of downloaded files by default.
Update PluginProcess implementation to reenable quarantine for all plug-ins except cisco webex plug-in.

* Platform/spi/mac/QuarantineSPI.h: Add qtn_proc_init.
* PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
* PluginProcess/PluginProcess.h:
* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::PluginProcess::shouldOverrideQuarantine):
* Shared/ChildProcess.h:
(WebKit::ChildProcess::shouldOverrideQuarantine):
* Shared/mac/ChildProcessMac.mm:
(WebKit::ChildProcess::initializeSandbox):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (233496 => 233497)


--- trunk/Source/WebKit/ChangeLog	2018-07-04 03:31:29 UTC (rev 233496)
+++ trunk/Source/WebKit/ChangeLog	2018-07-04 03:32:06 UTC (rev 233497)
@@ -1,5 +1,26 @@
 2018-07-03  Youenn Fablet  <[email protected]>
 
+        Remove quarantine for Webex plugin
+        https://bugs.webkit.org/show_bug.cgi?id=187050
+        rdar://problem/41478189
+
+        Reviewed by Brent Fulgham.
+
+        Update the Plugin Info.plist to not do quarantine of downloaded files by default.
+        Update PluginProcess implementation to reenable quarantine for all plug-ins except cisco webex plug-in.
+
+        * Platform/spi/mac/QuarantineSPI.h: Add qtn_proc_init.
+        * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
+        * PluginProcess/PluginProcess.h:
+        * PluginProcess/mac/PluginProcessMac.mm:
+        (WebKit::PluginProcess::shouldOverrideQuarantine):
+        * Shared/ChildProcess.h:
+        (WebKit::ChildProcess::shouldOverrideQuarantine):
+        * Shared/mac/ChildProcessMac.mm:
+        (WebKit::ChildProcess::initializeSandbox):
+
+2018-07-03  Youenn Fablet  <[email protected]>
+
         Crash in  WebKit::CacheStorage::Cache::toRecordInformation when running http/tests/cache-storage/cache-persistency.https.html
         https://bugs.webkit.org/show_bug.cgi?id=187243
 

Modified: trunk/Source/WebKit/Platform/spi/mac/QuarantineSPI.h (233496 => 233497)


--- trunk/Source/WebKit/Platform/spi/mac/QuarantineSPI.h	2018-07-04 03:31:29 UTC (rev 233496)
+++ trunk/Source/WebKit/Platform/spi/mac/QuarantineSPI.h	2018-07-04 03:32:06 UTC (rev 233497)
@@ -40,6 +40,7 @@
 #define qtn_proc_alloc _qtn_proc_alloc
 #define qtn_proc_apply_to_self _qtn_proc_apply_to_self
 #define qtn_proc_free _qtn_proc_free
+#define qtn_proc_init _qtn_proc_init
 #define qtn_proc_init_with_self _qtn_proc_init_with_self
 #define qtn_proc_set_flags _qtn_proc_set_flags
 
@@ -50,6 +51,7 @@
 WTF_EXTERN_C_BEGIN
 
 int qtn_proc_apply_to_self(qtn_proc_t);
+void qtn_proc_init(qtn_proc_t);
 int qtn_proc_init_with_self(qtn_proc_t);
 int qtn_proc_set_flags(qtn_proc_t, uint32_t flags);
 qtn_proc_t qtn_proc_alloc();

Modified: trunk/Source/WebKit/PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist (233496 => 233497)


--- trunk/Source/WebKit/PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist	2018-07-04 03:31:29 UTC (rev 233496)
+++ trunk/Source/WebKit/PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist	2018-07-04 03:32:06 UTC (rev 233497)
@@ -23,7 +23,7 @@
 	<key>CFBundleVersion</key>
 	<string>${BUNDLE_VERSION}</string>
 	<key>LSFileQuarantineEnabled</key>
-	<true/>
+	<false/>
 	<key>NSPrincipalClass</key>
 	<string>NSApplication</string>
 	<key>WebKitEntryPoint</key>

Modified: trunk/Source/WebKit/PluginProcess/PluginProcess.h (233496 => 233497)


--- trunk/Source/WebKit/PluginProcess/PluginProcess.h	2018-07-04 03:31:29 UTC (rev 233496)
+++ trunk/Source/WebKit/PluginProcess/PluginProcess.h	2018-07-04 03:32:06 UTC (rev 233497)
@@ -74,6 +74,10 @@
     PluginProcess();
     ~PluginProcess();
 
+#if PLATFORM(MAC)
+    bool shouldOverrideQuarantine() final;
+#endif
+
     // ChildProcess
     void initializeProcess(const ChildProcessInitializationParameters&) override;
     void initializeProcessName(const ChildProcessInitializationParameters&) override;

Modified: trunk/Source/WebKit/PluginProcess/mac/PluginProcessMac.mm (233496 => 233497)


--- trunk/Source/WebKit/PluginProcess/mac/PluginProcessMac.mm	2018-07-04 03:31:29 UTC (rev 233496)
+++ trunk/Source/WebKit/PluginProcess/mac/PluginProcessMac.mm	2018-07-04 03:32:06 UTC (rev 233497)
@@ -688,6 +688,10 @@
     ChildProcess::initializeSandbox(parameters, sandboxParameters);
 }
 
+bool PluginProcess::shouldOverrideQuarantine()
+{
+    return m_pluginBundleIdentifier != "com.cisco.webex.plugin.gpc64";
+}
 
 void PluginProcess::stopRunLoop()
 {

Modified: trunk/Source/WebKit/Shared/ChildProcess.h (233496 => 233497)


--- trunk/Source/WebKit/Shared/ChildProcess.h	2018-07-04 03:31:29 UTC (rev 233496)
+++ trunk/Source/WebKit/Shared/ChildProcess.h	2018-07-04 03:32:06 UTC (rev 233497)
@@ -112,6 +112,8 @@
 #endif
 
 private:
+    virtual bool shouldOverrideQuarantine() { return true; }
+
     // IPC::MessageSender
     IPC::Connection* messageSenderConnection() override;
     uint64_t messageSenderDestinationID() override;

Modified: trunk/Source/WebKit/Shared/mac/ChildProcessMac.mm (233496 => 233497)


--- trunk/Source/WebKit/Shared/mac/ChildProcessMac.mm	2018-07-04 03:31:29 UTC (rev 233496)
+++ trunk/Source/WebKit/Shared/mac/ChildProcessMac.mm	2018-07-04 03:32:06 UTC (rev 233497)
@@ -90,16 +90,18 @@
 static OSStatus enableSandboxStyleFileQuarantine()
 {
 #if !ENABLE(MINIMAL_SIMULATOR)
-    int error;
     qtn_proc_t quarantineProperties = qtn_proc_alloc();
     auto quarantinePropertiesDeleter = makeScopeExit([quarantineProperties]() {
         qtn_proc_free(quarantineProperties);
     });
 
-    if ((error = qtn_proc_init_with_self(quarantineProperties)))
-        return error;
 
-    if ((error = qtn_proc_set_flags(quarantineProperties, QTN_FLAG_SANDBOX)))
+    if (qtn_proc_init_with_self(quarantineProperties)) {
+        // See <rdar://problem/13463752>.
+        qtn_proc_init(quarantineProperties);
+    }
+
+    if (auto error = qtn_proc_set_flags(quarantineProperties, QTN_FLAG_SANDBOX))
         return error;
 
     // QTN_FLAG_SANDBOX is silently ignored if security.mac.qtn.sandbox_enforce sysctl is 0.
@@ -211,11 +213,13 @@
     }
     }
 
-    // This will override LSFileQuarantineEnabled from Info.plist unless sandbox quarantine is globally disabled.
-    OSStatus error = enableSandboxStyleFileQuarantine();
-    if (error) {
-        WTFLogAlways("%s: Couldn't enable sandbox style file quarantine: %ld\n", getprogname(), static_cast<long>(error));
-        exit(EX_NOPERM);
+    if (shouldOverrideQuarantine()) {
+        // This will override LSFileQuarantineEnabled from Info.plist unless sandbox quarantine is globally disabled.
+        OSStatus error = enableSandboxStyleFileQuarantine();
+        if (error) {
+            WTFLogAlways("%s: Couldn't enable sandbox style file quarantine: %ld\n", getprogname(), static_cast<long>(error));
+            exit(EX_NOPERM);
+        }
     }
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to