GNOME Bugzilla – Bug 154670
Crash when opening Windows Network
Last modified: 2004-12-22 21:47:04 UTC
Nautilus segfaults when I open Windows Network. See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=275153. Forget about smb.conf, that was a red herring. The reason turned out to be that directory_load_one in nautilus-directory-async.c was being called with info != NULL but info->name == NULL. It went on to call is_dot_or_dot_dot(NULL), which segfaults.
Created attachment 32282 [details] [review] Patch to fix the bug Tested here. Windows Network opened and looks OK.
Similar patch commited, but the interesting part is why it returned NULL in info->name when doing the readdir().
So this bug can be closed?
I can reproduce info->name becoming NULL by doing gnomevfs-ls smb:/// on this particular network. The entry with NULL comes at the end of the list, i.e, $ gnomevfs-ls smb:/// ... vale (Regular, application/x-desktop) size 0 mode 0000 (null) (Regular, application/x-desktop) size 0 mode 0000 Here's a backtrace:
+ Trace 50844
corba_info->name is "" at this point, and we call decode_corba_string_or_null (corba_info->name, TRUE), converting "" to NULL
Is the "" a bug? Should I try to debug inside gnome-vfs-daemon. If so, where do I start?
Yeah. Please try. We shouldn't be returining files with empty names. Thats not a valid filename.
do_read_directory in smb-method.c receives a DirectoryHandle which looks like this: {workgroups = 0x8063c84, dir = 0x0, path = 0x0} workgroups contains a single element, which is the string ""
And that directory handle results from a libsmbclient smb_context->readdir call which returns {smbc_type = 1, dirlen = 32, commentlen = 6, comment = 0x809f2ea "NOMAD", namelen = 1, name = ""} Whatever the reason, it looks like gnome-vfs better be prepared to handle this.
The packet on the wire agrees exactly with smb_context->readdir. Here's the Ethereal dissection of the corresponding entry in the NetServerEnum2 Response from the smb server: Server Name: "" Major Version: 0 Minor Version: 0 Server Type: 0x80001000 Server Comment: "NOMAD"
cvs ignores "" names.
It was simply a Debian machine with a blank workgroup entry in smb.conf