diff options
| author | Husam Harazi <husam999h@gmail.com> | 2023-12-20 14:56:15 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-20 11:56:15 +0000 |
| commit | 3771c49a94806b317fe4de470e96ae589b660a1b (patch) | |
| tree | 3aad97a4075125e2641a9aef23f5999425304c1d /src/Compositor.cpp | |
| parent | d9b74ff96b3e3f0341a386451b9a3375b6f05503 (diff) | |
filesystem: Set the sticky bit on `/tmp/hypr` (#4199)
To prevent unprivileged users from deleting other users' files.
Diffstat (limited to 'src/Compositor.cpp')
| -rw-r--r-- | src/Compositor.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index cbdfa288..ab478a87 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -50,7 +50,7 @@ CCompositor::CCompositor() { 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); + std::filesystem::permissions("/tmp/hypr", std::filesystem::perms::all | std::filesystem::perms::sticky_bit, std::filesystem::perm_options::replace); } const auto INSTANCEPATH = "/tmp/hypr/" + m_szInstanceSignature; |
