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 599354 - gvfsd-smb copies directory as empty file (sles10 cifsd)
gvfsd-smb copies directory as empty file (sles10 cifsd)
Status: RESOLVED NOTGNOME
Product: gvfs
Classification: Core
Component: smb backend
1.4.x
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
: 515963 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-10-22 22:05 UTC by Mick K
Modified: 2014-05-31 20:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
cifsd server log during nautilus copy of "/resources/folder/" (17.09 KB, application/octet-stream)
2009-10-22 22:05 UTC, Mick K
Details

Description Mick K 2009-10-22 22:05:39 UTC
Created attachment 146067 [details]
cifsd server log during nautilus copy of "/resources/folder/"

Originally posted on launchpad
https://bugs.launchpad.net/ubuntu/+source/gvfs/+bug/288951

Problem occurs ubuntu 9.04 (i386 & amd64) & 9.10 beta (i386 & amd64)
(1.4.1-0ubuntu1)

When copying a directory from a gvfs smb mount , destination is created as an
empty file with the same name as src directory
Both nautilus copy and gvfs-copy create an empty file with the name of the src
directory
However using: "cp -r ~/.gvfs/share\ on\ server/folder /tmp" it does work
correctly

smb share is on a novell sles10 server (novell patches applied as of 1 october
09)
Have no problem with other samba shares - only seems to be with novells cifsd .
It might be their broken implementation, however there is no problems when
copying folders using cp or when share is mounted using mount.cifs so I am not
too sure

Please let me know if there is any further information I can provide at all.
Comment 1 Mikko A 2010-01-19 12:49:23 UTC
This happens with a newly installed Ubuntu 9.10 as well when trying to copy from a disk connected to an Apple Airport Extreme Base Station (bought January 2010). The Airport has been set up to share the disks with the Airport password, but with guest access on (r+w).

Ubuntu sees the disks under the Airport's name in Network, and can copy files from and to the disk without problems, but when trying to copy a folder from the disk, Nautilus pops up an error saying that the folder could not be copied (reason being "No such file or directory"). After telling Nautilus to skip the folder, in the receiving folder an empty file with the directory's name is created.

This can potentially lead to data loss (as it did in my case), because if there already is a folder with that name in the target dir, Nautilus asks if you want to merge, but due to this error, it does not merge, but instead _removes_ the target directory and replaces it with an empty file.

Copying from the command line with cp -r '~/.gvfs/hddname on router.local/...' '~/somedir' works without problems, as Mick K said.

I would attach a log of some kind, but I'm not sure how to do that.
Comment 2 Ross Lagerwall 2014-04-13 13:02:05 UTC
I have investigated the issue with Novell's cifsd that comes with OES 2 and OES 11.

Unexpectedly, they allow directories to be opened as files which then allows Nautilus to "copy" the directory.  In OES 2, it just acts like an empty file.  In OES 11, it allows the directory to be opened but then gives a permission denied error when trying to issue a read.
Comment 3 Ross Lagerwall 2014-04-13 15:06:17 UTC
After investigating further, this appears to be a server bug.

A wireshark trace shows that FILE_NON_DIRECTORY_FILE is correctly being sent to the server which requires the server to fail when opening a directory.  But Novell's cifsd is not failing and instead opening the directory...
Comment 4 Ross Lagerwall 2014-05-02 06:39:24 UTC
Reopening, since this also seems to affect Apple's new (and broken) smbdx.

Hopefully we can get libsmbclient to make a workaround rather than having a workaround in gvfs.
Comment 5 Ross Lagerwall 2014-05-04 20:51:44 UTC
https://bugzilla.samba.org/show_bug.cgi?id=10587
Comment 6 Jeremy Allison 2014-05-05 17:07:04 UTC
Can you get me a trace on this ? The workaround would be to detect the open
coming back with an attribute FILE_DIRECTORY, and then having the libsmbclient
close the returned handle and return -1,ENOTDIR in that that. But I really need
to see the wire traces first.

Jeremy.
Comment 7 Ross Lagerwall 2014-05-10 07:24:11 UTC
This has now been fixed upstream: see 2900dfa5b928e..b2ce2441a35e of Samba's master branch.

Thanks
Comment 8 Ross Lagerwall 2014-05-31 20:00:48 UTC
*** Bug 515963 has been marked as a duplicate of this bug. ***