diff --git a/SOURCES/0001-foomatic-rip-Changed-Ghostscript-call-to-count-pages.patch b/SOURCES/0001-foomatic-rip-Changed-Ghostscript-call-to-count-pages.patch new file mode 100644 index 0000000..b7a83de --- /dev/null +++ b/SOURCES/0001-foomatic-rip-Changed-Ghostscript-call-to-count-pages.patch @@ -0,0 +1,35 @@ +diff --git a/foomaticrip.h b/foomaticrip.h +index 2777672..fea8e47 100644 +--- a/foomaticrip.h ++++ b/foomaticrip.h +@@ -94,6 +94,7 @@ extern int spooler; + + + #define PATH_MAX 65536 ++#define CMDLINE_MAX 65536 + + typedef struct { + char printer[256]; +diff --git a/pdf.c b/pdf.c +index ebd6ab5..ee4eb51 100644 +--- a/pdf.c ++++ b/pdf.c +@@ -41,14 +41,13 @@ static int wait_for_renderer(); + + static int pdf_count_pages(const char *filename) + { +- char gscommand[4095]; ++ char gscommand[CMDLINE_MAX]; + char output[31] = ""; + int pagecount; + +- snprintf(gscommand, 4095, "%s -dNODISPLAY -q -c " +- "'/pdffile (%s) (r) file def pdfdict begin pdffile pdfopen begin " +- "(PageCount: ) print pdfpagecount == flush currentdict pdfclose " +- "end end quit'", ++ snprintf(gscommand, CMDLINE_MAX, "%s -dNODISPLAY -q -c " ++ "'/pdffile (%s) (r) file runpdfbegin (PageCount: ) print " ++ "pdfpagecount = quit'", + gspath, filename); + + FILE *pd = popen(gscommand, "r"); diff --git a/SPECS/foomatic.spec b/SPECS/foomatic.spec index 9586bce..a85698d 100644 --- a/SPECS/foomatic.spec +++ b/SPECS/foomatic.spec @@ -4,7 +4,7 @@ Summary: Tools for using the foomatic database of printers and printer drivers Name: foomatic Version: %{enginever} -Release: 8%{?dist} +Release: 8%{?dist}.1 License: GPLv2+ Group: System Environment/Libraries @@ -16,12 +16,13 @@ Provides: printer-filters = 1.1-8 Source0: http://www.openprinting.org/download/foomatic/foomatic-db-engine-%{enginever}.tar.gz # The CUPS driver and filter. -# Source1: http://www.openprinting.org/download/foomatic/foomatic-filters-%{filtersver}.tar.gz +# Source1: http://www.openprinting.org/download/foomatic/foomatic-filters-%%{filtersver}.tar.gz # We need to remove test/*.sh, because those files are non-free (Artistic). We don't use them. Source1: foomatic-filters-%{filtersver}-clean.tar.gz ## PATCHES FOR FOOMATIC-FILTERS (PATCHES 1 TO 100) Patch1: foomatic-filters-debug-string.patch +Patch2: 0001-foomatic-rip-Changed-Ghostscript-call-to-count-pages.patch ## PATCHES FOR FOOMATIC-DB-ENGINE (PATCHES 101 TO 200) Patch101: foomatic-manpages.patch @@ -86,6 +87,8 @@ CUPS print filters for the foomatic package. pushd foomatic-filters-%{filtersver} # Too few arguments for format in a debugging string (bug #726384) %patch1 -p1 -b .debug-string +# 1707559 - removal of option in ghostscript caused foomatic-rip to fail +%patch2 -p1 -b .foomatic-rip-crash aclocal automake --add-missing @@ -147,7 +150,7 @@ rm -rf \ %{buildroot}%{_libdir}/ppr \ %{buildroot}%{_sysconfdir}/foomatic/filter.conf.sample \ %{buildroot}%{_datadir}/foomatic/templates -#%{buildroot}%%{_libdir}/perl5/site_perl +#%%{buildroot}%%{_libdir}/perl5/site_perl find %{buildroot} -name .packlist | xargs rm -f mkdir _enginedocs @@ -205,6 +208,9 @@ exit 0 %{_mandir}/man1/foomatic-rip.1* %changelog +* Fri May 24 2019 Michal Ruprich - 4.0.9-8.1 +- Resolves: #1713563 - removal of option in ghostscript caused foomatic-rip to fail + * Thu Aug 28 2014 Tim Waugh - 4.0.9-8 - Put some text into foomatic-preferred-drivers man page.