[*] 9ab0c25b but for UNIX

This commit is contained in:
Reece Wilson 2023-09-09 23:57:01 +01:00
parent 9ab0c25b05
commit 12a2f30f47

View File

@ -26,11 +26,36 @@ namespace Aurora::Processes
AUKN_SYM void OpenUri(const AuString &uri) AUKN_SYM void OpenUri(const AuString &uri)
{ {
if (AuFS::FileExists(uri))
{
SysPushErrorGeneric("Exploit attempt? Attempted to open existing file/directory via URI ({})", uri);
return;
}
UnixOpenAsync(uri); UnixOpenAsync(uri);
} }
AUKN_SYM void OpenFile(const AuString &file) AUKN_SYM void OpenFile(const AuString &file)
{ {
UnixOpenAsync(IO::FS::NormalizePathRet(file)); auto path = AuIOFS::NormalizePathRet(file);
bool bFileExists {};
if (!(bFileExists = AuFS::FileExists(path)) &&
!AuFS::DirExists(path))
{
SysPushErrorGeneric("Exploit attempt? Attempted to open non-existent file/directory. (request: {})", file);
return;
}
if (bFileExists)
{
if (!AuFS::IsFileBlocked(path))
{
SysPushErrorGeneric("Exploit attempt? Attempted to open untrusted file/directory. (request: {})", file);
return;
}
}
UnixOpenAsync(path);
} }
} }