Bug 1382541 - kwrite doesn't recognize ACL permissions
Summary: kwrite doesn't recognize ACL permissions
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: kate
Version: 7.2
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Jan Grulich
QA Contact: Desktop QE
URL:
Whiteboard:
Keywords:
Depends On:
Blocks: 1420851 1479818
TreeView+ depends on / blocked
 
Reported: 2016-10-07 02:40 UTC by Gaurav
Modified: 2018-10-26 07:58 UTC (History)
6 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2018-04-10 11:33:59 UTC


Attachments (Terms of Use)
error message (238.00 KB, image/png)
2016-10-07 02:40 UTC, Gaurav
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0717 None None None 2018-04-10 11:35 UTC

Description Gaurav 2016-10-07 02:40:58 UTC
Created attachment 1208068 [details]
error message

Description of problem:
Users are unable to write to a file using 'kwrite', though they have ACL access.

Version-Release number of selected component (if applicable):
kwrite-4.10.5-3.el7.x86_64

How reproducible:
Provide acl access to file for a user. Login to that user and try accessing the file.

Steps to Reproduce:
[1] # setfacl -m u:test:rwx /etc/fstab
[2] Login by 'test' user
[3] Open 'kwrite' and try writing /etc/fstab
[4] Received a error saying "The document could not be saved as it was not possible to write to /etc/fstab. Check that you have write access to this file or that enough disk space is available".

Actual results:
kwrite doesn't allow the access provided for the user using ACLs

Expected results:
kwrite should allow the access provided for the user using ACLs

Additional info:
ACLs works fine for gedit

Comment 2 Kamil Dudka 2016-10-07 10:04:43 UTC
This seems to be caused by the approach that kwrite uses for saving changes to existing files.  Instead of opening the existing file for writing (which you granted the ACL for), it writes the new contents to a temporary file and calls rename() to replace the existing file by the temporary file.  For this to succeed, you would need to have write access to the _directory_ where the file resides.

In any case, ACLs work as designed.  Switching the component to kate...

Comment 8 Jan Grulich 2017-10-16 12:31:57 UTC
Fixed in kate-4.10.5-5.el7.

Comment 10 Jiri Koten 2018-02-06 13:23:28 UTC
There is a problem with deleting text. I'm able to edit and add lines/text, but when I try to delete it, It deletes partially or not at all.

kate-4.10.5-5.el7

Reproducer:
1) # setfacl -m "u:test:rw" /etc/fstab
2) open the file in kate
3) add line and save
4) reopen
5) delete the line and save
6) reopen

Comment 11 Jan Grulich 2018-02-06 14:05:58 UTC
Ok, I managed to reproduce and also find a bug for this [1]. I'll try to backport this fix as well so this is complete.

[1] - https://bugs.kde.org/show_bug.cgi?id=323693

Comment 12 Jan Grulich 2018-02-07 07:11:05 UTC
I have the fix backported and verified locally, we just need the exception flag to be set so I can push it.

Comment 13 Jan Grulich 2018-02-07 13:23:03 UTC
Fixed in kate-4.10.5-6.el7.

Comment 18 errata-xmlrpc 2018-04-10 11:33:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0717


Note You need to log in before you can comment on or make changes to this bug.