Red Hat Bugzilla – Bug 202099
gedit destroys ACLs/SELinux context/xattrs when saving files
Last modified: 2007-11-30 17:11:40 EST
Description of problem:
gedit saves files via. the traditional method of:
x = open_tmp_file()
...but it doesn't copy the xattrs from the orig. to the tempfile, so ACLs,
xattrs and SELinux context info. is all lost.
Version-Release number of selected component (if applicable):
current rawhide, FC5
I've created a patch for gedit which fixes this.
1. You need to call:
...in the %build, due to needing to link to libattr etc.
Created attachment 133977 [details]
patch to add full xattr copying to gedit
we can apply this locally in rawhide, but would you mind filing the patch
upstream as well?
*** Bug 202097 has been marked as a duplicate of this bug. ***
Also, would it be appropriate to give a similar treatment to
Well, we document g_file_set_contents as explicitly not having those semantics:
"On Unix, if filename already exists hard links to filename will break. Also
since the file is recreated, existing permissions, access control lists,
metadata etc. may be lost. If filename is a symbolic link, the link itself will
be replaced, not the linked file."
Well, we say it _may_ be lost. We don't say it _will_ be lost. Looks like a
quality-of-implementation issue to me.
fixed in the gedit that is in rawhide