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 729988 - gio-gvfs on Windows: Don't mishandle other non-native URIs in gwinhttpvfs.c
gio-gvfs on Windows: Don't mishandle other non-native URIs in gwinhttpvfs.c
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: gio
2.40.x
Other Windows
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-05-12 07:55 UTC by Fan, Chun-wei
Modified: 2018-05-24 16:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gio/gvfs.c: Use g_vfs_get_locale() for the default GVFS implementation on Windows (1.50 KB, patch)
2014-05-12 08:04 UTC, Fan, Chun-wei
none Details | Review
gwinhttpvfs.c: Don't mishandle non-native URIs (3.01 KB, patch)
2014-08-13 05:50 UTC, Fan, Chun-wei
none Details | Review
gwinhttpvfs.c: Don't mishandle non-native URIs (simpler patch) (2.67 KB, patch)
2014-08-13 06:03 UTC, Fan, Chun-wei
none Details | Review

Description Fan, Chun-wei 2014-05-12 07:55:53 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.
Comment 1 Fan, Chun-wei 2014-05-12 08:04:31 UTC
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!
Comment 2 Fan, Chun-wei 2014-05-12 08:05:28 UTC
Sorry, the short description should have read "gio/gvfs.c: Use g_vfs_get_local() for the default GVFS implementation on Windows"
Comment 3 Fan, Chun-wei 2014-08-13 05:50:48 UTC
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!
Comment 4 Fan, Chun-wei 2014-08-13 06:03:38 UTC
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!
Comment 5 Marius Gedminas 2018-01-30 08:53:28 UTC
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.
Comment 6 Marius Gedminas 2018-01-30 08:54:22 UTC
(Oops, commented on the wrong bug somehow, sorry!  This was meant for bug 793014.)
Comment 7 GNOME Infrastructure Team 2018-05-24 16:32:05 UTC
-- 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.