Changeset 199504 in webkit


Ignore:
Timestamp:
Apr 13, 2016 10:51:37 AM (8 years ago)
Author:
dbates@webkit.org
Message:

REGRESSION (r199401): Internal builds of Safari hang on launch
https://bugs.webkit.org/show_bug.cgi?id=156545
<rdar://problem/25697779>

Reviewed by Anders Carlsson.

For some reason SecCodeCopyGuestWithAttributes() is failing with an error in Apple Internal
Safari builds. For now, temporarily allow the failure while I investigate the cause in
<rdar://problem/25706517>.

  • Shared/mac/CodeSigning.mm:

(WebKit::secCodeForProcess): Log the failure with OSStatus code and return nullptr;
(WebKit::codeSigningIdentifierForProcess): Return a null string if secCodeForProcess() returns a nullptr.
This will cause us to treat affected Apple Internal Safari builds the same as we would treat
an unsigned or third-party signed app.

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r199501 r199504  
     12016-04-13  Daniel Bates  <dabates@apple.com>
     2
     3        REGRESSION (r199401): Internal builds of Safari hang on launch
     4        https://bugs.webkit.org/show_bug.cgi?id=156545
     5        <rdar://problem/25697779>
     6
     7        Reviewed by Anders Carlsson.
     8
     9        For some reason SecCodeCopyGuestWithAttributes() is failing with an error in Apple Internal
     10        Safari builds. For now, temporarily allow the failure while I investigate the cause in
     11        <rdar://problem/25706517>.
     12
     13        * Shared/mac/CodeSigning.mm:
     14        (WebKit::secCodeForProcess): Log the failure with OSStatus code and return nullptr;
     15        (WebKit::codeSigningIdentifierForProcess): Return a null string if secCodeForProcess() returns a nullptr.
     16        This will cause us to treat affected Apple Internal Safari builds the same as we would treat
     17        an unsigned or third-party signed app.
     18
    1192016-04-13  Alex Christensen  <achristensen@webkit.org>
    220
  • trunk/Source/WebKit2/Shared/mac/CodeSigning.mm

    r199401 r199504  
    5050    RetainPtr<CFDictionaryRef> attributes = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, keys, values, WTF_ARRAY_LENGTH(keys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
    5151    SecCodeRef code = nullptr;
     52    OSStatus errorCode = noErr;
     53    // FIXME: We should RELEASE_ASSERT() that SecCodeCopyGuestWithAttributes() returns without error. See <rdar://problem/25706517>.
     54    if ((errorCode = SecCodeCopyGuestWithAttributes(nullptr, attributes.get(), kSecCSDefaultFlags, &code))) {
     55        WTFLogAlways("SecCodeCopyGuestWithAttributes() failed with error: %ld\n", static_cast<long>(errorCode));
     56        return nullptr;
     57    }
    5258    RELEASE_ASSERT(!SecCodeCopyGuestWithAttributes(nullptr, attributes.get(), kSecCSDefaultFlags, &code));
    5359    return adoptCF(code);
     
    9399String codeSigningIdentifierForProcess(pid_t pid)
    94100{
    95     return secCodeSigningIdentifier(secCodeForProcess(pid).get());
     101    auto code = secCodeForProcess(pid);
     102    if (!code)
     103        return String();
     104    return secCodeSigningIdentifier(code.get());
    96105}
    97106   
Note: See TracChangeset for help on using the changeset viewer.