compositor: more fs safety around tmp directories

HIS now includes a random bit, and hyprland will bail if /tmp/hypr is not a directory or if /tmp/hypr/his exists
This commit is contained in:
Vaxry
2024-04-28 20:06:40 +01:00
parent b164e67d8b
commit f7815dab42
2 changed files with 20 additions and 3 deletions

View File

@@ -51,7 +51,7 @@ std::vector<SInstanceData> instances() {
data->id = data->id.substr(data->id.find_last_of('/') + 1, data->id.find(".lock") - data->id.find_last_of('/') - 1);
try {
data->time = std::stoull(data->id.substr(data->id.find_first_of('_') + 1));
data->time = std::stoull(data->id.substr(data->id.find_first_of('_') + 1, data->id.find_last_of('_') - (data->id.find_first_of('_') + 1)));
} catch (std::exception& e) { continue; }
// read file