Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#33039 - [xdg-utils] Spaces in filename not working with xdg-open and zathura due to use of eval

Attached to Project: Arch Linux
Opened by Ben (sickline) - Tuesday, 11 December 2012, 08:58 GMT
Last edited by Andreas Radke (AndyRTR) - Sunday, 30 December 2012, 16:50 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Jan de Groot (JGC)
Andreas Radke (AndyRTR)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

In the current package xdg-utils 1.1.0.git20121008-1 the script xdg-open uses the function eval instead of exec to open filenames. This causes PDF filenames with spaces to not open correctly if the application to open them is the PDF viewer zathura. Instead each word of the filename is tried to be opened separately.

Bug seems to be fixed in Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652067

Additional info:
* Package version xdg-utils 1.1.0.git20121008-1

Steps to reproduce:
Associate PDF files with pdf-viewer zathura
$ xdg-open 1\ 2.pdf
error: File '1' does not exist
error: File '2.pdf' does not exist


Fix:
--- /usr/bin/xdg-open 2011-12-12 05:05:18.000000000 -0600
+++ xdg-open 2011-12-14 09:10:00.791735160 -0600
@@ -552,9 +552,9 @@
arguments_exec="`echo $arguments | sed -e 's*%[fFuU]*"'"$1"'"*g'`"
if [ -x "$command_exec" ] ; then
if echo $arguments | grep -iq '%[fFuU]' ; then
- eval $command_exec $arguments_exec
+ exec $command_exec $arguments_exec
else
- eval $command_exec $arguments_exec "$1"
+ exec $command_exec $arguments_exec "$1"
fi

if [ $? -eq 0 ]; then
This task depends upon

Closed by  Andreas Radke (AndyRTR)
Sunday, 30 December 2012, 16:50 GMT
Reason for closing:  Fixed
Comment by Andreas Radke (AndyRTR) - Tuesday, 18 December 2012, 16:33 GMT
Please check these former similar issues.

https://bugs.freedesktop.org/buglist.cgi?list_id=189381&short_desc=xdg-open%20Space&query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&bug_status=NEEDINFO&bug_status=PLEASETEST&short_desc_type=allwordssubstr&component=xdg-utils

The Debian patch is no more valid and not applying anymore. It's also not the one they implemented into the pkg. (They use this one: http://patch-tracker.debian.org/patch/series/view/xdg-utils/1.1.0~rc1+git20111210-6/xdg-open-spaces.diff)

I doubt it's an issue in xdg-open here. I can open here "xdg-open /tmp/license\ foo.pdf" well. So I guess it's more likely a bug in zathura.
Comment by Andreas Radke (AndyRTR) - Tuesday, 18 December 2012, 16:34 GMT
Please check these former similar issues.

https://bugs.freedesktop.org/buglist.cgi?list_id=189381&short_desc=xdg-open%20Space&query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&bug_status=NEEDINFO&bug_status=PLEASETEST&short_desc_type=allwordssubstr&component=xdg-utils

The Debian patch is no more valid and not applying anymore. It's also not the one they implemented into the pkg. (They use this one: http://patch-tracker.debian.org/patch/series/view/xdg-utils/1.1.0~rc1+git20111210-6/xdg-open-spaces.diff)

I doubt it's an issue in xdg-open here. I can open here "xdg-open /tmp/license\ foo.pdf" well. So I guess it's more likely a bug in zathura.
Comment by Daniel Wallace (gtmanfred) - Friday, 28 December 2012, 18:10 GMT
└─╼ xdg-open Dropbox/The\ C\ Programming\ Language\ ANSI\ C\ Version.pdf (⌐■_■)
START /usr/bin/zathura "Dropbox/The C Programming Language ANSI C Version.pdf"

everything is working well for me, same version of xdg-utils
Comment by Daniel Kessler (dalker) - Sunday, 30 December 2012, 13:24 GMT
Can't reproduce this bug, everything works fine for me.
> zathura --version
info: successfully loaded plugin /usr/lib/zathura/pdf.so
info: Using plain database backend.
zathura 0.2.1
(plugin) pdf-poppler (0.2.1) (/usr/lib/zathura/pdf.so)
> xdg-open --version
xdg-open 1.1.0 rc1
> zathura /tmp/i\ d\ v\ .pdf
No problemj, it opens flawlessly.

Loading...