Bug 49970 - xdg-open has IFS problems opening URLs
Summary: xdg-open has IFS problems opening URLs
Status: RESOLVED DUPLICATE of bug 45859
Alias: None
Product: Portland
Classification: Unclassified
Component: xdg-utils (show other bugs)
Version: 1.1.0 rc3
Hardware: All Linux (All)
: medium normal
Assignee: Portland Bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 34915
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-15 13:34 UTC by Leho Kraav (:macmaN :lkraav)
Modified: 2014-12-23 23:18 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Leho Kraav (:macmaN :lkraav) 2012-05-15 13:34:50 UTC
Sat May 12 11:44:54 2012 <<< x11-misc/xdg-utils-1.1.0_rc1_p20111003
Sat May 12 11:44:55 2012 >>> x11-misc/xdg-utils-1.1.0_rc1_p20120319

This patch level upgrade has broken xdg-open on my Gentoo. Looking at source code, it seems the failure is correct, because IFS is indeed ":" and we're trying to eval, which will break the a string like "http://whatever" into two.

Looking at blame, commit 18ec7702 by Rex seems to be the culprit.

http://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=18ec77025e4de0d52cf3e4934c99ffbdb03984f7

Not sure what exactly we should do here. Kill IFS=":" or go back to non-eval?

==> /home/leho/.tail/awesome-leho <==
+ check_common_commands 'http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ '[' 1 -gt 0 ']'
+ parm='http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ shift
+ case "$parm" in
+ '[' 0 -gt 0 ']'
+ '[' -z '' ']'
+ unset XDG_UTILS_DEBUG_LEVEL
+ '[' 0 -lt 1 ']'
+ xdg_redirect_output=' > /dev/null 2> /dev/null'
+ '[' 'xhttp://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4' '!=' x ']'
+ url=
+ '[' 1 -gt 0 ']'
+ parm='http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ shift
+ case "$parm" in
+ '[' -n '' ']'
+ url='http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ '[' 0 -gt 0 ']'
+ '[' -z 'http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4' ']'
+ detectDE
+ unset GREP_OPTIONS
+ '[' -n '' ']'
+ '[' x = x ']'
+ '[' x = xtrue ']'
+ '[' x '!=' x ']'
+ '[' x '!=' x ']'
++ dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager
+ xprop -root _DT_SAVE_MODE
+ grep ' = \"xfce4\"$'
+ xprop -root
+ grep -i '^xfce_desktop_window'
+ '[' x = x ']'
+ case "$DESKTOP_SESSION" in
+ '[' x = x ']'
+ case "$(uname 2>/dev/null)" in
++ uname
+ '[' x = xgnome ']'
+ '[' x = x ']'
+ DE=generic
+ DEBUG 2 'Selected DE generic'
+ '[' -z '' ']'
+ return 0
+ '[' x = x ']'
+ BROWSER=links2:elinks:links:lynx:w3m
+ '[' -n :0 ']'
+ BROWSER=x-www-browser:firefox:seamonkey:mozilla:epiphany:konqueror:chromium-browser:google-chrome:links2:elinks:links:lynx:w3m
+ case "$DE" in
+ open_generic 'http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ echo 'http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ grep -q '^file://'
+ echo 'http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ egrep -q '^[[:alpha:]+\.\-]+:'
+ open_generic_xdg_x_scheme_handler 'http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
++ sed -n 's/\(^[[:alnum:]+\.-]*\):.*$/\1/p'
++ echo 'http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ scheme=http
+ '[' -n http ']'
+ filetype=x-scheme-handler/http
+ open_generic_xdg_mime 'http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4' x-scheme-handler/http
+ filetype=x-scheme-handler/http
++ xdg-mime query default x-scheme-handler/http
+ default=userapp-Firefox-NZFJ3V.desktop
+ '[' -n userapp-Firefox-NZFJ3V.desktop ']'
+ xdg_user_dir=
+ '[' -n '' ']'
+ xdg_user_dir=/home/leho/.local/share
+ xdg_system_dirs=/usr/local/share:/usr/share
+ '[' -n /usr/local/share:/usr/share ']'
+ DEBUG 3 /home/leho/.local/share:/usr/local/share:/usr/share
+ '[' -z '' ']'
+ return 0
++ echo /home/leho/.local/share:/usr/local/share:/usr/share
++ sed 's/:/ /g'
+ for x in '`echo "$xdg_user_dir:$xdg_system_dirs" | sed '\''s/:/ /g'\''`'
+ search_desktop_file userapp-Firefox-NZFJ3V.desktop /home/leho/.local/share/applications/ 'http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ local default=userapp-Firefox-NZFJ3V.desktop
+ local dir=/home/leho/.local/share/applications/
+ local 'arg=http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ local file=
+ '[' -r /home/leho/.local/share/applications//userapp-Firefox-NZFJ3V.desktop ']'
+ file=/home/leho/.local/share/applications//userapp-Firefox-NZFJ3V.desktop
+ '[' -r /home/leho/.local/share/applications//userapp-Firefox-NZFJ3V.desktop ']'
++ grep -E '^Exec(\[[^]=]*])?=' /home/leho/.local/share/applications//userapp-Firefox-NZFJ3V.desktop
++ cut -d= -f 2-
++ first_word
++ read first rest
++ echo /usr/lib/firefox/firefox
+ command=/usr/lib/firefox/firefox
++ which /usr/lib/firefox/firefox
+ command_exec=
++ grep -E '^Exec(\[[^]=]*])?=' /home/leho/.local/share/applications//userapp-Firefox-NZFJ3V.desktop
++ cut -d= -f 2-
++ last_word
++ read first rest
++ echo %u
+ arguments=%u
++ sed 's/&/\\&/g'
++ echo 'http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ arg_one='http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
++ echo %u
++ sed -e 's*%[fFuU]*"http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4"*g'
+ arguments_exec='"http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4"'
+ '[' -x '' ']'
+ for d in '$dir/*/'
+ '[' -d /home/leho/.local/share/applications//wine/ ']'
+ search_desktop_file userapp-Firefox-NZFJ3V.desktop /home/leho/.local/share/applications//wine/ 'http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ local default=userapp-Firefox-NZFJ3V.desktop
+ local dir=/home/leho/.local/share/applications//wine/
+ local 'arg=http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ local file=
+ '[' -r /home/leho/.local/share/applications//wine//userapp-Firefox-NZFJ3V.desktop ']'
++ echo userapp-Firefox-NZFJ3V.desktop
++ sed -e 's|-|/|'
+ '[' -r /home/leho/.local/share/applications//wine//userapp/Firefox-NZFJ3V.desktop ']'
+ '[' -r '' ']'
+ for d in '$dir/*/'
+ '[' -d /home/leho/.local/share/applications//wine//Programs/ ']'
+ search_desktop_file userapp-Firefox-NZFJ3V.desktop /home/leho/.local/share/applications//wine//Programs/ 'http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ local default=userapp-Firefox-NZFJ3V.desktop
+ local dir=/home/leho/.local/share/applications//wine//Programs/
+ local 'arg=http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ local file=
+ '[' -r /home/leho/.local/share/applications//wine//Programs//userapp-Firefox-NZFJ3V.desktop ']'
++ echo userapp-Firefox-NZFJ3V.desktop
++ sed -e 's|-|/|'
+ '[' -r /home/leho/.local/share/applications//wine//Programs//userapp/Firefox-NZFJ3V.desktop ']'
+ '[' -r '' ']'
+ for d in '$dir/*/'
+ '[' -d '/home/leho/.local/share/applications//wine//Programs//Administrative Tools/' ']'
+ search_desktop_file userapp-Firefox-NZFJ3V.desktop '/home/leho/.local/share/applications//wine//Programs//Administrative Tools/' 'http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ local default=userapp-Firefox-NZFJ3V.desktop
+ local 'dir=/home/leho/.local/share/applications//wine//Programs//Administrative Tools/'
+ local 'arg=http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ local file=
+ '[' -r '/home/leho/.local/share/applications//wine//Programs//Administrative Tools//userapp-Firefox-NZFJ3V.desktop' ']'
++ echo userapp-Firefox-NZFJ3V.desktop
++ sed -e 's|-|/|'
+ '[' -r '/home/leho/.local/share/applications//wine//Programs//Administrative Tools//userapp/Firefox-NZFJ3V.desktop' ']'
+ '[' -r '' ']'
+ for d in '$dir/*/'
+ '[' -d /home/leho/.local/share/applications//wine//Programs//Administrative ']'
+ for d in '$dir/*/'
+ '[' -d 'Tools//*/' ']'
+ for d in '$dir/*/'
+ '[' -d '/home/leho/.local/share/applications//wine//Programs//Google SketchUp 8/' ']'
+ search_desktop_file userapp-Firefox-NZFJ3V.desktop '/home/leho/.local/share/applications//wine//Programs//Google SketchUp 8/' 'http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ local default=userapp-Firefox-NZFJ3V.desktop
+ local 'dir=/home/leho/.local/share/applications//wine//Programs//Google SketchUp 8/'
+ local 'arg=http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ local file=
+ '[' -r '/home/leho/.local/share/applications//wine//Programs//Google SketchUp 8//userapp-Firefox-NZFJ3V.desktop' ']'
++ echo userapp-Firefox-NZFJ3V.desktop
++ sed -e 's|-|/|'
+ '[' -r '/home/leho/.local/share/applications//wine//Programs//Google SketchUp 8//userapp/Firefox-NZFJ3V.desktop' ']'
+ '[' -r '' ']'
+ for d in '$dir/*/'
+ '[' -d /home/leho/.local/share/applications//wine//Programs//Google ']'
+ for d in '$dir/*/'
+ '[' -d SketchUp ']'
+ for d in '$dir/*/'
+ '[' -d '8//*/' ']'
+ for d in '$dir/*/'
+ '[' -d '/home/leho/.local/share/applications//wine//Programs//Picasa 3/' ']'
+ search_desktop_file userapp-Firefox-NZFJ3V.desktop '/home/leho/.local/share/applications//wine//Programs//Picasa 3/' 'http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ local default=userapp-Firefox-NZFJ3V.desktop
+ local 'dir=/home/leho/.local/share/applications//wine//Programs//Picasa 3/'
+ local 'arg=http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ local file=
+ '[' -r '/home/leho/.local/share/applications//wine//Programs//Picasa 3//userapp-Firefox-NZFJ3V.desktop' ']'
++ echo userapp-Firefox-NZFJ3V.desktop
++ sed -e 's|-|/|'
+ '[' -r '/home/leho/.local/share/applications//wine//Programs//Picasa 3//userapp/Firefox-NZFJ3V.desktop' ']'
+ '[' -r '' ']'
+ for d in '$dir/*/'
+ '[' -d /home/leho/.local/share/applications//wine//Programs//Picasa ']'
+ for d in '$dir/*/'
+ '[' -d '3//*/' ']'
+ for x in '`echo "$xdg_user_dir:$xdg_system_dirs" | sed '\''s/:/ /g'\''`'
+ search_desktop_file userapp-Firefox-NZFJ3V.desktop /usr/local/share/applications/ 'http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ local default=userapp-Firefox-NZFJ3V.desktop
+ local dir=/usr/local/share/applications/
+ local 'arg=http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ local file=
+ '[' -r /usr/local/share/applications//userapp-Firefox-NZFJ3V.desktop ']'
++ echo userapp-Firefox-NZFJ3V.desktop
++ sed -e 's|-|/|'
+ '[' -r /usr/local/share/applications//userapp/Firefox-NZFJ3V.desktop ']'
+ '[' -r '' ']'
+ for d in '$dir/*/'
+ '[' -d '/usr/local/share/applications//*/' ']'
+ for x in '`echo "$xdg_user_dir:$xdg_system_dirs" | sed '\''s/:/ /g'\''`'
+ search_desktop_file userapp-Firefox-NZFJ3V.desktop /usr/share/applications/ 'http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ local default=userapp-Firefox-NZFJ3V.desktop
+ local dir=/usr/share/applications/
+ local 'arg=http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ local file=
+ '[' -r /usr/share/applications//userapp-Firefox-NZFJ3V.desktop ']'
++ echo userapp-Firefox-NZFJ3V.desktop
++ sed -e 's|-|/|'
+ '[' -r /usr/share/applications//userapp/Firefox-NZFJ3V.desktop ']'
+ '[' -r '' ']'
+ for d in '$dir/*/'
+ '[' -d '/usr/share/applications//*/' ']'
+ IFS=:
+ for browser in '$BROWSER'
+ '[' xx-www-browser '!=' x ']'
++ printf x-www-browser 'http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ browser_with_arg=x-www-browser
+ '[' 0 -ne 0 ']'
+ '[' xx-www-browser = xx-www-browser ']'
+ eval '$browser $1 > /dev/null 2> /dev/null'
++ x-www-browser http '//www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ '[' 127 -eq 0 ']'
+ for browser in '$BROWSER'
+ '[' xfirefox '!=' x ']'
++ printf firefox 'http://www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ browser_with_arg=firefox
+ '[' 0 -ne 0 ']'
+ '[' xfirefox = xfirefox ']'
+ eval '$browser $1 > /dev/null 2> /dev/null'
++ firefox http '//www.sfgate.com/cgi-bin/article.cgi?f=/g/a/2012/05/15/bloomberg_articlesM40W7J0UQVI901-M42UP.DTL#ixzz1uyBI8dq4'
+ '[' 0 -eq 0 ']'
+ exit_success
+ '[' 0 -gt 0 ']'
+ exit 0
install addon
running on Linux
Comment 1 plynchnlm 2014-12-15 21:06:16 UTC
The problem is on line 662 of xdg-open (in the open_generic function):

eval '$browser $1'$xdg_redirect_output;

should be:

eval '$browser "$1"'$xdg_redirect_output;

because without the "" around $1, the IFS=":" will break up URLs on : characters.
Comment 2 Rex Dieter 2014-12-15 22:38:05 UTC
Should be fixed since,
http://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=d1cb061c85388cb9e87a3ea902061d7b94726971

*** This bug has been marked as a duplicate of bug 45859 ***
Comment 3 plynchnlm 2014-12-23 23:18:47 UTC
Yes, that should fix it.  I was looking at http://portland.freedesktop.org/, on which the latest version is v1.1.0-rc1, which does not have that commit.  Thank you for the link to the git website.  Maybe the portland website should have a prominent notice about the new stuff being on the git website.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.