Changeset 261238 in webkit
- Timestamp:
- May 6, 2020, 10:32:01 AM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r261232 r261238 1 2020-05-06 Brent Fulgham <bfulgham@apple.com> 2 3 [MacCatalyst] Processes should check for network entitlement as we do for macOS apps 4 https://bugs.webkit.org/show_bug.cgi?id=211474 5 <rdar://problem/61182060> 6 7 Reviewed by Alexey Proskuryakov. 8 9 We should make the same entitlement checks in MacCatalyst as we do for macOS. 10 11 * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm: 12 (WebKit::XPCServiceInitializerDelegate::checkEntitlements): 13 1 14 2020-05-06 Darin Adler <darin@apple.com> 2 15 -
trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm
r243880 r261238 1 1 /* 2 * Copyright (C) 2013 Apple Inc. All rights reserved.2 * Copyright (C) 2013-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 31 31 #import <WebCore/ProcessIdentifier.h> 32 32 #import <wtf/cocoa/Entitlements.h> 33 #import <wtf/spi/darwin/SandboxSPI.h> 33 34 34 35 namespace WebKit { … … 41 42 bool XPCServiceInitializerDelegate::checkEntitlements() 42 43 { 43 #if PLATFORM(MAC) 44 if (!isClientSandboxed()) 45 return true; 46 47 // FIXME: Once we're 100% sure that a process can't access the network we can get rid of this requirement for all processes. 48 if (!hasEntitlement("com.apple.security.network.client")) { 49 NSLog(@"Application does not have the 'com.apple.security.network.client' entitlement."); 50 return false; 44 #if PLATFORM(MAC) || PLATFORM(MACCATALYST) 45 if (isClientSandboxed()) { 46 audit_token_t auditToken = { }; 47 xpc_connection_get_audit_token(m_connection.get(), &auditToken); 48 if (auto rc = sandbox_check_by_audit_token(auditToken, "mach-lookup", static_cast<enum sandbox_filter_type>(SANDBOX_FILTER_GLOBAL_NAME | SANDBOX_CHECK_NO_REPORT), "com.apple.nsurlsessiond")) { 49 // FIXME (rdar://problem/54178641): This requirement is too strict, it should be possible to load file:// resources without network access. 50 NSLog(@"Application does not have permission to communicate with network resources. rc=%d : errno=%d", rc, errno); 51 return false; 52 } 51 53 } 52 54 #endif
Note:
See TracChangeset
for help on using the changeset viewer.