[*] 9ab0c25b
but for UNIX
This commit is contained in:
parent
9ab0c25b05
commit
12a2f30f47
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user