#1001551 xpdf: Argument parsing: -exec with spaces

Package:
xpdf
Source:
xpdf
Description:
Motif-based PDF reader using the Poppler library
Submitter:
Celelibi
Date:
2024-06-24 18:27:08 UTC
Severity:
normal
Tags:
#1001551#5
Date:
2021-12-12 05:00:39 UTC
From:
To:
Dear Maintainer,

I love the ability to control xpdf from another program. Makes it easy
to integrate into my workflow.

However, it looks like xpdf doesn't parse correctly the -exec argument
value when it includes spaces.

For instance, run:
xpdf -remote myxpdf somedocument.pdf

Then run:
xpdf -remote myxpdf -exec 'run(ls)'

This works, the first xpdf command will run 'ls'. However the following
command fails:
xpdf -remote myxpdf -exec 'run(ls -l)'

And it fails at the client side, showing a brief command line help. Not
at the remote server side. Therefore suggesting it's a command line
parsing issue.

Best regards,
Celelibi

#1001551#8
Date:
2024-06-24 18:24:40 UTC
From:
To:
Hi Celelibi,

in case this is still relevant to you (I can't find any trace of this
bug report in my mailbox, I'm sorry you had to wait so long for a first
reply): I think you can achieve what you want by using the command
"xpdf.real" instead of just "xpdf".

/usr/bin/xpdf is a shell script that Debian adds since $forever, mainly
in order to automatically open PDFs compressed with gzip/xz/bzip2 etc.

While shell scripting is often quickly done, it's hard to get right for
every possible use case. The script correctly parses the quoted value
with the space, however it fails to correctly reproduce the space in the
call to the actual binary, /usr/bin/xpdf.real - and I can't seem to come
up with a clean fix that works for all obvious situations, hence tagging
this bug HELP.

Florian