From e34daac8c338b951449291ce5c9664cd92201605 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Tue, 3 May 2022 21:08:08 -0300 Subject: [PATCH] macOS: Detect app translocation and bail out if translocated --- src/86box.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/86box.c b/src/86box.c index b9227dfde..0ebc603d3 100644 --- a/src/86box.c +++ b/src/86box.c @@ -424,7 +424,11 @@ pc_init(int argc, char *argv[]) if ((c >= 16) && !strcmp(&exe_path[c - 16], "/Contents/MacOS/")) { exe_path[c - 16] = '\0'; p = path_get_filename(exe_path); - *p = '\0'; + *p = '\0'; + } + if (!strncmp(exe_path, "/private/var/folders/", 21)) { + ui_msgbox_header(MBX_FATAL, L"App Translocation", EMU_NAME_W L" cannot determine the emulated machine's location due to a macOS security feature. Please make a copy of the " EMU_NAME_W L" app and open that copy instead."); + return(0); } #elif !defined(_WIN32) /* Grab the actual path if we are an AppImage. */