Bug 385596

Summary: Kate not respecting setgid bit on file
Product: [Applications] kate Reporter: csbugs <bugs>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: christoph
Priority: NOR    
Version First Reported In: 17.04.2   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description csbugs 2017-10-11 11:58:07 UTC
Trying to use Kate to edit a file, e.g. called mktest.sh, i experienced an 
unexpected behaviour:

The directory and file is owned by another user, but i as member of a common group should be able to edit the file if the group id bit (s) is set:

3775 drwxrwsr-t   user1  engineers  /home/shared/admin
775 -rwxrwxr-x   user1 engineers  /home/shared/admin/mktest.sh

Another user2, who is in group engineers, should generally be able to edit file mktest.sh although he cannot move it.
For reference see https://en.wikipedia.org/wiki/Setuid#sticky_bit_with_GUID

Using emacs, gedit or vi user2 can do that, while kate/kwrite/kile are denying user2 to edit the file.

This happens on Opensuse Leap 42.3 using
- Kate 17.04.2-1.6
- Plasma 5.8.7
- plasma-framework 5.32-0-4.1
- libQt5.6.2-6.1
- kdelibs-4.14.33
Comment 1 Christoph Cullmann 2018-08-18 09:15:16 UTC
Remove QSaveFile in favor of plain old file saving

Summary: Rationale: for many use cases that e.g. have acls, complex other extended attributes, static links e.g. the rename() doesnt do the trick it should other ways would be start to add workarounds to all cases, which is hard, e.g. if that is something shared via SMB...

Test Plan: make && make test

Reviewers: dhaumann, dfaure

Reviewed By: dhaumann, dfaure

Subscribers: dfaure, kwrite-devel, kde-frameworks-devel

Tags: #kate, #frameworks

Differential Revision: https://phabricator.kde.org/D14890