diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-04-28 18:58:31 +0100 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-04-28 18:58:31 +0100 |
| commit | b164e67d8b1f12420ec44a1c837af7923559ccf2 (patch) | |
| tree | 1689dce8952bd39305dcf3681cf1a148a91be7ff /src/plugins | |
| parent | 28c85619243e6320e75d7abcfe8244fa99d054dd (diff) | |
core: prefer mkdir over create_directory and permissions
Diffstat (limited to 'src/plugins')
| -rw-r--r-- | src/plugins/HookSystem.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/HookSystem.cpp b/src/plugins/HookSystem.cpp index 5082f54c..7ae71726 100644 --- a/src/plugins/HookSystem.cpp +++ b/src/plugins/HookSystem.cpp @@ -10,6 +10,8 @@ #include <unistd.h> #include <cstring> #include <fstream> +#include <sys/stat.h> +#include <sys/types.h> CFunctionHook::CFunctionHook(HANDLE owner, void* source, void* destination) { m_pSource = source; @@ -138,10 +140,10 @@ CFunctionHook::SAssembly CFunctionHook::fixInstructionProbeRIPCalls(const SInstr const auto RANDOMDIR = "/tmp/hypr/" + g_pTokenManager->getRandomUUID(); - if (!std::filesystem::create_directory(RANDOMDIR)) - return {}; + mkdir(RANDOMDIR.c_str(), S_IRWXU); - std::filesystem::permissions(RANDOMDIR, std::filesystem::perms::owner_all, std::filesystem::perm_options::replace); + if (!std::filesystem::exists(RANDOMDIR)) + return {}; std::ofstream ofs(RANDOMDIR + "/.hookcode.asm", std::ios::trunc); ofs << assemblyBuilder; |
