Package: xdg-utils
Version: 1.1.1-1
Severity: normal

tglase@tglase-nb:~ $ xdg-open http://www.mirbsd.org/
/usr/bin/xdg-open[938]: : can't execute: Is a directory

It still _works_ as is, but this error message is weird.

This is caused by line 669:
        command_exec=`which $command 2>/dev/null`

Watch it:

tglase@tglase-nb:~ $ echo "<$(which /usr/feistermops/380/firefox/firefox)>"; 
echo $?
<>
0

The fix is obvious and trivial:

-        command_exec=`which $command 2>/dev/null`
+        test -x "$command" && command_exec=$command || command_exec=$(which 
$command 2>/dev/null)

The complete fix is a bit more involved:

--- /usr/bin/xdg-open~  2017-03-30 21:36:19.403450698 +0200
+++ /usr/bin/xdg-open   2017-03-30 21:37:15.100849964 +0200
@@ -664,9 +664,13 @@
       file="$dir/`echo $default | sed -e 's|-|/|'`"
     fi
 
+    local command command_exec=""
+
     if [ -r "$file" ] ; then
         command="$(get_key "${file}" "Exec" | first_word)"
-        command_exec=`which $command 2>/dev/null`
+        test -x "$command" && command_exec=$command || command_exec=$(which 
$command 2>/dev/null)
+    fi
+    if [ -n "$command_exec" ] && [ -x "$command_exec" ] ; then
         icon="$(get_key "${file}" "Icon")"
         # FIXME: Actually LC_MESSAGES should be used as described in
         # 
http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s04.html


-- System Information:
Debian Release: 9.0
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.0-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/lksh
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>
ii  libx11-protocol-perl   0.56-7
ii  x11-utils              7.7+3+b1
ii  x11-xserver-utils      7.7+7+b1

Versions of packages xdg-utils suggests:
pn  gvfs-bin  <none>

-- no debconf information

Reply via email to