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 167102 - Copying files from cdroms sets the copies' permissions to read-only
Copying files from cdroms sets the copies' permissions to read-only
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: File and Folder Operations
2.14.x
Other All
: High normal
: ---
Assigned To: Christian Neumair
gnome-vfs maintainers
: 159104 334895 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-02-11 17:35 UTC by Sebastian Urban
Modified: 2006-03-20 16:57 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
Proposed patch (5.20 KB, patch)
2006-03-09 22:24 UTC, Christian Neumair
committed Details | Review

Description Sebastian Urban 2005-02-11 17:35:22 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:
Comment 1 Sebastien Bacher 2005-02-11 23:21:26 UTC
gnomevfs issue, reassigning
Comment 2 Christian Kellner 2005-02-11 23:33:39 UTC
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.
Comment 3 Sebastien Bacher 2005-05-08 21:31:11 UTC
*** Bug 159104 has been marked as a duplicate of this bug. ***
Comment 4 Christian Neumair 2005-05-09 18:20:46 UTC
I can still verify this issue on HEAD. Christian: Are there any situations in
which using the environment umask for copies could cause problems?
Comment 5 Baldvin Kovacs 2005-12-23 22:07:25 UTC
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.
Comment 6 Bastien Nocera 2005-12-23 22:22:22 UTC
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.
Comment 7 Allison Karlitskaya (desrt) 2005-12-24 04:13:54 UTC
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.
Comment 8 Christian Neumair 2005-12-25 11:11:59 UTC
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/ ?
Comment 9 Christian Neumair 2006-03-09 22:24:05 UTC
Created attachment 61008 [details] [review]
Proposed patch

Short info under http://mail.gnome.org/archives/nautilus-list/2006-March/msg00041.html
Comment 10 Christian Neumair 2006-03-09 22:25:00 UTC
Reassigning to Nautilus, setting BLOCKED_BY_FREEZE keyword.
Comment 11 Christian Kirbach 2006-03-18 12:08:27 UTC
*** Bug 334895 has been marked as a duplicate of this bug. ***
Comment 12 Christian Kirbach 2006-03-18 12:15:30 UTC
still there with 2.14

This has annoyed me as well, raising priority

nice patch Manny
Comment 13 Christian Neumair 2006-03-20 16:57:25 UTC
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.