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 385085 - SMB method should respect SLOW_MIME_TYPE
SMB method should respect SLOW_MIME_TYPE
Status: RESOLVED FIXED
Product: gnome-vfs
Classification: Deprecated
Component: Module: smb
2.16.x
Other All
: Normal normal
: ---
Assigned To: gnome-vfs maintainers
gnome-vfs maintainers
Depends on:
Blocks:
 
 
Reported: 2006-12-12 15:23 UTC by Federico Mena Quintero
Modified: 2006-12-18 17:36 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
gnome-vfs2-385085-smb-method-sniff-mime-type.diff (1.04 KB, patch)
2006-12-12 15:27 UTC, Federico Mena Quintero
none Details | Review

Description Federico Mena Quintero 2006-12-12 15:23:10 UTC
Create a JPEG file and rename it to "picture", without an extension.  If it's on a file:/// volume, you can double-click on it in Nautilus and it will get opened properly.  However, if the file is on an smb:/// volume, Nautilus will tell you that it can't open the file.

This happens because smb-method.c only does "fast" MIME checking, based on the filename extension.  If the file doesn't have an extension, the method simply returns "application/octet-stream".

The attached patch makes smb-method.c pay attention to the GnomeVFSFileInfo flags, so that requesting GNOME_VFS_FILE_INFO_FORCE_SLOW_MIME_TYPE will actually sniff the file.  With the patch, Nautilus can open that "picture" file just fine on SMB volumes.
Comment 1 Federico Mena Quintero 2006-12-12 15:27:04 UTC
Created attachment 78209 [details] [review]
gnome-vfs2-385085-smb-method-sniff-mime-type.diff
Comment 2 Federico Mena Quintero 2006-12-18 17:36:52 UTC
Committed to gnome-2-16 and HEAD.

2006-12-18  Federico Mena Quintero  <federico@novell.com>

	Fix http://bugzilla.gnome.org/show_bug.cgi?id=385085 (same as
	https://bugzilla.novell.com/show_bug.cgi?id=195269).  When opening
	SMB files with no extension or unknown extension, the proper MIME
	type doesn't get sniffed.

	* modules/smb-method.c (do_get_file_info): If we have
	GNOME_VFS_FILE_INFO_FORCE_SLOW_MIME_TYPE, then use
	gnome_vfs_get_mime_type_common() to cause the file to be sniffed.
	Otherwise, call gnome_vfs_mime_type_from_name_or_default() as
	usual.