GNOME Bugzilla – Bug 353251
Better handling of null paths
Last modified: 2008-11-15 19:45:41 UTC
Please describe the problem: gnome-keyring is unable to provide an application's executable path in all platforms different than Linux and FreeBSD. Because of this, the gnome_keyring_item_ac_get_path_name returns a NULL pointer which was causing gnome-keyring-manager 2.14.0 to crash under NetBSD. The crash happened in the gkm_acl_display_set_acl function. This seems to be resolved somewhat in CVS head because the code now ensures that one of the parameters passed to a g_str_equal call is not NULL. To be really safe it should check that both parameters are not NULL before the call; after all gnome-keyring could return one correctly but fail for the other. This is what the attached patch does. Furthermore the patch also makes the dialog show an "Unknown" string in the "Path:" field instead of leaving it empty. I believe this is better than not showing anything because it gives a better idea of what is going on. Steps to reproduce: 1. Install gnome-keyring-manager under NetBSD. 2. Depending on the version, see it crash or not show the application's path name at all. Actual results: Expected results: Does this happen every time? Other information:
Created attachment 71779 [details] [review] Proposed patch.
Instead of displaying simply «Unknown», a slightly better UI could be achieved by simply storing NULLs in the model for unknown paths, and setting up a cell data function (using gtk_tree_view_column_set_cell_data_func) on the Path column for the TreeView, so that NULLs there get rendered with the string «Unknown» (or maybe «Not available»?) in the insensitive color. The cell data func should check for NULL in the model's column, and when it sees a NULL, set the foreground property of the cell renderer to the insensitive color (which you can get from the TreeView using gtk_widget_get_style, and looking at the text[INSENSITIVE] field of the resulting GtkStyle)
gnome-keyring-manager has been deprecated and superseded by Seahorse more than one year ago. There has not been any active code development for more than a year. This bug will probably soon be closed as WONTFIX or OBSOLETE.
Thanks for taking the time to report this bug. However, gnome-keyring-manager won't be developed anymore and it has been superseded by Seahorse.