Permissions and owner/group changed when editing using gedit

Bug #152638 reported by vanadium
18
Affects Status Importance Assigned to Milestone
gedit
Fix Released
Medium
gedit (Ubuntu)
Fix Released
Medium
Ubuntu Desktop Bugs
Gutsy
Fix Released
Medium
Ubuntu Desktop Bugs

Bug Description

This is an issue that is introduced in Gutsy, but worked correctly in Feisty.

Steps to reproduce the problem: enter following code in terminal, when gedit appears, type something, exit while saving.

mkdir test; cd test; touch test
sudo chown root:video test
sudo chmod 660 test
ls -l
gedit test
ls -l

A normal user is by default member of the video group, and therefore can edit the file test. On Feisty, the permissions are correctly retained when the normal user has edited the file:

-rw-rw---- 1 root video 5 2007-10-14 15:55 test
-rw-r----- 1 vanadium video 0 2007-10-14 15:55 test~

However, two users of Gutsy report a different behaviour:

-rw------- 1 rfb rfb 6 2007-10-13 19:32 test
-rw-rw---- 1 root video 0 2007-10-13 19:31 test~

Indeed, the backup has the original permissions, but permissions and owner are changed for the edited version. This obviously cripples the concept of unix permissions and will result in eventual hard links to point to the backup file instead of the updated file. As far as my technical skills go, this must be no more than a gedit issue, where gedit now saves the new content in a new inode (renaming afterwards) instead of saving to the same inode, as it should to maintain the integrity of the file management.

Revision history for this message
Daniel Hahler (blueyed) wrote :

Confirmed.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug, that's known upstream, http://bugzilla.gnome.org/show_bug.cgi?id=468578

Changed in gedit:
assignee: nobody → desktop-bugs
importance: Undecided → Medium
status: Confirmed → Triaged
Revision history for this message
Sebastien Bacher (seb128) wrote :

The bug has been fixed upstream now

Changed in gedit:
status: Triaged → Fix Committed
Changed in gedit:
status: Unknown → Fix Released
Revision history for this message
Daniel Hahler (blueyed) wrote :

I confirm that the upstream patch fixes this:
$ mkdir test; cd test; touch test
$ sudo chown root:video test
$ sudo chmod 660 test
$ ls -l
-rw-rw---- 1 root video 0 2007-10-20 17:55 test
$ gedit test
$ ls -l
-rw-rw---- 1 root video 3 2007-10-20 17:55 test
-rw-r----- 1 daniel daniel 0 2007-10-20 17:55 test~

Revision history for this message
Daniel Hahler (blueyed) wrote :
Revision history for this message
Sebastien Bacher (seb128) wrote :

thank you for your bug, the new version will be uploaded so there is no need to backport

Revision history for this message
Sebastien Bacher (seb128) wrote :

 gedit (2.20.3-0ubuntu1) gutsy-proposed; urgency=low
 .
   * New upstream version:
     - Properly preserve file permissions and ownership when saving
       (LP: #152638)

Changed in gedit:
assignee: nobody → desktop-bugs
importance: Undecided → Medium
status: New → Fix Committed
Revision history for this message
Pedro Villavicencio (pedro) wrote :

Verification completed, the bug is fixed with the SRU candidate, thanks you!.

Revision history for this message
Sebastien Bacher (seb128) wrote :

The new version has been accepted in gutsy-updates now

Changed in gedit:
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

This is fixed in hardy.

Changed in gedit:
status: Fix Committed → Fix Released
Changed in gedit:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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