Bug 1426299 - new "gio open 'URL'" in xdg-open fails where old "gvfs-open 'URL'" succeeds
Summary: new "gio open 'URL'" in xdg-open fails where old "gvfs-open 'URL'" succeeds
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: glib2
Version: 27
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Matthias Clasen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-02-23 16:07 UTC by Jason Farrell
Modified: 2018-11-30 18:14 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-11-30 18:14:33 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
FreeDesktop.org 99063 0 None None None 2017-02-23 16:30:15 UTC
GNOME Bugzilla 779182 0 None None None 2019-04-06 08:32:15 UTC

Description Jason Farrell 2017-02-23 16:07:52 UTC
After updating to xdg-utils-1.1.1-5.fc25 (from 1.1.1-4) a few days ago I noticed that I'm no longer able to open magnet:// torrent links (and probably others, too) from my browser in the deluge torrent client. dnf downgrading to 1.1.1-4 restores functionality.

The reason why it's broken appears to be because the new xdg-open script is now preferring to pass on the url, if gnome desktop, by using 'gio open "$1"' first, and not the tried and true 'gvfs-open "$1"'.

To reproduce, click on a torrent magnet link in your browser while deluge is open, and note that it isn't added in -5, but that it is in -4.

To reproduce more simply, compare the results of using both:
  gio open 'magnet:?xt=urn:btih:4a2949503b4659bff934264fac785ceec637978a'
  gvfs-open 'magnet:?xt=urn:btih:4a2949503b4659bff934264fac785ceec637978a'

gvfs-open works; gio open doesn't, so either gio or deluge needs fixing, and/or xdg-open should use the more reliable gvfs-open in the meantime.

(btw: the magnet link above points at a legal Alice in Wonderland eBook.)

Comment 1 Rex Dieter 2017-02-23 16:28:10 UTC
triaging to glib2, for maintainer comment/advice on using gio here or not

Comment 2 Rex Dieter 2017-02-23 16:30:16 UTC
See also upstream bug,
https://bugs.freedesktop.org/show_bug.cgi?id=99063

on more background why the change was made (cc'ing patch submitter too)

Comment 3 Ondrej Holy 2017-02-24 13:06:10 UTC
gio tool should be more-or-less just a merge of all gvfs-* utils. It is possible that some latest gvfs-* utils changes are not part of gio tool. It seems that gio tool needs something like the following:
https://bugzilla.gnome.org/show_bug.cgi?id=738690

I will take a look...

Comment 4 Ondrej Holy 2017-02-24 15:09:38 UTC
I've filed the following bug report and proposed fix for it:
https://bugzilla.gnome.org/show_bug.cgi?id=779182

Comment 5 Jason Farrell 2017-07-12 18:47:55 UTC
Thanks Ondrej, but gio is still broken in F26.

For magnet links and some other 'unknown' URIs, the situation is worse now since the workaround no longer works. The workaround was forcing the xdg-open script to use gvfs-open instead of gio open, but because gvfs-open is now a shellscript stub that redirects to gio, there's no going back to what works as you warned in your comment on 2/2017 -> https://bugzilla.gnome.org/show_bug.cgi?id=779182#c5

Since upstream isn't fixing it, would it be possible to get a fedora patch that simply passes unknown schema URIs on untouched instead of attempting to rewrite and mangle them?

Thanks.

Comment 6 Jason Farrell 2017-07-13 02:34:21 UTC
FWIW, xdg-open's open_generic() still opens magnet links correctly, so here's the special-case workaround I'm using to get things back to normal in gnome3 (at least until it's overwritten by the next xdg-utils update and/or fixed gio in glib2):


--- xdg-open.orig	2017-02-06 20:32:38.000000000 -0500
+++ xdg-open	2017-07-12 22:23:39.812747920 -0400
@@ -607,7 +607,12 @@
 open_gnome3()
 {
     if gio help open 2>/dev/null 1>&2; then
-        gio open "$1"
+	# gio mangles magnet links, so use generic open instead
+	if [ "${1:0:6}" == "magnet" ]; then
+            open_generic "$1"
+	else
+            gio open "$1"
+	fi
     elif gvfs-open --help 2>/dev/null 1>&2; then
         gvfs-open "$1"
     else

Comment 7 Jason Farrell 2017-11-16 00:32:45 UTC
magnet + deluge still broken ootb in F27. Continuing to use workaround instead.

Comment 8 Ondrej Holy 2017-11-16 08:09:43 UTC
It is going to be fixed in glib-2.54.3, see the upstream bug.

Comment 9 Ben Cotton 2018-11-27 18:14:18 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 10 Ben Cotton 2018-11-30 18:14:33 UTC
Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.