Pass whether or not system domain is being used back to framework

This avoids needing to do a file system check in InstallerConnection to determine if we need to connect to the system or user domain.
This commit is contained in:
Zorg committed 2021-04-03 17:16:38 -07:00
1 parent a79aa1690b
commit 467ffb15ca
19 files changed
+121 -129

No files matched your search

+2 -3
View File
@@ -7,7 +7,6 @@
//
#import "SUInstallerConnection.h"
#import "SPUSystemAuthorization.h"
#include "AppKitPrevention.h"
@@ -61,9 +60,9 @@ static NSString *SUInstallerConnectionKeepAliveReason = @"Installer Connection K
[self enableAutomaticTermination];
}
- (void)setServiceName:(NSString *)serviceName hostPath:(NSString *)hostPath installationType:(NSString *)installationType
- (void)setServiceName:(NSString *)serviceName systemDomain:(BOOL)systemDomain
{
NSXPCConnectionOptions options = SPUNeedsSystemAuthorizationAccess(hostPath, installationType) ? NSXPCConnectionPrivileged : 0;
NSXPCConnectionOptions options = systemDomain ? NSXPCConnectionPrivileged : 0;
NSXPCConnection *connection = [[NSXPCConnection alloc] initWithMachServiceName:serviceName options:options];
connection.exportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(SUInstallerCommunicationProtocol)];
@@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)setInvalidationHandler:(void (^)(void))invalidationHandler;
- (void)setServiceName:(NSString *)serviceName hostPath:(NSString *)hostPath installationType:(NSString *)installationType;
- (void)setServiceName:(NSString *)serviceName systemDomain:(BOOL)systemDomain;
- (void)invalidate;
@@ -62,9 +62,9 @@
}];
}
- (void)setServiceName:(NSString *)serviceName hostPath:(NSString *)hostPath installationType:(NSString *)installationType
- (void)setServiceName:(NSString *)serviceName systemDomain:(BOOL)systemDomain
{
[(id<SUInstallerConnectionProtocol>)self.connection.remoteObjectProxy setServiceName:serviceName hostPath:hostPath installationType:installationType];
[(id<SUInstallerConnectionProtocol>)self.connection.remoteObjectProxy setServiceName:serviceName systemDomain:systemDomain];
}
- (void)handleMessageWithIdentifier:(int32_t)identifier data:(NSData *)data