[*] fix busted init once

This commit is contained in:
Reece Wilson 2023-10-10 19:13:37 +01:00
parent f798c59cb8
commit 709a95cee1
2 changed files with 10 additions and 6 deletions

View File

@ -65,8 +65,9 @@ namespace Aurora::Process
AuList<AuString> const * specifiedSearchPaths {};
AuList<EModulePath> const * searchPath {};
bool verify {}; // always effectively true if the executable is signed and enableMitigations is true
bool unixCheckPlusX {};
bool enableMitigations {true};
bool unixCheckPlusX { true };
bool enableMitigations { true };
bool forceMitigations { false };
};
/**

View File

@ -133,11 +133,14 @@ namespace Aurora::Process
return ret;
}
static const AuString& ConstructAuDllSuffix()
AUKN_SYM const AuString& ConstructAuDllSuffix()
{
static AuString dllSuffixString {};
if (dllSuffixString.empty()) dllSuffixString = ConstructAuDllSuffix();
dllSuffixString = ConstructAuDllSuffixUncached();
static AuInitOnce gInitOnce;
gInitOnce.Call([]
{
dllSuffixString = ConstructAuDllSuffixUncached();
});
return dllSuffixString;
}
@ -323,7 +326,7 @@ namespace Aurora::Process
auto absPath = AuIOFS::NormalizePathRet(abs);
#endif
if (request.verify || (kIsMainSigned || request.enableMitigations))
if (request.verify || ((kIsMainSigned || request.forceMitigations) && request.enableMitigations))
{
#if defined(AURORA_PLATFORM_WIN32)
if (!VerifyEmbeddedSignature(widePath.c_str(), mitigateTimeOfUse))