SUMMARY When using kompare to apply changes from one file to another, the updated file's permissions are reset to 0600 (presumably you are creating a new file with 0600 and renaming it on top of the old file instead of opening and rewriting the existing file and this is losing the existing permissions as a result?). This seems like a regression from kompare in KDE 4. STEPS TO REPRODUCE 1. echo foo > foo 2. echo bar > bar 3. ls -l foo bar -rw-r--r-- 1 john john 4 Dec 19 11:58 bar -rw-r--r-- 1 john john 4 Dec 19 11:58 foo 4. kompare foo bar <space> to apply delta Ctrl-Q to quit and save 5. ls -l foo bar -rw------- 1 john wheel 4 Dec 19 11:58 bar -rw-r--r-- 1 john john 4 Dec 19 11:58 foo OBSERVED RESULT -rw------- 1 john wheel 4 Dec 19 11:58 bar EXPECTED RESULT -rw-r--r-- 1 john wheel 4 Dec 19 11:58 bar SOFTWARE/OS VERSIONS FreeBSD: 12.0-PRERELASE KDE Plasma Version: 5.12.7 KDE Frameworks Version: 5.52.0 Qt Version: 5.11.2 kompare: 18.08.3 ADDITIONAL INFORMATION
I have the same critical issue. - Arch Linux - KDE / Kompare 19.04
Created attachment 124765 [details] libkomparediff2 patch to set file permisions on copy This is a patch that sets the file permissions on file_copy to be the same as the original file. This may not be the correct way of doing this. I can't find any documentation on what the permissions = -1 argument to KIO::file_copy is actually supposed to do. This setting "may" have been meant to keep the files permissions unchanged but it seem to set them to 0600. Maybe someone who knows how KIO is supposed to work can answer this ?
Forgot to say, this patch is to the libkomparediff2-19.04.3 library that kompare uses.
> This is a patch that sets the file permissions on file_copy to be the same as the original file. Looks good to me. Do you have git write (push) access to the KDE repositories? Or shall I push it? > This may not be the correct way of doing this. I can't find any documentation > on what the permissions = -1 argument to KIO::file_copy is actually supposed > to do. This setting "may" have been meant to keep the files permissions > unchanged but it seem to set them to 0600. Maybe someone who knows how KIO is > supposed to work can answer this ? The documentation: https://api.kde.org/frameworks/kio/html/namespaceKIO.html#ad7e9c41cdcc6255c56dc2e32a7442995 says: "May be -1. In this case no special permission mode is set." which I would interpret as meaning it just uses the default umask of the destination file system. (At most, some KIOslaves might attempt to copy the permissions of the SOURCE file, but it definitely does not mean retaining the permissions of an existing destination file that is being overwritten.)
Hi Kevin, no I don't have git write permissions. Feel free to push it if you think it is valid (I have very little knowledge on how the KDE KIO system works). Terry
Any progress on this bug?
Here we are in Fedore 32 and this is still a serious inconvenience. How can we find out where this issue is in KDE priorities?
Another year has past… Is there any progress on this bug?
Git commit 99b1d14756279c6cb3cb4df6027585130d17205e by Kevin Kofler. Committed on 21/07/2021 at 10:16. Pushed by kkofler into branch 'release/21.08'. Set correct file mode when saving changes (#402363) src/komparemodellist.cpp (KompareModelList::saveDestination): Get permissions of existing file and copy temporary file with the same permissions. Patch by Terry Barnaby. FIXED-IN: 21.07.90 M +9 -1 src/komparemodellist.cpp https://invent.kde.org/sdk/libkomparediff2/commit/99b1d14756279c6cb3cb4df6027585130d17205e