GNOME Bugzilla – Bug 729988
gio-gvfs on Windows: Don't mishandle other non-native URIs in gwinhttpvfs.c
Last modified: 2018-05-24 16:32:05 UTC
Hi, As we don't have a GVFS add-on module for Windows at this time, and as g_check_setuid() always returns FALSE on non-unix, we would always use the local version of g_file_new_for_uri(), which would return strings like the following when we are running the g-icon test program in GIO: GLib-GIO:ERROR:g-icon.c:86:test_g_icon_to_string: assertion failed (data == "sft p:///some/non-native/path/to/an/icon.png"): ("c:\\gnome.build.unstable\\glib-2.4 1.0\\gio\\tests\\sftp:\\some\\non-native\\path\\to\\an\\icon.png" == "sftp:///so me/non-native/path/to/an/icon.png") Which means that the native path is used for all paths, even those that are really non-native paths.
Created attachment 276364 [details] [review] gio/gvfs.c: Use g_vfs_get_locale() for the default GVFS implementation on Windows Hi, This is my proposed solution for this issue, for the time being, until if and when we do have a GVFS module for Windows. This would allow the non-native paths to be handled correctly on Windows, which would allow the g-icon test program to pass on Windows. With blessings, thank you!
Sorry, the short description should have read "gio/gvfs.c: Use g_vfs_get_local() for the default GVFS implementation on Windows"
Created attachment 283250 [details] [review] gwinhttpvfs.c: Don't mishandle non-native URIs Hi, Apparently there is already a VFS handler for Windows included in GIO, albeit mainly for http/https (sorry). I have updated my patch to update gwinhttpvfs.c so that it will only use the fallback implementation when a URI is used for acquiring the local path only when using URIs that points to a local (native) file or a resource:// URI, and use the passed-in URI as-is otherwise. With blessings, thank you!
Created attachment 283251 [details] [review] gwinhttpvfs.c: Don't mishandle non-native URIs (simpler patch) Hi, Apparently the patch could be simplified a bit... With blessings, thank you!
Are you sure that's the right bug? The patch for it touches only code inside gio/win32/, and the bug I'm seeing happens on Linux.
(Oops, commented on the wrong bug somehow, sorry! This was meant for bug 793014.)
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/875.