GNOME Bugzilla – Bug 167102
Copying files from cdroms sets the copies' permissions to read-only
Last modified: 2006-03-20 16:57:25 UTC
Please describe the problem: On a cdrom files a marked read only, i.e. r-xr-xr-x. This is correct as data on cdroms cannot be altered. However when copying the contents of a cdrom to the hard drive, permissions should be automatically changed to make these files/folders changeable. Steps to reproduce: 1. Insert a cdrom 2. Copy the contents of the cdrom into your home-directory using the gnome file manager Actual results: All copied files have permission r-xr-xr-x Expected results: All copied files should have permission rw------- and all copied directories rwx------ Does this happen every time? Yes! Other information:
gnomevfs issue, reassigning
The problem here is that gnome_vfs_xfer preserves the file permissions in the copy_file and copy_directory functions. Maybe we should respect the enivroment umask when _copying_ files.
*** Bug 159104 has been marked as a duplicate of this bug. ***
I can still verify this issue on HEAD. Christian: Are there any situations in which using the environment umask for copies could cause problems?
Unfortunately, yes. (Sorry, I'm not Christian). If somebody copied his .ssh directory to a .ssh-saved, and then later copied it back, then his private ssh keys coluld became readable by others. Then ssh actually stops respecting those keys... (Not to mention it creates a security risk.) I guess copying from read-only media should be treated separately, and be given a "writable by the user" flag, and that's all.
I would think that if the data comes from a read-only media (which gnome-vfs would know about) and the files don't have the readable bit set for the user, it should set it on the newly created files. That would solve the problem of read-only/recovery filesystems and changing permissions on sensitive files, yet make files copied from CDs writable by default.
IMHO it would be much easier and less hackish to just get the kernel to assign the correct permissions to files on the CD-ROM drive but keep it as a read-only mount. This would cause it to behave in exactly the same way as having normal-mode files on a read-only ext3 filesystem and would prevent a regression caused by copying restricted-mode files from an ext3 filesystem. It would also prevent messing up permissions when copying from rock-ridge CDs. The iso9660 filesystem supports the mode= switch to manually assign file modes for the non-rock-ridge case. This should be used! As far as I can tell, unfortunately, no such switch exists for setting the directory mode but this would be a very small fix to the kernel. This is very likely NOTGNOME.
Updating version. Ryan: You seem to know the kernel details wrt read-only media quiet well, maybe you could forward the request to http://bugzilla.kernel.org/ ?
Created attachment 61008 [details] [review] Proposed patch Short info under http://mail.gnome.org/archives/nautilus-list/2006-March/msg00041.html
Reassigning to Nautilus, setting BLOCKED_BY_FREEZE keyword.
*** Bug 334895 has been marked as a duplicate of this bug. ***
still there with 2.14 This has annoyed me as well, raising priority nice patch Manny
Patch was committed, closing. Distributors, users: You'll have to upgrade to GnomeVFS/Nautilus 2.14 and use either HAL HEAD, or the HAL patch from http://mail.gnome.org/archives/nautilus-list/2006-March/msg00045.html to make this work as expected.