Changeset 268492 in webkit


Ignore:
Timestamp:
Oct 14, 2020 3:19:18 PM (4 years ago)
Author:
pvollan@apple.com
Message:

[macOS] Issue sandbox extension to additional icon service when attachment element is enabled.
https://bugs.webkit.org/show_bug.cgi?id=217706
<rdar://problem/70291100>

Reviewed by Brent Fulgham.

Issue sandbox extension to 'com.apple.iconservices.store' when attachment element is enabled on macOS.

  • Shared/WebPageCreationParameters.cpp:

(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):

  • Shared/WebPageCreationParameters.h:
  • Shared/WebProcessCreationParameters.cpp:

(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):

  • Shared/WebProcessCreationParameters.h:
  • UIProcess/WebPageProxy.cpp:

(WebKit::attachmentElementServices):
(WebKit::WebPageProxy::creationParameters):

  • WebProcess/WebPage/WebPage.cpp:
  • WebProcess/com.apple.WebProcess.sb.in:
Location:
trunk/Source/WebKit
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r268486 r268492  
     12020-10-14  Per Arne Vollan  <pvollan@apple.com>
     2
     3        [macOS] Issue sandbox extension to additional icon service when attachment element is enabled.
     4        https://bugs.webkit.org/show_bug.cgi?id=217706
     5        <rdar://problem/70291100>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        Issue sandbox extension to 'com.apple.iconservices.store' when attachment element is enabled on macOS.
     10
     11        * Shared/WebPageCreationParameters.cpp:
     12        (WebKit::WebPageCreationParameters::encode const):
     13        (WebKit::WebPageCreationParameters::decode):
     14        * Shared/WebPageCreationParameters.h:
     15        * Shared/WebProcessCreationParameters.cpp:
     16        (WebKit::WebProcessCreationParameters::encode const):
     17        (WebKit::WebProcessCreationParameters::decode):
     18        * Shared/WebProcessCreationParameters.h:
     19        * UIProcess/WebPageProxy.cpp:
     20        (WebKit::attachmentElementServices):
     21        (WebKit::WebPageProxy::creationParameters):
     22        * WebProcess/WebPage/WebPage.cpp:
     23        * WebProcess/com.apple.WebProcess.sb.in:
     24
    1252020-10-14  Commit Queue  <commit-queue@webkit.org>
    226
  • trunk/Source/WebKit/Shared/WebPageCreationParameters.cpp

    r268270 r268492  
    9898
    9999#if ENABLE(ATTACHMENT_ELEMENT)
    100     encoder << frontboardExtensionHandle;
    101     encoder << iconServicesExtensionHandle;
     100    encoder << attachmentElementExtensionHandles;
    102101#endif
    103102
     
    329328
    330329#if ENABLE(ATTACHMENT_ELEMENT)
    331     Optional<Optional<SandboxExtension::Handle>> frontboardExtensionHandle;
    332     decoder >> frontboardExtensionHandle;
    333     if (!frontboardExtensionHandle)
    334         return WTF::nullopt;
    335     parameters.frontboardExtensionHandle = WTFMove(*frontboardExtensionHandle);
    336 
    337     Optional<Optional<SandboxExtension::Handle>> iconServicesExtensionHandle;
    338     decoder >> iconServicesExtensionHandle;
    339     if (!iconServicesExtensionHandle)
    340         return WTF::nullopt;
    341     parameters.iconServicesExtensionHandle = WTFMove(*iconServicesExtensionHandle);
     330    Optional<Optional<SandboxExtension::HandleArray>> attachmentElementExtensionHandles;
     331    decoder >> attachmentElementExtensionHandles;
     332    if (!attachmentElementExtensionHandles)
     333        return WTF::nullopt;
     334    parameters.attachmentElementExtensionHandles = WTFMove(*attachmentElementExtensionHandles);
    342335#endif
    343336
  • trunk/Source/WebKit/Shared/WebPageCreationParameters.h

    r268270 r268492  
    159159#endif
    160160#if ENABLE(ATTACHMENT_ELEMENT)
    161     Optional<SandboxExtension::Handle> frontboardExtensionHandle;
    162     Optional<SandboxExtension::Handle> iconServicesExtensionHandle;
     161    Optional<SandboxExtension::HandleArray> attachmentElementExtensionHandles;
    163162#endif
    164163#if PLATFORM(IOS_FAMILY)
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r268457 r268492  
    76557655}
    76567656
     7657#if ENABLE(ATTACHMENT_ELEMENT) && PLATFORM(COCOA)
     7658static const Vector<ASCIILiteral>& attachmentElementServices()
     7659{
     7660    static const auto services = makeNeverDestroyed(Vector<ASCIILiteral> {
     7661#if PLATFORM(IOS_FAMILY)
     7662        "com.apple.frontboard.systemappservices"_s,
     7663#endif
     7664        "com.apple.iconservices"_s,
     7665#if PLATFORM(MAC)
     7666        "com.apple.iconservices.store"_s,
     7667#endif
     7668    });
     7669    return services;
     7670}
     7671#endif
     7672
    76577673WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& process, DrawingAreaProxy& drawingArea, RefPtr<API::WebsitePolicies>&& websitePolicies)
    76587674{
     
    78227838#if ENABLE(ATTACHMENT_ELEMENT) && PLATFORM(COCOA)
    78237839    if (m_preferences->attachmentElementEnabled() && !m_process->hasIssuedAttachmentElementRelatedSandboxExtensions()) {
    7824         SandboxExtension::Handle handle;
    7825 #if PLATFORM(IOS_FAMILY)
    7826         SandboxExtension::createHandleForMachLookup("com.apple.frontboard.systemappservices"_s, WTF::nullopt, handle);
    7827         parameters.frontboardExtensionHandle = WTFMove(handle);
    7828 #endif
    7829         SandboxExtension::createHandleForMachLookup("com.apple.iconservices"_s, WTF::nullopt, handle);
    7830         parameters.iconServicesExtensionHandle = WTFMove(handle);
     7840        parameters.attachmentElementExtensionHandles = SandboxExtension::createHandlesForMachLookup(attachmentElementServices(), WTF::nullopt);
    78317841        m_process->setHasIssuedAttachmentElementRelatedSandboxExtensions();
    78327842    }
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r268417 r268492  
    572572
    573573#if ENABLE(ATTACHMENT_ELEMENT)
    574     if (parameters.frontboardExtensionHandle)
    575         SandboxExtension::consumePermanently(*parameters.frontboardExtensionHandle);
    576     if (parameters.iconServicesExtensionHandle)
    577         SandboxExtension::consumePermanently(*parameters.iconServicesExtensionHandle);
     574    if (parameters.attachmentElementExtensionHandles)
     575        SandboxExtension::consumePermanently(*parameters.attachmentElementExtensionHandles);
    578576#endif
    579577
  • trunk/Source/WebKit/WebProcess/com.apple.WebProcess.sb.in

    r268270 r268492  
    10001000            "com.apple.diagnosticd"
    10011001            "com.apple.iconservices"
     1002            "com.apple.iconservices.store"
    10021003            "com.apple.tccd"
    10031004            "com.apple.BluetoothServices"
Note: See TracChangeset for help on using the changeset viewer.