After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 104432 - changes owner and group id's when file is saved
changes owner and group id's when file is saved
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
2.0.2
Other Linux
: Normal normal
: ---
Assigned To: Gedit maintainers
gedit QA volunteers
Depends on:
Blocks: 130389
 
 
Reported: 2003-01-25 23:13 UTC by paul_eformsys
Modified: 2006-01-30 21:25 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
Changes have been made so that the owner and the group id remains as they were before, when a user belonging to same group but not owner of that file saves the file. (11.93 KB, patch)
2004-05-08 19:30 UTC, sriharsha
none Details | Review
Plugin for GEDIT 2.10.x Convert between MAC-DOS-UNIX text formats. (8.41 KB, application/x-compressed-tar)
2005-06-13 02:53 UTC, Muthiah Annamalai
  Details

Description paul_eformsys 2003-01-25 23:13:53 UTC
If a file is owned by user A  and group GA, user B can open the file
because user B is in group GA.  When user B saves the file, the file's
owner and group id are changed to user B.

When the above is done with vi, the owner and group id remain as they were
setup.
Comment 1 Paolo Maggi 2003-01-26 09:48:29 UTC
We definitely need to improve that part of the code.
See also bug #92896.
Comment 2 Eric Ritezel 2003-06-07 03:24:56 UTC
Here's how it operates right now (from what I'm seeing):

1) file.txt moved to file.txt~ maintaining ownership, permissions, etc.
2) file.txt created under CURRENT ownership, permissions, etc.
3) data written to file.txt

Care to guess what happens when you save twice in a row?  Yeah.  Kiss
that ownership bye-bye.

The real problem at hand is developing an intelligent approach to
backing up files.  Obviously, in the case of multiple users (as here),
we can't just move/create.  Overwriting the file without a backup when
one might be possible or even wanted isn't much better, either.  We
need a copy/overwrite scheme to solve this particular problem.  That's
what 92896 is all about (this bug is safer for me, though.)
Comment 3 sriharsha 2004-05-08 19:30:41 UTC
Created attachment 27488 [details] [review]
Changes have been made so that the owner and the group id remains as they were before, when a user belonging to same group but not owner of that file saves the file.

Whenever a user belonging to the group same as that of the owner of a file,
edits and saves the file, that user id was being changed to that of the user
editing the file. The this is not the right way. The GID and UID suppose to be
remain intact. In this patch the care is taken so that the UID and GIDs of the
file remain same as they were before.
Comment 4 Paolo Maggi 2004-07-16 16:10:07 UTC
Thanks for the patch.
Note that I'm rewriting the "save" function in order to use gnome-vfs.
Comment 5 Christian Kirbach 2005-03-10 11:15:08 UTC
Bug 169816 also has a patch.
Comment 6 Paolo Borelli 2005-03-10 11:22:04 UTC
Christian: we appreciate your triaging bug efforts, however Paolo Maggi and me
are quite aware of the bugzilla status of gedit... the patch attached to bug
169816 solves a completely different problem with the save a copy plugin.

As Paolo Maggi said above this bug will be fixed with the gnome-vfs rewrite of
the saving routines, which should happen soon.
Comment 7 Christian Kirbach 2005-03-10 11:26:43 UTC
thanks for pointing that out Paolo Borelli
Comment 8 Muthiah Annamalai 2005-06-13 02:53:10 UTC
Created attachment 47683 [details]
Plugin for GEDIT 2.10.x Convert between MAC-DOS-UNIX text formats.

This patch contains the convert/ plugin code.
It guesses the file type {DOS,MAC,UNIX} and uses
gedit_document_replace_string();

It runs a dialog in the middle, for user to abort conversions,
or convert from     Dos-Unix-Mac-Dos-Unix, 
All the 6 conversion combo's are possible, but based on
your file type.
Comment 9 Paolo Borelli 2006-01-30 21:25:34 UTC
this is fixed in 2.13.X