Disable debugger for loader mode
authorWoongsuk Cho <ws77.cho@samsung.com>
Thu, 20 Jun 2024 01:53:34 +0000 (10:53 +0900)
committer조웅석/MDE Lab(SR)/삼성전자 <ws77.cho@samsung.com>
Thu, 20 Jun 2024 04:16:38 +0000 (13:16 +0900)
To prevent smack issue related to clr-debug-pipe-xxx file,
disable debugging feature in the runtime side

NativeLauncher/launcher/lib/core_runtime.cc

index 94c732623bea7b5f1639439dd5a99ad7dde6cc03..77b3a27a6068f650c56cba0913ea0e4f547daa2f 100644 (file)
@@ -359,6 +359,11 @@ int CoreRuntime::initialize(const char* appType, LaunchMode launchMode)
        // Disable config cache to set environment after coreclr_initialize()
        putenv(const_cast<char *>("COMPlus_DisableConfigCache=1"));
 
+       // Disable debugger for loader
+       if (launchMode == LaunchMode::loader) {
+               putenv(const_cast<char *>("DOTNET_EnableDebugger=0"));
+       }
+
        // Set environment variable for System.Environment.SpecialFolder
        initEnvForSpecialFolder();