Package: xdg-utils Version: 1.1.0~rc1+git20111210-7.4 Severity: important Tags: patch
Hello. I stumbled upon a problem, which occurs when xdg-open tries to run a desktop file that has multiple exec strings (i.e. for suboptions for unity, like palemoon package has, I've attached the desktop file). After some time digging through the code of xdg-open, I found out that it greps for the all Exec strings in the desktop file. Apparently, this is a bad idea, since 2nd and all next appearances of Exec options just become arguments for the first one. That's why I limited search results for the first occurence of Exec, that must be the main one. See the attached patch for xdg-open. After applying the patch, everything seems to work fine. Thanks in advance! -- System Information: Debian Release: 8.6 APT prefers stable APT policy: (500, 'stable') Architecture: i386 (i686) Kernel: Linux 3.16.0-4-686-pae (SMP w/1 CPU core) Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: sysvinit (via /sbin/init) xdg-utils depends on no packages. Versions of packages xdg-utils recommends: pn libfile-mimeinfo-perl <none> pn libnet-dbus-perl <none> pn libx11-protocol-perl <none> ii x11-utils 7.7+2 ii x11-xserver-utils 7.7+3+b1 Versions of packages xdg-utils suggests: pn gvfs-bin <none> -- no debconf information
--- /usr/bin/xdg-open 2015-02-20 18:30:32.000000000 +0300 +++ xdg-open 2016-10-16 19:12:47.355802630 +0300 @@ -547,7 +547,7 @@ fi if [ -r "$desktop_file" ] ; then - set -- $(sed -n 's/^Exec\(\[[^]]*\]\)\{0,1\}=//p' "$desktop_file") + set -- $(sed -n 's/^Exec\(\[[^]]*\]\)\{0,1\}=//p' "$desktop_file" | sed 1q) command_exec="$(which "$1" 2> /dev/null)" if [ -x "$command_exec" ] ; then shift
[Desktop Entry] Version=1.0 Name=Pale Moon Web Browser Comment=Browse the World Wide Web Keywords=Internet;WWW;Browser;Web;Explorer Exec=palemoon %u Terminal=false X-MultipleArgs=false Type=Application Icon=palemoon Categories=Network;WebBrowser; MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;video/webm;application/x-xpinstall; StartupNotify=true Actions=NewWindow;NewPrivateWindow; [Desktop Action NewWindow] Name=Open a New Window Exec=palemoon -new-window OnlyShowIn=Unity; [Desktop Action NewPrivateWindow] Name=Open a New Private Window Exec=palemoon -private-window OnlyShowIn=Unity;