GNOME Bugzilla – Bug 598206
Nautilus cannot write to shared Vista/Win7 folders with read-only attribute set
Last modified: 2011-09-08 14:33:55 UTC
Expectation: To be able to share a folder on a Vista/Win7 PC and have full read/write access to that folder from a Ubuntu PC via the Nautilus file manager. Actual result: Nautilus cannot gain write access to shared Vista/Win7 folders that contain a desktop.ini file. Steps to reproduce: 1. Right-click a newly created folder on a Vista/Win7 PC and select "Share with". 2. Use the following dialog to grant network users write access to the folder. At this stage the folder is empty and Nautilus can successfully write to the folder. 3. Right-click the same Vista/Win7 folder and navigate to the "Customize" tab. 4. From the "Optimize this folder..." drop-down menu pick any of the available options. This will add a Windows system file called "desktop.ini" to the folder. 5. Go to a Ubuntu 9.04 PC and browse to the Vista/Win7 PC using the "Network" option in the "Places" menu in Nautilus. 6. Double-click the Vista/Win7 folder you shared to mount it. 7. Attempt to create a new folder or file within the shared folder. Access will be denied. Interesting notes: If you go to the ~/.gvfs path via command line and browse to the same mounted network share you will have write access via command line. This same issue occurs with the smb4k program in KDE4, but not the built-in Samba server browser in Konqueror. Newly-created shared folders on a Vista/Win7 PC that do not contain a desktop.ini file can be successfully written to with Nautilus. ProblemType: Bug Architecture: amd64 DistroRelease: Ubuntu 9.04 ExecutablePath: /usr/bin/nautilus Package: nautilus 1:2.26.2-0ubuntu2 ProcEnviron: PATH=(custom, user) LANG=en_US.UTF-8 SHELL=/bin/bash SourcePackage: nautilus Uname: Linux 2.6.28-15-generic x86_64 Tested on Ubuntu 9.04 and 9.10 beta. Link to Ubuntu Launchpad bug report: https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/447695
I'd like to clarify step #3. It should read: 3. Right-click the same Vista/Win7 folder, select "Properties", and navigate to the "Customize" tab.
After further investigation, it seems that the existence of desktop.ini is not the root cause. When a desktop.ini file is created after Windows folder customization, the folder in question is also given the read-only attribute by Windows. Windows and its applications generally ignore this flag, yet Nautilus honors it and disallows write access. Here's a Microsoft document which describes this behavior: http://support.microsoft.com/kb/326549/ The attrib -r command can be used to disable the read-only flag and write to the folders, but then the folder customization settings are lost, so the issue is ongoing.
-> gvfs-smb It's probably the smb backend or the smb library itself to honor the setting here, not Nautilus. Maybe we should really ignore it, as Windows intentionally ignores it as well.
Thanks for the info and for moving this bug to the proper place Cosimo. And I agree; regardless of how strange it is for Windows to set meaningless read-only flags, it would be great if we could ignore those flags and allow these folders to be fully accessed.
I have the same problem with some directories in shared smb-homes on a NetApp filer by accessing via gvfs-smb. The directories has all the same features, the DOS attrib +R (read only). I think, the global setting of ACCESS_WRITE = FALSE for any items with !S_IWUSR in the function set_info_from_stat() in gvfsbackendsmb.c is wrong. After additional checking for regular files shows nautilus this directories not as readonly and i can copy and touch anything into it. But i can't delete this directories. I append my patch.
Created attachment 195966 [details] [review] resolve the wrong write permissions on readonly-smb-directories
Fair enough, thanks for finding this out. Further access denials caused by readonly attributes will be handled by respective operations anyway. commit f07c7d98975809785dc28ad0944e0d9fd70624c1 Author: Andreas Heik <andreas.heik@hrz.tu-chemnitz.de> Date: Thu Sep 8 16:26:03 2011 +0200 smb: Ignore read-only attribute for directories According to Microsoft Knowledge Base article the read-only attribute on a folder is being usually ignored by the system and applications. Let's ignore it in gvfs to avoid compatibility issues. http://support.microsoft.com/kb/326549/ https://bugzilla.gnome.org/show_bug.cgi?id=598206