| Summary: | Deleting a Kate session deletes the existing directory and files | ||
|---|---|---|---|
| Product: | [Applications] kate | Reporter: | Yuta Tomino <demoonlit> |
| Component: | sessions | Assignee: | KWrite Developers <kwrite-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | christoph, demoonlit, meven.car, meven29 |
| Priority: | NOR | ||
| Version First Reported In: | 23.08.3 | ||
| Target Milestone: | --- | ||
| Platform: | Debian stable | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/utilities/kate/-/commit/7e81ddf2604ec21b5934b6d27204e1e5fc6b9b17 | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
|
Description
Yuta Tomino
2024-04-14 16:13:32 UTC
Hi, @meven, could you take a look? Thanks! > Fortunately, it was just after I took the backup. Glad the impact was minimal. > This is my guess, the cause is the below lines: > https://invent.kde.org/utilities/kate/-/blob/master/apps/lib/katestashmanager.cpp?ref_type=heads#L27 > "sessionName" is not escaped here, so probably it tries to delete absolute path if "sessionName" contains "/". This is correct analysis. QDir::exists doc states: `` Unless name contains an absolute file path, the file name is assumed to be relative to the directory itself, so this function is typically used to check for the presence of files within a directory. ``` `KateStashManager::stashDocuments` is also concerned. You could see `Document 1` files in your session path for stashed files. A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1510 A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1534 Git commit 7e81ddf2604ec21b5934b6d27204e1e5fc6b9b17 by Christoph Cullmann. Committed on 09/07/2024 at 16:27. Pushed by cullmann into branch 'master'. use session file name as stash folder name that will we a proper directory name, all stuff is percent encoded there M +14 -7 apps/lib/katestashmanager.cpp https://invent.kde.org/utilities/kate/-/commit/7e81ddf2604ec21b5934b6d27204e1e5fc6b9b17 |