]> git.ipfire.org Git - thirdparty/cups-filters.git/commit
cups-filters: Fix foomatic-rip infinite loop 318/head
authorPranav Batra <batrapranav@chromium.org>
Fri, 13 Nov 2020 08:25:48 +0000 (08:25 +0000)
committerPranav Batra <batrapranav@chromium.org>
Fri, 13 Nov 2020 08:25:48 +0000 (08:25 +0000)
commita48d39fe501169a1fa21590dfa8594f2e6b931f4
tree04f56a4e88d9082c9c0fddc9f4de7e5b5232ff32
parent683945c5fceb82869f094f7c9ac5cb211fcdea62
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
filter/foomatic-rip/foomaticrip.c