gedit causes loss of extended attributes (xattrs)

Bug #1942542 reported by Alex
258
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gedit
New
Unknown
gedit (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Ubuntu 21.04 hirsute
gedit 3.38.1-1

If a file with extended attributes (xattrs) is edited and saved with gedit, the xattrs are lost. This problem - as well as the loss of birth time, reported in https://bugs.launchpad.net/ubuntu/+source/gedit/+bug/1940758 - seems to be caused by gedit creating a new file when saving. Compare this with nano, which does not destroy xattrs.

Steps to reproduce:
1 echo testing > testfile.txt
2 setfattr -n user.test -v "this is my test xattr" testfile.txt
3 getfattr -d testfile.txt
# file: testfile.txt
user.test="this is my test xattr"
4 gedit testfile.txt
make edit and save
5 getfattr -d testfile.txt
no output

This bug also causes a loss of ACLs for the edited file, as they are stored as extended attributes. Because of this I am marking this bug as a security vulnerability.

This bug is not limited to gedit; it applies to a number of other text editors.

Alex (thud)
description: updated
Revision history for this message
Seth Arnold (seth-arnold) wrote :

Nice find Alex; can you please report this to upstream gedit, and report back the bug url here so we can link them together?

Thanks

information type: Private Security → Public Security
Revision history for this message
Alex (thud) wrote :
Changed in gedit (Ubuntu):
status: New → Confirmed
Changed in gedit:
status: Unknown → New
To post a comment you must log in.
This report contains Public Security information  
Everyone can see this security related information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.