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 597310 - Couldn't import keys (bad format) - filetype detection broken?
Couldn't import keys (bad format) - filetype detection broken?
Status: RESOLVED FIXED
Product: seahorse
Classification: Applications
Component: general
2.28.x
Other Linux
: Normal critical
: 2.26.0
Assigned To: Seahorse Maintainer
Seahorse Maintainer
Depends on:
Blocks:
 
 
Reported: 2009-10-04 15:10 UTC by Anders
Modified: 2012-03-15 10:20 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Anders 2009-10-04 15:10:47 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 ?
Comment 1 Adam Schreiber 2009-10-04 22:49:48 UTC
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.
Comment 2 Anders 2009-10-10 15:41:25 UTC
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?
Comment 3 Anders 2009-10-23 20:34:35 UTC
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
Comment 4 Stef Walter 2012-03-15 10:20:34 UTC
This has been fixed in 3.4 with new mime type detection and new import support.