Reece Wilson
bf8c1eb8c7
[+] AuFS::UnblockFile [+] AuFS::TrustFile [*] Fixup UNIX open logic a bit (amended. i did not mess up octals >:( )
36 lines
830 B
C++
36 lines
830 B
C++
/***
|
|
Copyright (C) 2023 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: FileTrust.NT.cpp
|
|
Date: 2023-1-25
|
|
Author: Reece
|
|
***/
|
|
#include <Source/RuntimeInternal.hpp>
|
|
#include "FS.hpp"
|
|
#include "FileTrust.NT.hpp"
|
|
|
|
namespace Aurora::IO::FS
|
|
{
|
|
AUKN_SYM bool BlockFile(const AuString &path)
|
|
{
|
|
return AuFS::WriteFile(path + ":Zone.Identifier", "[ZoneTransfer]\r\nZoneId=3\r\n");
|
|
}
|
|
|
|
AUKN_SYM bool UnblockFile(const AuString &path)
|
|
{
|
|
return AuFS::WriteFile(path + ":Zone.Identifier", "[ZoneTransfer]\r\nZoneId=0\r\n");
|
|
}
|
|
|
|
AUKN_SYM bool TrustFile(const AuString &path)
|
|
{
|
|
AuString idc;
|
|
|
|
auto uri = path + ":Zone.Identifier";
|
|
if (AuFS::ReadString(uri, idc))
|
|
{
|
|
return AuFS::Remove(uri);
|
|
}
|
|
|
|
return true;
|
|
}
|
|
} |