From f0db7d4b03ae3e6e0c73bebc273ec68cc0fc7edd Mon Sep 17 00:00:00 2001 From: khanhduytran0 Date: Mon, 12 Sep 2022 07:11:23 +0700 Subject: [PATCH] Force setting HOME to sandboxed directory --- Natives/main.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Natives/main.m b/Natives/main.m index 81e80aef..aeb24eb6 100644 --- a/Natives/main.m +++ b/Natives/main.m @@ -296,6 +296,8 @@ int main(int argc, char * argv[]) { init_migrateDirIfNecessary(); setenv("BUNDLE_PATH", dirname(argv[0]), 1); + setenv("HOME", [NSFileManager.defaultManager URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] + .lastObject.path.stringByDeletingLastPathComponent.UTF8String, 1); if (getenv("POJAV_DETECTEDJB")) { // TODO: Set to new Docs for both jben and unjben in 2.2