2012-07-02 Till Kamppeter * Tagged branch for release 4.0.17. * VERSION, README, USAGE, configure.ac: Updated for release 4.0.17. * foomaticrip.h: Raised PATH_MAX to 65536 bytes so that CUPS filter calls with many command line options work (Ubuntu bug #1019662). 2012-06-25 Jiri Popelka * options.c, renderer.c: Fixed problems discovered by a Coverity scan (Bug #752). 2012-06-18 Till Kamppeter * Tagged branch for release 4.0.16. * VERSION, README, USAGE, configure.ac: Updated for release 4.0.16. * foomaticrip.c: Fixed wrong access to command line option list which prevented the command line options being passed on to the pdftops CUPS filter when incoming PDF is converted to PostScript (Ubuntu bug #1002699). 2012-06-06 Till Kamppeter * spooler.c: Fixed off-by-one bug which has cut off the last character of the option string for CUPS (5th command line argument) and so made the last option setting not being applied (Ubuntu bug #1003194). 2012-03-23 Till Kamppeter * Tagged branch for release 4.0.15. * VERSION, README, USAGE, configure.ac: Updated for release 4.0.15. * options.c: Improved check whether a driver works with PDF input data: Do not take into account bogus options which appear due to bugs in PPD files (type is TYPE_NONE) or composite options and in addition add debug output to show the reason for the decision to convert to PostScript (Ubuntu bugs #953962 and #960989). 2012-03-14 Till Kamppeter * Tagged branch for release 4.0.14. * VERSION, README, USAGE, configure.ac: Updated for release 4.0.14. * foomaticrip.c: If the input data is PDF but the driver requires PostScript, use the pdftops CUPS filter when CUPS is the spooler. This way we always use the same method to convert PDF to PostScript in the whole system, including any workarounds applied in the CUPS filter. 2012-03-02 Till Kamppeter * Tagged branch for release 4.0.13. * VERSION, README, USAGE, configure.ac: Updated for release 4.0.13. 2012-03-02 Lars Uebernickel * spooler.c: When using CUPS support option strings (5th command line argument to a CUPS filter) of more than 512 bytes. For PPD files with very many options this string can get very long (Thanks to Yoshito Nishihara, yoshito dot nishihara at nts dot ricoh dot co dot jp for reporting this). 2012-02-10 Till Kamppeter * Tagged branch for release 4.0.12. * VERSION, README, USAGE, configure.ac: Updated for release 4.0.12. 2012-02-10 Till Kamppeter * Tagged branch for release 4.0.11. * VERSION, README, USAGE, configure.ac: Updated for release 4.0.11. 2012-02-10 Till Kamppeter * foomaticrip.c: If incoming PDF needs to be converted to PostScript due to the filter command line not being a standard Ghostscript command line, no separate PDF command line being supplied, or options in the PPD being implemented by PostScript code, use preferrably Ghostscript (with the "ps2write" device) for this conversion as Ghostscript is better optimized for printing and has a more sophisticated color management compared to Poppler. 2012-02-10 Till Kamppeter * Tagged branch for release 4.0.10. * VERSION, README, USAGE, configure.ac: Updated for release 4.0.10. 2011-08-18 Till Kamppeter * foomaticrip.c, renderer.c: SECURITY FIX: Use the mktemp shell command/mkstemp() function to create the debug log file and the renderer input data file (both files only generated when foomatic-rip is un in debug mode) with file names with an unpredictable part. The names are /tmp/foomatic-rip-XXXXXX.log and /tmp/foomatic-rip-YYYYYY.ps where the XXXXXX and YYYYYY are replaced by random strings. Thanks to Tim Waugh from Red Hat for for the patch (bug #936, CVE-2011-2924). 2011-07-25 Till Kamppeter * Tagged branch for release 4.0.9. * VERSION, README, USAGE, configure.ac: Updated for release 4.0.9. 2011-07-25 Till Kamppeter * foomaticrip.c: Fixed build of foomatic-rip on systems without D-Bus. Thanks to Richard Hughes (hughsient at gmail dot com) for the quick fix. 2011-07-25 Till Kamppeter * Tagged branch for release 4.0.8. * VERSION, README, USAGE, configure.ac: Updated for release 4.0.8. 2011-07-24 Till Kamppeter * foomaticrip.c: Removed stray characters from "pstoraster" Ghostscript command line. * foomaticrip.c, pdf.c, renderer.c: Added "-dNOINTERPOLATE" to the Ghostscript command lines as this makes Ghostscript rendering the pages significantly faster. Use "ps2write" instead of "pswrite" as PostScript output device as Ghostscript produced huge output files with "pswrite" (and "pswrite" is also deprecated now). * foomaticrip.c: SECURITY FIX: It was possible to make CUPS executing arbitrary commands as the system user "lp" when foomatic-rip was used as CUPS filter. Fixed by not parsing named options (like "--ppd lj.ppd") when foomatic-rip is running as CUPS filter, as CUPS does not supply named options to their filters. 2011-03-04 Till Kamppeter * configure.ac: Support for libdir in the ./configure script. * pdf.c: Use mkstemp() instead of mktemp(). Thanks to Richard Hughes (hughsient at gmail dot com) for supplying me this patch from Red Hat. * colord.c, colord.h, Makefile.am, configure.ac, foomaticrip.c, options.c, options.h: Added support for ICC-based color managment. Both colord and CUPS' ICC-related PPD extensions are supported. For colord D-Bus is required. Thanks to Richard Hughes (hughsient at gmail dot com) for the patch. 2011-02-21 Till Kamppeter * foomatic-rip.1.in: Corrected typos in the man page for foomatic-rip. Thanks to Tim Waugh from Red Hat for the patch (bug #659). 2011-02-18 Till Kamppeter * Tagged branch for release 4.0.7. * VERSION, README, USAGE, configure.ac: Updated for release 4.0.7. 2011-01-04 Till Kamppeter * acinclude.m4, configure.ac: General cleanup (as in bugs #609, #610). 2010-12-23 Till Kamppeter * README: Corrected several typos. Thanks to Christopher Yeleighton (giecrilj at stegny dot 2a dot pl) for the patch (bug #598). 2010-12-16 Till Kamppeter * README: Corrected e-mail address of Helge Bliscke. 2010-12-15 Till Kamppeter * foomaticrip.c: Run strtok() on a copy of the list of input files for the first check, as strtok() modifies the string it parses, overwriting the delimiters with zeros. Before, the list of input files only showed its first entry when being parsed again for actually printing the files (Ubuntu bug #676680). * Tagged branch for release 4.0.6. * VERSION, README, USAGE, configure.ac: Updated for release 4.0.6. * options.c: Allow length limitation for the substitution of the special entities "&job;", "&user;", "&host;", "&title;", and "&options;": The maximum length can be supplied via the PPD keywords "*FoomaticRIPEntityMaxLength: " (for example "*FoomaticRIPUserEntityMaxLength: 8") or by adding a number to the individual entities (for example "&user8;"). If the string to insert for the entity is longer than the limit, it gets cut off to the limit. Feature requested by Uli Wehner from Ricoh (http://forums.linux-foundation.org/read.php?30,13134). 2010-12-10 Till Kamppeter * foomaticrip.c: Make file type detection also work if the PostScript or PDF input is preceeded by PJL with an additional '%' character. Thanks to Alexpro for reporting this as Ubuntu bug #688551 and supplying the patch. 2010-11-11 Till Kamppeter * util.c: The temp_dir() function did not take into account that getenv() can return NULL. In such a case the fallback to /tmp did not work. Thanks to Abel Abraham Camarillo Ojeda (spam at verlet dot org) for the patch (bug #552). * fileconverter.c: Make the check for the text filter actually work. Before, the text filter choice from the configuration file was simply taken for good and not checked whether it is supported. Thanks to Abel Abraham Camarillo Ojeda (spam at verlet dot org) for the patch (bug #551). 2010-08-27 Till Kamppeter * options.c: Made sure that the unhtmlify() function does not write the zero byte to mark the string end beyond the buffer. Also use a much larger buffer for parsing "*FoomaticRIPOptionPrototype:" in the PPD file (bug #515). * util.c: In strncpy_tochar() use the isempty() function to check whether the input string is empty (bug #514). 2010-08-10 Till Kamppeter * Tagged branch for release 4.0.5. * VERSION, README, USAGE, configure.ac: Updated for release 4.0.5. 2010-07-07 Till Kamppeter * options.c: Make substitution of zeros by the the user-defined page size in the prototype string for the custom page size working. Before, only substitution of %0 and %1 worked reliably. Thanks to Lutz Sammer (johns98 at web dot de) for reporting this problem (see also bug 514, comment #1). * options.c: Make custom page size settings also work if the custom size is set via embedded PostScript code and the comment to mark the selected option setting is only "%% FoomaticRIPOptionSetting: PageSize=Custom", without the size and unit parameters. Thanks to Lutz Sammer for reporting this problem (see also bug 514, comment #1). 2010-07-02 Till Kamppeter * spooler.c: Config file for the default printer in spooler-less (direct) printing mode was not read correctly. Thanks to Lutz Sammer (johns98 at web dot de) for reporting this problem (see also bug 514, comment #1). * spooler.c: Fixed error message output if a printer's PPD is missing in spooler-less mode. There was a segfault due to the printer name not specified in the _log() function call. Thanks to Lutz Sammer for reporting this problem (see also bug 514, comment #1). * util.c: The isempty() function did not consider NULL as an empty string. This caused segfaults when a string is considered non-empty but in fact it is NULL. Thanks to Lutz Sammer for reporting this problem (see also bug 514, comment #1). * util.c: strncpy_tochar() did not check whether the input string is empty and returned a pointer one character beyond the input string, leading to segfaults in the code calling this function. Thanks to Lutz Sammer for reporting this problem (see also bug 514, comment #1). 2010-06-08 Till Kamppeter * USAGE: Documentation correction. 2010-06-07 Till Kamppeter * USAGE: Finally completed the documentation update to reflect that the Ghostscript library is not needed any more. * configure.ac, util.h, util.c: Added implementation of strcasestr() function for non-GNU systems (completes fix of bug #303, thanks to Tim Mooney for this fix). * foomaticrip.c, foomaticrip.h, pdf.c: Let foomatic-rip actually error out if something goes wrong. It simply continued or closed silently (exit status 0) on the following events: Failure of print_file() function call, failure of Ghostscript to determine the number of pages of a PDF input file (causes Ubuntu bug #570522), failure to start Ghostscript to render a PDF file, failure to create a temporary file for extracting selected pages from a PDF file, failure to run Ghostscript to extract pages from a PDF file, page count result being a negative number. * foomaticrip.c: Use EXIT_PRINTED constant and not hard-coded "0" as exit value when terminating successfully. * foomaticrip.h: Correct definition of EXIT_STARVED constant. 2010-03-26 Till Kamppeter * options.c, options.h: Made some strings longer, to avoid space problems. 2010-02-15 Till Kamppeter * Tagged branch for release 4.0.4. * VERSION, README, USAGE, configure.ac: Updated for release 4.0.4. * README, USAGE: Reflected that libgs is not needed any more. 2010-02-12 Till Kamppeter * pdf.c, configure.ac: Removed dependency on libgs by calling Ghostscript via the command line. This makes packaging for Linux distributions easier and also building on Mac OS X and Solaris gets simplified (Bugs #303, #382, #384). 2010-02-05 Till Kamppeter * options.c, spooler.c: Made suppression of CUPS accounting PostScript code into a PostScript data stream actually working: PPD keyword is "*FoomaticRIPCommandLinePDF", value must be "true", and check of the ps_accounting variable must be done after parsing the PPD file (Ubuntu bug #513690). 2010-02-03 Till Kamppeter * postscript.c: Added NULL pointer check to avoid segfault when custom margins option is added to the PPD file via the alignmargins script (Bug #413, Debian bug #539676). 2010-02-02 Till Kamppeter * foomaticrip.c: If incoming PDF needs to get converted to PostScript remove /usr/lib/cups/filter from $PATH, so that "pdftops" of Poppler or XPDF gets called and not "pdftops" of CUPS. The latter has another command line and does undesired page management operations (Ubuntu bug #463059). 2010-01-19 Lars Uebernickel * *.[ch], README: Added license headers to all source files and clarified in the README that the license is GPLv2 or later. 2010-01-16 Till Kamppeter * options.c: Fixed the previous revision to have bug #399 also fixed for float options. 2010-01-15 Till Kamppeter * options.c: When building the driver command line do not use the empty code fields of automatically generated choices of numerical options of Foomatic-based PPDs (bug #399). 2009-08-19 Till Kamppeter * Tagged branch for release 4.0.3. * VERSION, README, USAGE, configure.ac: Updated for release 4.0.3. * foomaticrip.c: If PDF input has to be converted to PostScript due to a PPD which does not support PDF (like the PPDs of the Foomatic "Postscript" driver), we try at first to use "pdftops" (Poppler) and only if this fails we use Ghostscript. This is because Ghostscript blows up PDFs to huge PostScript files (which many PostScript printers failed on), whereas Poppler's output stays compact. As "pdftops" does not support reading from stdin, we create a temporary file with the input before starting to convert. Note that "pdftops" will get only used if it has the "-origpagesizes" option (Poppler 0.11.x or newer), as otherwise documents with pages of different sizes do not get converted correctly (bug #365). * pdf.c, util.c, util.h: Moved temp_dir() function from pdf.c to util.c as it is now also needed by foomaticrip.c. * foomaticrip.c: Fixed LPRng support (bug #337): PPD file names were not read correctly from /etc/printcap (PRINTCAP_ENTRY environment variable), starting 8 characters after the beginning of the path and not stopping at a colon. Also the last command line argument of the foomatic-rip call was always considered the name of the PPD file, even if the PPD file name was already determined by the PRINTCAP_ENTRY environment variable or the "--ppd" command line argument. 2009-07-01 Till Kamppeter * foomaticrip.c: Do not use JCL which is preceeded to the input data. We can generate it on our own and even merge it with the JCL coming from the driver. * renderer.c: Make sure that "@PJL SET ..." commands from the PPD file do not get nmerged into the driver's PJL header too early, expecially not before "@PJL JOB ..." lines, as then the commands get ignored. This happened especially with the "InputSlot" option for the "cdnj500" driver. 2009-06-24 Till Kamppeter * Tagged branch for release 4.0.2. * VERSION, README, USAGE, configure.ac: Updated for release 4.0.2. 2009-05-31 Till Kamppeter * configure.ac: Add support for cups-config (bug #349). 2009-05-27 Till Kamppeter * renderer.c: Fixed no-return-in-nonvoid-function compiler warning caused by the write_binary_data() function (bug #348). 2009-04-23 Till Kamppeter * Re-tagged branch for release 4.0.1. * VERSION, README, USAGE, configure.ac: Updated. 2009-04-19 Till Kamppeter * Tagged branch for release 4.0.1. * foomatic-rip.1.in: Added documentation for the configuration file (/etc/foomatic/filter.conf, bug #312), minor text fixes. * postscript.c: Fixed segfault when the PPD contains only a default value but not an option for it (like "*DefaultResolution: 600dpi" and the client inserts this as an option setting into the PostScript input data stream (Windows clients do so). Bug #324. 2009-03-30 Till Kamppeter * options.c: Custom page sizes were not accepted if one of the three parameters "WidthOffset", "HeightOffset", or "Orientation" of the "PageSize" option in the PPD file did not allow 0 as value. Made error messages for the parameters of custom options more readable. * foomaticrip.c, options.c: If there are printing system options (like "media" of CUPS) and PPD options (like "PageSize") on the command line and they do the same thing (like choosing the paper size) let the setting of the PPD option always have priority, as this is expected for a CUPS filter (see CUPS STR #3148). This is done by treating the printing system options before the PPD options. This fixes Ubuntu bug #338999. 2009-03-08 Till Kamppeter * renderer.c: Fixed segmentation fault in JCL option handling (bugs #311 and #317). 2009-03-07 Till Kamppeter * foomatic-rip.1.in: Fixed typos. * renderer.c: When doing the massaging of the remderer command line foomatic-rip inserts 'gs' at the wrong place in command lines of Foomatic 3.x-generated PPD files for the "Postscript" driver, leading to duplicate calls of Ghostscript (bug #316). * foomaticrip.c: Fixed buffer overflow mentioned in bug #311. 2009-02-11 Lars Uebernickel * foomaticrip.c: The value of the "execpath" variable in the config file was not used fully: Only the characters leading up to the first ':' were copied into the programs $PATH environment variable. 2009-02-11 Lars Uebernickel * renderer.c: Fixed several bugs in the argument replacements in massage_gs_commandline. * foomaticrip.c: Use "gspath" and "echopath" from the config file. 2009-02-09 Lars Uebernickel * fileconverter.h, foomaticrip.c, renderer.c, util.c: Made foomatic-rip building under Mac OS X, mainly by replacing functions which are GNU-only. 2009-02-02 Till Kamppeter * renderer.c: When foomatic-rip looked for JCL options in the binary output of the driver to merge them with JCL options from the PPD file, it read binary data into a C string, which causes problems when this data contains zeroes. Finally fixes Ubuntu bug LP: #303691. 2009-01-29 Till Kamppeter * renderer.c: If there were very many JCL lines in the driver's output or coming together by JCL options, the JCL merging process (kid4) segfaulted (Ubuntu bug LP: #321164, https://launchpad.net/bugs/321164). 2009-01-14 Till Kamppeter * Tagged branch for release 4.0.0. 2009-01-13 Till Kamppeter * options.c: Custom JCL options were not inserted correctly (thanks to Bin Li from Ricoh for reporting this). Fixed also that "None" as argument for a string or password option is considered as the empty string. * options.c: String and password option settings got inserted into the command line or the PostScript code with the "Custom." prefix (thanks to Bin Li from Ricoh for reporting this). Fixed also a segmentation fault due to missing initialization of components of the param_t data structure by the option_add_custom_param_from_string() function. Removed also some unneeded free() calls. 2009-01-12 Till Kamppeter * acinclude.m4: Eliminated warnings when generating ./configure 2009-01-08 Till Kamppeter * README, USAGE: Version 4.0.0. * STANDARD_installation: Tell also that "sudo make install" works to run "make install" as root. * Makefile.am: Fixed cleaning rules. Many transient files did not get removed. Fixed "make inplace" and uninstalling rules. 2009-01-03 Till Kamppeter * postscript.c: Do the workaround for PostScript input of OpenOffice 1.1.x also for StarOffice 8 (Thanks to Martin Jacobs, martin dot jacobs at arcor dot de, for the patch). 2008-12-10 Till Kamppeter * foomaticrip.c, foomaticrip.h, options.c: The PostScript code of PostScript options did not get inserted when the spooler is CUPS and foomatic-rip had to convert incoming PDF to PostScript (Ubuntu bug #299918). 2008-12-05 Till Kamppeter * README: Updated for Foomatic 4.x * test/*: Added test suite based on the LSB tests for foomatic-rip * README, USAGE, foomatic-rip.1.in, foomaticrip.c, options.c, pdf.c. spooler.c: s/GhostScript/Ghostscript/ 2008-11-30 Till Kamppeter * postscript.c: Insert the "%%PageSetup" section directly after the DSC comment header of the page, all page drawing commands must be after the section. * postscript.c: Inserted PostScript option settings from pstops were not corrected with custom option settings done on the command line (numerical, string, password). * options.c: Small fix for better readability. * renderer.c: If there was only one PJL option in the PPD no PJL got added at all (Ubuntu bug #303691). * renderer.c: Fixed several bugs in the merging of PJL options. In some cases equal keywords were not found in the two JCL option sets or keywords only differing by the last character were considered equal. Also a command in the first line of the driver's PJL header got dropped. 2008-11-26 Lars Uebernickel * options.c: When a numeric value is out of range, use the default value instead of the closest valid value (i.e. min or max). Do not truncate string options which are longer than allowed, use the default instead. Apply AllowedChars and AllowedRegExp also to Password options. Small bug fix: The generated regular expression for AllowedChars was missing the final '$' and therefore didn't match all cases correctly. Bug fix: Merge JCL options correctly 2008-11-21 Lars Uebernickel * options.c: Fixed bug: Setting the page range of an option to multiple ranges (seperated by comma), foomatic-rip was caught in an infinte loop. * options.c: Fixed bug: Page ranges were not applied for command line options when processing PostScript files (the renderer wasn't restarted as it should have been). 2008-11-13 Lars Uebernickel * options.c: Don't prepend @PJL to JCL options if they already start with @PJL. Unhexify JCL commands. * options.c: Handle CustomJCL