filesystem: Set the sticky bit on /tmp/hypr (#4199)

To prevent unprivileged users from deleting other users' files.
This commit is contained in:
Husam Harazi 2023-12-20 14:56:15 +03:00 committed by GitHub
parent d9b74ff96b
commit 3771c49a94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;