GNOME Bugzilla – Bug 597310
Couldn't import keys (bad format) - filetype detection broken?
Last modified: 2012-03-15 10:20:34 UTC
When I look in the sources on git.gnome.org the filetype detection looks broken to me. Has GDK changed to no longer use gvfs or something? Or am I looking in the wrong places? In https://bugs.launchpad.net/bugs/372608 i wrote: The mime-type checking that Seahorse uses does seem broken to me. http://git.gnome.org/cgit/seahorse/tree/libseahorse/seahorse-util.c#n793 which i think calls http://git.gnome.org/cgit/glib/tree/gio/gcontenttype.c#n319 which has no chance of returning eg. "application/x-ssh-key" Best Anders PS Is this a duplicate of https://bugzilla.gnome.org/show_bug.cgi?id=556299 ?
This is not a duplicate of bug #556299. You're looking in the wrong place in gcontenttype.c. You're in the #ifdef win32 section search for the second one and you'll see that on unixes mime type is returned. This would indeed be broken on win32 though.
Hi Adam, I think it is broken on Ubuntu too. But I don't know what exactly is broken then. I just tried anders@salt2:~/devel/gtktest$ cat test.c #include <gtk/gtk.h> #include <gio/gio.h> #include <glib/gstdio.h> int main( int argc, char *argv[] ){ gboolean uncertain; gchar *mime; mime = g_content_type_guess ("/home/anders/.ssh/id_dsa", NULL, 0, &uncertain); g_print ("%s \n", mime); return 0; } anders@salt2:~/devel/gtktest$ gcc test.c -o test `pkg-config --cflags --libs gtk+-2.0` anders@salt2:~/devel/gtktest$ ./test application/octet-stream anders@salt2:~/devel/gtktest$ xdg-mime query filetype ~/.ssh/id_dsa application/x-pem-key PS My xdg-mime is fixed to use gvfs-info - https://bugs.launchpad.net/ubuntu/+source/xdg-utils/+bug/376827 gnomevfs-info shows "MIME type : application/octet-stream". Is seahorse simply linked against the wrong library in Ubuntu?
Hi Adam, I tried a small program to test the function that Seahorse uses (g_content_type_guess). On my system it doesn't give the result I need for Seahorse to work (application/x-pem-key). Does it work on your system? Best Anders
This has been fixed in 3.4 with new mime type detection and new import support.