From ebc48cee5c6d384a4ad77915a9672295e8c60120 Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 3 Apr 2021 22:43:01 -0700 Subject: [PATCH 1/2] Increase max mach service name length to 127 characters --- Autoupdate/SPUMessageTypes.h | 4 ---- Autoupdate/SPUMessageTypes.m | 10 +++------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/Autoupdate/SPUMessageTypes.h b/Autoupdate/SPUMessageTypes.h index 8b69a006b5..d36cdb0b5d 100644 --- a/Autoupdate/SPUMessageTypes.h +++ b/Autoupdate/SPUMessageTypes.h @@ -10,10 +10,6 @@ NS_ASSUME_NONNULL_BEGIN -@class SUHost; - -extern NSString *SPUAppcastItemArchiveKey; - // Order matters; higher stages have higher values. typedef NS_ENUM(int32_t, SPUInstallerMessageType) { diff --git a/Autoupdate/SPUMessageTypes.m b/Autoupdate/SPUMessageTypes.m index 4ea84ac3b2..c60e265fbb 100644 --- a/Autoupdate/SPUMessageTypes.m +++ b/Autoupdate/SPUMessageTypes.m @@ -7,13 +7,10 @@ // #import "SPUMessageTypes.h" -#import "SUHost.h" #include "AppKitPrevention.h" -NSString *SPUAppcastItemArchiveKey = @"SPUAppcastItemArchive"; - // Tags added to the bundle identifier which is used as Mach service names // These should be very short because length restrictions exist on earlier versions of macOS #define SPARKLE_INSTALLER_TAG @"-spki" @@ -21,10 +18,9 @@ #define SPARKLE_PROGRESS_TAG @"-spkp" #define SPARKLE_PROGRESS_LAUNCH_INSTALLER_TAG @"-spkl" -// macOS 10.8 at least can't handle service names that are 64 characters or longer -// This was fixed some point after 10.8, but I'm not sure if it was fixed in 10.9 or 10.10 or 10.11 -// If we knew when it was fixed, this could only be relevant to OS versions prior to that -#define MAX_SERVICE_NAME_LENGTH 63u +// macOS 10.8 couldn't handle service names that are >= 64 characters, +// but 10.9 raised this to >= 128 characters +#define MAX_SERVICE_NAME_LENGTH 127u BOOL SPUInstallerMessageTypeIsLegal(SPUInstallerMessageType oldMessageType, SPUInstallerMessageType newMessageType) { From 71a36f8be4417c1a8d005990c13433a84292251a Mon Sep 17 00:00:00 2001 From: Zorg Date: Sun, 4 Apr 2021 14:06:27 -0700 Subject: [PATCH 2/2] Add comments on message type tags --- Autoupdate/SPUMessageTypes.h | 3 +++ Autoupdate/SPUMessageTypes.m | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Autoupdate/SPUMessageTypes.h b/Autoupdate/SPUMessageTypes.h index d36cdb0b5d..0a48bd0724 100644 --- a/Autoupdate/SPUMessageTypes.h +++ b/Autoupdate/SPUMessageTypes.h @@ -36,10 +36,13 @@ typedef NS_ENUM(int32_t, SPUUpdaterMessageType) BOOL SPUInstallerMessageTypeIsLegal(SPUInstallerMessageType oldMessageType, SPUInstallerMessageType newMessageType); +// Used by framework to communicate to installer (Autoupdate) NSString *SPUInstallerServiceNameForBundleIdentifier(NSString *bundleIdentifier); +// Used by framework to communicate to progress agent tool (Updater) NSString *SPUStatusInfoServiceNameForBundleIdentifier(NSString *bundleIdentifier); +// Used by progress agent tool to communicate to installer (Autoupdate) NSString *SPUProgressAgentServiceNameForBundleIdentifier(NSString *bundleIdentifier); NS_ASSUME_NONNULL_END diff --git a/Autoupdate/SPUMessageTypes.m b/Autoupdate/SPUMessageTypes.m index c60e265fbb..132b3d975e 100644 --- a/Autoupdate/SPUMessageTypes.m +++ b/Autoupdate/SPUMessageTypes.m @@ -12,11 +12,10 @@ #include "AppKitPrevention.h" // Tags added to the bundle identifier which is used as Mach service names -// These should be very short because length restrictions exist on earlier versions of macOS +// These should be very short because of length restrictions #define SPARKLE_INSTALLER_TAG @"-spki" #define SPARKLE_STATUS_TAG @"-spks" #define SPARKLE_PROGRESS_TAG @"-spkp" -#define SPARKLE_PROGRESS_LAUNCH_INSTALLER_TAG @"-spkl" // macOS 10.8 couldn't handle service names that are >= 64 characters, // but 10.9 raised this to >= 128 characters