]> git.ipfire.org Git - thirdparty/cups-filters.git/commit
cups-filters: Fix foomatic-rip infinite loop
authorPranav Batra <batrapranav@chromium.org>
Fri, 13 Nov 2020 08:25:48 +0000 (08:25 +0000)
committerTill Kamppeter <till.kamppeter@gmail.com>
Fri, 13 Nov 2020 09:27:40 +0000 (10:27 +0100)
commit8d54f9192a0675c439f74fe2791fd974353f7fd1
treeb0216f7e696c978f6fecc85c3dd2d550ab2f82cf
parenta48b1fad377916d8383a17b7b399e27deb6d5dce
cups-filters: Fix foomatic-rip infinite loop

If the foomatic rip command is not present in the PPD file, the foomatic
rip filter runs cat by default to forward stdin to stdout. However,
if input is provided through a file instead of stdin, then this file
needs to be dup'd to stdin for the command to work properly.

Also, the next file needs to be selected each time an input file is
processed by calling strok_r in order to prevent an infinite loop.

TEST=foomatic-rip --ppd=ppd.ppd file.pdf

(cherry picked from commit a48d39fe501169a1fa21590dfa8594f2e6b931f4)
filter/foomatic-rip/foomaticrip.c