diff --git a/stratosphere/sm/Makefile b/stratosphere/sm/Makefile index b73b78a53..247cc5043 100644 --- a/stratosphere/sm/Makefile +++ b/stratosphere/sm/Makefile @@ -41,7 +41,7 @@ ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE CFLAGS := -g -Wall -O2 -ffunction-sections \ $(ARCH) $(DEFINES) -CFLAGS += $(INCLUDE) -D__SWITCH__ -DSM_ENABLE_MITM -DSM_ENABLE_INIT_DEFERS -DSM_MINIMUM_SESSION_LIMIT=8 +CFLAGS += $(INCLUDE) -D__SWITCH__ -DSM_ENABLE_MITM -DSM_ENABLE_INIT_DEFERS -DSM_MINIMUM_SESSION_LIMIT=8 -DSM_ENABLE_PERMISSIVE_UNREGISTER CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++17 diff --git a/stratosphere/sm/source/sm_registration.cpp b/stratosphere/sm/source/sm_registration.cpp index 3401f800f..1e501ca0a 100644 --- a/stratosphere/sm/source/sm_registration.cpp +++ b/stratosphere/sm/source/sm_registration.cpp @@ -428,9 +428,11 @@ Result Registration::UnregisterServiceForPid(u64 pid, u64 service) { return 0xE15; } +#ifndef SM_ENABLE_PERMISSIVE_UNREGISTER if (!IsInitialProcess(pid) && target_service->owner_pid != pid) { return 0x1015; } +#endif svcCloseHandle(target_service->port_h); svcCloseHandle(target_service->mitm_port_h);