From 6a4b2386418549dddb4b4cab16562eb674fc5647 Mon Sep 17 00:00:00 2001 From: Arjan Molenaar Date: Tue, 28 Nov 2023 22:32:28 +0100 Subject: [PATCH] macos: Add method that denotes secure restorable state Fix process injection vulnerability on macOS. --- gtk/gtkapplication-quartz.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gtk/gtkapplication-quartz.c b/gtk/gtkapplication-quartz.c index 6ac74a4f07..8639b09bf1 100644 --- a/gtk/gtkapplication-quartz.c +++ b/gtk/gtkapplication-quartz.c @@ -57,14 +57,12 @@ typedef struct G_DEFINE_TYPE (GtkApplicationImplQuartz, gtk_application_impl_quartz, GTK_TYPE_APPLICATION_IMPL) -@interface GtkApplicationQuartzDelegate : NSObject +@interface GtkApplicationQuartzDelegate : NSObject { GtkApplicationImplQuartz *quartz; } - (id)initWithImpl:(GtkApplicationImplQuartz*)impl; -- (NSApplicationTerminateReply) applicationShouldTerminate:(NSApplication *)sender; -- (void)application:(NSApplication *)theApplication openFiles:(NSArray *)filenames; @end @implementation GtkApplicationQuartzDelegate @@ -114,6 +112,11 @@ G_DEFINE_TYPE (GtkApplicationImplQuartz, gtk_application_impl_quartz, GTK_TYPE_A [theApplication replyToOpenOrPrint:NSApplicationDelegateReplySuccess]; } + +- (BOOL)applicationSupportsSecureRestorableState:(NSApplication *)app +{ + return YES; +} @end /* these exist only for accel handling */