aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2022-12-21 15:41:02 +0000
committervaxerski <[email protected]>2022-12-21 15:41:02 +0000
commit96cb47fc64438c93e7663afa832a567120f82128 (patch)
treeab7b22f7454736ea5f93af4157f7b5662c291583
parente9bd2ee996c73cd86eecd244321e11c5fa5c9c0c (diff)
downloadHyprland-96cb47fc64438c93e7663afa832a567120f82128.tar.gz
Hyprland-96cb47fc64438c93e7663afa832a567120f82128.zip
Add sane permissions for /tmp/hypr
-rw-r--r--src/Compositor.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp
index be77ff79..05958107 100644
--- a/src/Compositor.cpp
+++ b/src/Compositor.cpp
@@ -22,8 +22,15 @@ CCompositor::CCompositor() {
setenv("HYPRLAND_INSTANCE_SIGNATURE", m_szInstanceSignature.c_str(), true);
+ if (!std::filesystem::exists("/tmp/hypr")) {
+ std::filesystem::create_directory("/tmp/hypr");
+ std::filesystem::permissions("/tmp/hypr", std::filesystem::perms::all, std::filesystem::perm_options::replace);
+ }
+
const auto INSTANCEPATH = "/tmp/hypr/" + m_szInstanceSignature;
- mkdir(INSTANCEPATH.c_str(), S_IRWXU | S_IRWXG);
+ std::filesystem::create_directory(INSTANCEPATH);
+ std::filesystem::permissions(INSTANCEPATH, std::filesystem::perms::group_all, std::filesystem::perm_options::replace);
+ std::filesystem::permissions(INSTANCEPATH, std::filesystem::perms::owner_all, std::filesystem::perm_options::add);
Debug::init(m_szInstanceSignature);