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 522254 - Rhythmbox does not respect file permissions
Rhythmbox does not respect file permissions
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: general
0.11.x
Other All
: Normal normal
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-03-13 16:11 UTC by Kjell Braden
Modified: 2011-07-18 12:23 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Kjell Braden 2008-03-13 16:11:46 UTC
Please describe the problem:
Numerous bug reports have been submitted about Rhythmbox's handling of ID3 tags, so it is clear that its ID3 support is (yet) less than perfect. I still like RB as a player, though. To avoid it corrupting my tags, I therefore removed write access from my MP3 files. However, it is still possible to edit a file's tag in RB, and it even turns write permission back on.

Steps to reproduce:
1. Give an MP3 file only read permissions (444).
2. Locate the file in RB's music library, and edit its ID3 tag info.

Actual results:
- ID3 tags are changed (and, I might add, somewhat corrupted).
- MP3 file gets write permission (644).

Expected results:
- Rhythmbox should give an error message saying it does not have permission to edit the file.
- File should be unchanged.

Does this happen every time?
yes

Other information:
This bug has been initially reported by Lars Kyllingstad to ubuntu. For more information see: https://bugs.launchpad.net/ubuntu/+source/rhythmbox/+bug/181742

Thanks,
Comment 1 Jonathan Matthew 2008-03-13 22:22:40 UTC
(In reply to comment #0)
> Please describe the problem:
> Numerous bug reports have been submitted about Rhythmbox's handling of ID3
> tags, so it is clear that its ID3 support is (yet) less than perfect. I still
> like RB as a player, though. To avoid it corrupting my tags..

> .. (and, I might add, somewhat corrupted).

Just as a matter of form, please leave exposition like this out of bug reports; it's not relevant to the bug at hand, gives no useful information, and mostly serves to annoy people.
Comment 2 Aaron D. Gerber 2008-07-19 18:35:05 UTC
I can reproduce this on Ubuntu 8.10 with Rhythmbox 0.11.5.
Comment 3 Nils Philippsen 2009-04-25 12:55:51 UTC
I think I've experienced nearly the same issue: At my home, we share a computer and put all the ripped music files in a shared folder with appropriate permissions and umask:

- shared directory and files are of group "users", all users needing to write are members of that group
- umask 0002
- permissions on directories u=rwx,g=rwxs,o=rx (02775), on files ug=rw,o=r (0664)

After editing a tag on a file which originally belonged to my wife, it belonged to me (that is expected), but its permissions are u=rw,go= (0600), meaning my wife can't play it anymore. I know I could go on the command line and fix the permissions afterwards, but this doesn't feel right ;-).

Is there anything else you need to work on this bug?
Comment 4 emunson@mgebm.net 2009-07-24 09:42:57 UTC
I have seen the same problem with the git head for rhythmbox.  I keep my music on a NAS that supports CIFS and NFS so the shared files are 0777.  When I update the ID3 information the owner is changed to my user:my group from the NFS owner:NFS group, and permissions are set to 644.
Comment 5 emunson@mgebm.net 2009-07-24 22:02:07 UTC
I am happy to try and work a fix here with a little guidance on where in the code base to start looking.
Comment 6 Reimundo Heluani 2009-08-02 21:35:10 UTC
Well, I'm not saying this is a good patch, but it works for me at least on RB 0.12.3. Until someone smart here comes with a good patch, you can try this or start from here.


*** metadata/rb-metadata-gst.c.orig	2009-08-02 14:13:08.000000000 -0700
--- metadata/rb-metadata-gst.c	2009-08-02 14:12:43.000000000 -0700
***************
*** 1043,1048 ****
--- 1043,1053 ----
  		src = g_file_new_for_uri (tmpname);
  		dest = g_file_new_for_uri (md->priv->uri);
  		
+ 		g_file_copy_attributes ( dest, src, GFILE_COPY_ALL_METADATA, NULL, &io_error);
+ 		if (io_error != NULL) {
+ 			goto gio_error;
+ 		}
+ 
  		g_file_move (src, dest, G_FILE_COPY_OVERWRITE, NULL, NULL, NULL, &io_error);
  		if (io_error != NULL) {
  			goto gio_error;
Comment 7 Reimundo Heluani 2009-08-02 22:09:33 UTC
I forgot, for comment #3 for example you might want to pass G_FILE_COPY_NONE instead and have the directories chmod g+s, that way you can group share and change tags
Comment 8 emunson@mgebm.net 2009-09-04 06:10:42 UTC
IMO rhythmbox should respect the file permissions and owner without being told to by the filesystem.  Your posted patch works for me with a small change (G_FILE_COPY_ALL_METADATA instead of GFILE_COPY_METADATA).
Comment 9 emunson@mgebm.net 2009-09-04 07:23:53 UTC
Spoke too soon, it works if the user running rhythmbox owns the file in question, but it does not work if the file is owned by someone else.
Comment 10 Reimundo Heluani 2009-09-04 15:09:29 UTC
Yeah I mistyped the flag and didn't want to add a comment for something people were going to find out anyway. 

Of course if you don't own the file then you can't write a file with all the metadata of another user. If what you're looking for is just to keep the chmod permissions for example, then comment 7 should do it for you.
Comment 11 JamesIsIn 2010-01-05 07:54:17 UTC
I am seeing what I take to be more evidence for this bug.  I have a server running Ubuntu 9.10 with Rhythmbox 0.12.5.  I maintain a shared directory on that server with permissions set to rw r r.  Whenever I alter or add a tag to a FLAC using Rb the file permissions for the file in question are changed to rw _ _.  I have listed additional information here:

http://ubuntuforums.org/showthread.php?p=8612165

I am happy to answer any questions I am able.

(This was also occurring when I had my music collection on my main machine running 8.10 and 0.11.6 and still occurs on that machine if I choose to ask it to do any local tagging.)
Comment 12 Philip Ganchev 2011-05-14 00:27:53 UTC
A similar problem persists in Rhythmbox 0.13.1. Setting the tags of an mp3 file changes the permissions from whatever they are to -rw------ (that is, u=rw,go=).
Comment 13 Jonathan Matthew 2011-07-18 12:23:10 UTC
Something like this went in as part of commit 90b7496.  This is all we can do.