GNOME Bugzilla – Bug 339203
gnome_vfs_format_uri_for_display should not show the password or a new function is needed.
Last modified: 2018-08-17 13:46:34 UTC
Fixing bug #338173, I discovered that gnome_vfs_format_uri_for_display does not hide the password. May be it should hide it. Another solution could be to add a new _without_password function (like the gedit_utils_format_uri_for_display one I created for gedit).
Do you mean, for instance, the password in an ftp URI?
According to attachment 63972 [details] [review] from bug 338173 gedit uses { gchar *name; gchar *uri_for_display; name = gnome_vfs_uri_to_string (vfs_uri, GNOME_VFS_URI_HIDE_PASSWORD); g_return_val_if_fail (name != NULL, gnome_vfs_format_uri_for_display (uri)); uri_for_display = gnome_vfs_format_uri_for_display (name); g_free (name); gnome_vfs_uri_unref (vfs_uri); return uri_for_display; } This is exactly how the API is meant to be used. Of course it requires an existing GnomeVFSURI, but does that really pose a problem?
Yes, I think it is a problem since every app will have to write a function like gedit_utils_format_uri_for_display that takes a string, generate a VFSURI, regenerate a new string without password and then format the uri for display. I think showing a formatted uri without password is a more frequent use case than showing a formatted uri with the password. So, in order to avoid code duplication, I sugget to: - make clear in the documentation that gnome_vfs_format_uri_for_display does show the password (for example it was not clear to me before bug #338173 ) - add a _without_password variant of that function. Murray: yes, I mean the password in a FTP/SMB/etc. URI
gnome-vfs got deprecated in 2008. gnome-vfs is not under active development anymore and had its last code changes in 2011. Its codebase has been archived: https://gitlab.gnome.org/Archive/gnome-vfs/commits/master gio (in glib) and gvfs are its successors. See https://developer.gnome.org/gio/stable/ch33.html and https://people.gnome.org/~gicmo/gio-migration-guide/ for porting info. Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect reality. Feel free to open a task in GNOME Gitlab if the issue described in this task still applies to a recent + supported version of glib/gio/gvfs. Thanks!