When opening a symbolic link that points to a file requiring root permissions in Kate, the following issue occurs: after editing and saving the file, the symbolic link becomes a regular file. STEPS TO REPRODUCE 1. Open a symbolic link that points to a file requiring root permissions in Kate. 2. Edit and modify the file. 3. Save the file. 4. Check the file that a symbolic link is now a regular file, losing its symbolic link properties and no longer pointing to the original target.
Hi - thanks for your bug report! I can reproduce this on KDE Neon, although with the caveat that at step 3, I'm presented with a privilege escalation dialog since root privileges would be needed to save the original file. After authenticating, the actual root-owned file remained unchanged and the symlink was replaced by a copy of the original file, with the changes included. As a note though, the following bug report may be related to this one, and this issue may be an unavoidable consequence of other issues that need handled when opening a symlink: https://bugs.kde.org/show_bug.cgi?id=369094 However, this other report also appears to be a directly related situation, although it is from several years ago and was fixed at the time: https://bugs.kde.org/show_bug.cgi?id=354405 Thanks!
Actually interesting that we did not resolve the symlink first.
That commit did 'break' this: commit 96a76919f37819b7188e5520528182fb2a7824c0 Author: Patrick Northon <northon_patrick3@yahoo.ca> Date: Sun Nov 27 00:35:56 2022 -0500 - Fixed runningChanhged typo. - Define PWD environment variable so that shell scripts can get a path with symbolic links intact. - Don't canonize paths in processed lines from build output. - In KateDocManager: findDocument will compare canonized paths to avoid opening the same document from different urls. Documents will store an absolute urls.
Ok, this fixes other issues, see https://invent.kde.org/utilities/kate/-/merge_requests/1021
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/774
Testers for the small patch welcome, this should be minimal intrusive. A lot of the other link resolving issues got solved in https://invent.kde.org/utilities/kate/-/merge_requests/1021 already.
Git commit f8f5b95848c2d172175be9dc92e4907d653a132f by Christoph Cullmann. Committed on 18/01/2025 at 12:04. Pushed by cullmann into branch 'master'. ensure we do not kill symlinks M +9 -3 src/buffer/katetextbuffer.cpp https://invent.kde.org/frameworks/ktexteditor/-/commit/f8f5b95848c2d172175be9dc92e4907d653a132f