diff options
author | Vaxry <[email protected]> | 2024-04-28 20:06:40 +0100 |
---|---|---|
committer | Vaxry <[email protected]> | 2024-04-28 20:06:40 +0100 |
commit | f7815dab42ee570c38bd7ae85a4f2a6e36803809 (patch) | |
tree | 25cb98f7fb5f23a7bc1a2628bf4f3b249e1881ba /hyprctl/main.cpp | |
parent | b164e67d8b1f12420ec44a1c837af7923559ccf2 (diff) | |
download | Hyprland-f7815dab42ee570c38bd7ae85a4f2a6e36803809.tar.gz Hyprland-f7815dab42ee570c38bd7ae85a4f2a6e36803809.zip |
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
Diffstat (limited to 'hyprctl/main.cpp')
-rw-r--r-- | hyprctl/main.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hyprctl/main.cpp b/hyprctl/main.cpp index 3337cbff..9b2c2fd2 100644 --- a/hyprctl/main.cpp +++ b/hyprctl/main.cpp @@ -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 |