https://bugs.kde.org/show_bug.cgi?id=485551

            Bug ID: 485551
           Summary: Deleting a Kate session deletes the existing directory
                    and files
    Classification: Applications
           Product: kate
           Version: 23.08.3
          Platform: Debian stable
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: sessions
          Assignee: kwrite-bugs-n...@kde.org
          Reporter: demoon...@panathenaia.halfmoon.jp
  Target Milestone: ---

SUMMARY

Deleting a Kate session by Session Chooser deletes the existing directory and
its files, if the session name matches the actual path.

I deleted one session in trying to make my Kate sessions correspond to the
actual directories, and found that the directory had disappeared.
Fortunately, it was just after I took the backup.

STEPS TO REPRODUCE
1. Create new Kate session.
2. Save the session as a name that matches some existing path name starting
with "/".
3. Delete the session from Kate's Session Chooser.

OBSERVED RESULT

The existing directory and its files are deleted.

EXPECTED RESULT

Only the *.katesession and stashed files in $HOME/.local/share/kate are
deleted.

SOFTWARE/OS VERSIONS
Operating System: Devuan GNU/Linux 5 (daedalus)
Linux/KDE Plasma: 
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Kernel Version: 6.1.0-20-amd64 (64-bit)
Graphics Platform: X11

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 "/".

Thanks.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to