Your message dated Sun, 15 Jan 2012 11:18:05 +0000
with message-id <[email protected]>
and subject line Bug#654863: fixed in xdg-utils 1.1.0~rc1+git20111210-5
has caused the Debian Bug report #654863,
regarding xdg-open: fails with URLs containing ampersands
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
654863: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=654863
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: xdg-utils
Version: 1.1.0~rc1+git20111210-4
Severity: normal
Tags: patch
Dear Maintainer,
When trying to open an HTTP(S) URL containing ampersands with xdg-open,
it fails. Rather than passing the given URL to the browser, it replaces
ampersands with '%u' (which becomes %25u, once URL-encoded).
For example,
xdg-open "https://www.google.com/search?q=grail&ie=utf-8"
opens "https://www.google.com/search?q=grail%uie=utf-8" instead,
searching for 'grail%uie=utf-8' instead of searching for 'grail'.
Investigating a bit, I found the problem to be at line 552 of xdg-open:
arguments_exec="`echo $arguments | sed -e 's*%[fFuU]*"'"$1"'"*g'`"
In our case, $arguments contains '%u'. The problem is with the sed
expression, which uses $1 (our URL) without escaping ampersands in it.
In the replacement part of a sed expression, an unescaped & stands for
the portion of the pattern that matched. In our case, every & in the URL
is thus replaced by a '%u'.
As a quick fix, I modified mine as follows:
escaped="`echo $1 | sed -e 's/&/\\\&/g'`"
arguments_exec="`echo $arguments | sed -e 's*%[fFuU]*"'"$escaped"'"*g'`"
This allows me to open HTTP URLs with ampersands as expected. However, I
give it more as an illustration of the problem than as a serious fix
proposal:
- It may not be the most elegant way to fix it.
- It may be necessary also in other places.
- It is necessary also for other characters. E.g.
xdg-open "https://www.google.com/search?q=grail\1"
fails with the message
sed: -e expression #1, char 53: invalid reference \1 on `s' command's RHS
instead of opening the URL.
-- System Information:
Debian Release: wheezy/sid
APT prefers testing
APT policy: (800, 'testing'), (700, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 3.1.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
xdg-utils depends on no packages.
Versions of packages xdg-utils recommends:
ii libfile-mimeinfo-perl 0.15-2
ii libnet-dbus-perl 1.0.0-1+b1
ii libx11-protocol-perl 0.56-2
ii x11-utils 7.6+4
ii x11-xserver-utils 7.6+3
Versions of packages xdg-utils suggests:
ii gvfs-bin 1.10.1-2
-- no debconf information
--- xdg-open 2012-01-06 12:12:54.078811539 +0100
+++ xdg-open.new 2012-01-06 12:10:44.149866844 +0100
@@ -549,7 +549,8 @@
command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`"
command_exec=`which $command 2>/dev/null`
arguments="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | last_word`"
- arguments_exec="`echo $arguments | sed -e 's*%[fFuU]*"'"$1"'"*g'`"
+ escaped="`echo $1 | sed -e 's/&/\\\&/g'`"
+ arguments_exec="`echo $arguments | sed -e 's*%[fFuU]*"'"$escaped"'"*g'`"
if [ -x "$command_exec" ] ; then
if echo $arguments | grep -iq '%[fFuU]' ; then
eval $command_exec $arguments_exec
--- End Message ---
--- Begin Message ---
Source: xdg-utils
Source-Version: 1.1.0~rc1+git20111210-5
We believe that the bug you reported is fixed in the latest version of
xdg-utils, which is due to be installed in the Debian FTP archive:
xdg-utils_1.1.0~rc1+git20111210-5.debian.tar.gz
to main/x/xdg-utils/xdg-utils_1.1.0~rc1+git20111210-5.debian.tar.gz
xdg-utils_1.1.0~rc1+git20111210-5.dsc
to main/x/xdg-utils/xdg-utils_1.1.0~rc1+git20111210-5.dsc
xdg-utils_1.1.0~rc1+git20111210-5_all.deb
to main/x/xdg-utils/xdg-utils_1.1.0~rc1+git20111210-5_all.deb
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Per Olofsson <[email protected]> (supplier of updated xdg-utils package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.8
Date: Sun, 15 Jan 2012 12:01:31 +0100
Source: xdg-utils
Binary: xdg-utils
Architecture: source all
Version: 1.1.0~rc1+git20111210-5
Distribution: unstable
Urgency: low
Maintainer: Per Olofsson <[email protected]>
Changed-By: Per Olofsson <[email protected]>
Description:
xdg-utils - desktop integration utilities from freedesktop.org
Closes: 654306 654863
Changes:
xdg-utils (1.1.0~rc1+git20111210-5) unstable; urgency=low
.
* Add patch xdg-open-escape-sed.diff: Escape the sed replacement string
in xdg-open when replacing command arguments for the generic
method. Fixes issue with the '&' character in URLs.
Thanks to Cyril Soldani. Closes: #654863.
* Bump debhelper compat level to v8.
* Add patch no-X.diff: Make xdg-open and xdg-email work without an X
display. Closes: #654306.
* Modify xdg-email-mutt-detect.diff so that it only tries to run mutt
inside a terminal window if running under X.
Checksums-Sha1:
90b31a48eaa5b1187a01114d542304c117c1f849 1374
xdg-utils_1.1.0~rc1+git20111210-5.dsc
99ddf29ccdb92ecdb93f37c77f3b974061b4ebe0 9544
xdg-utils_1.1.0~rc1+git20111210-5.debian.tar.gz
f4164f9efcbaa6332156cb3858f7559f68362639 83584
xdg-utils_1.1.0~rc1+git20111210-5_all.deb
Checksums-Sha256:
9ec688d61862cab00efb838214c7253bfe026616693b8737bcdf8f8664dbcd52 1374
xdg-utils_1.1.0~rc1+git20111210-5.dsc
41ac684e5d72f63c047789f45e938ebc3de2c4e3d11571db90a288ac0cb22a8f 9544
xdg-utils_1.1.0~rc1+git20111210-5.debian.tar.gz
bdf8ccbdf585ff8d3bddfa9a2021b32624a06d1186f6931eb3616c5ebfb55d1a 83584
xdg-utils_1.1.0~rc1+git20111210-5_all.deb
Files:
04accf003761821724b2ab26e322b942 1374 utils optional
xdg-utils_1.1.0~rc1+git20111210-5.dsc
270a47f2752887abeaddbea820a30c2d 9544 utils optional
xdg-utils_1.1.0~rc1+git20111210-5.debian.tar.gz
8d9ecaed527f9e8366c71a883220122e 83584 utils optional
xdg-utils_1.1.0~rc1+git20111210-5_all.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iEYEARECAAYFAk8SswgACgkQeDAsS42/7C940QCfX8LJFqKBld43m9k6KflEIkSS
kVAAniXyr8iUKLDStW4OWVgbnX1a9z4d
=jhTL
-----END PGP SIGNATURE-----
--- End Message ---