Merge branch 'private-zdohnal-rebase'

This commit is contained in:
Zdenek Dohnal 2020-01-28 14:28:19 +01:00
commit b970f11618
9 changed files with 33 additions and 155 deletions

2
.gitignore vendored
View File

@ -91,3 +91,5 @@
/cups-filters-1.22.0.tar.xz
/cups-filters-1.22.3.tar.xz
/cups-filters-1.22.5.tar.xz
/cups-filters-1.26.0.tar.xz
/cups-filters-1.27.0.tar.xz

View File

@ -1,44 +0,0 @@
diff --git a/cupsfilters/ppdgenerator.c b/cupsfilters/ppdgenerator.c
index 934b1ce..8d12193 100644
--- a/cupsfilters/ppdgenerator.c
+++ b/cupsfilters/ppdgenerator.c
@@ -1448,19 +1448,6 @@ ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
formatfound = 1;
is_pdf = 1;
}
- if (cupsArrayFind(pdl_list, "image/pwg-raster")) {
- if ((attr = ippFindAttribute(response, "pwg-raster-document-resolution-supported", IPP_TAG_RESOLUTION)) != NULL) {
- current_def = NULL;
- if ((current_res = ippResolutionListToArray(attr)) != NULL &&
- joinResolutionArrays(&common_res, &current_res, &common_def,
- &current_def)) {
- cupsFilePuts(fp, "*cupsFilter2: \"image/pwg-raster image/pwg-raster 0 -\"\n");
- if (formatfound == 0) manual_copies = 1;
- formatfound = 1;
- is_pwg = 1;
- }
- }
- }
#ifdef CUPS_RASTER_HAVE_APPLERASTER
if (cupsArrayFind(pdl_list, "image/urf")) {
if ((attr = ippFindAttribute(response, "urf-supported", IPP_TAG_KEYWORD)) != NULL) {
@@ -1500,6 +1487,19 @@ ppdCreateFromIPP(char *buffer, /* I - Filename buffer */
}
}
#endif
+ if (cupsArrayFind(pdl_list, "image/pwg-raster")) {
+ if ((attr = ippFindAttribute(response, "pwg-raster-document-resolution-supported", IPP_TAG_RESOLUTION)) != NULL) {
+ current_def = NULL;
+ if ((current_res = ippResolutionListToArray(attr)) != NULL &&
+ joinResolutionArrays(&common_res, &current_res, &common_def,
+ &current_def)) {
+ cupsFilePuts(fp, "*cupsFilter2: \"image/pwg-raster image/pwg-raster 0 -\"\n");
+ if (formatfound == 0) manual_copies = 1;
+ formatfound = 1;
+ is_pwg = 1;
+ }
+ }
+ }
#ifdef QPDF_HAVE_PCLM
if (cupsArrayFind(pdl_list, "application/PCLm")) {
if ((attr = ippFindAttribute(response, "pclm-source-resolution-supported", IPP_TAG_RESOLUTION)) != NULL) {

View File

@ -1,17 +0,0 @@
diff --git a/utils/cups-browsed.c b/utils/cups-browsed.c
index 1e3ba18..331d587 100644
--- a/utils/cups-browsed.c
+++ b/utils/cups-browsed.c
@@ -3475,6 +3475,12 @@ on_job_state (CupsNotifier *object,
break;
}
+ if (http)
+ {
+ httpClose(http);
+ http = NULL;
+ }
+
/* Write the selected destination host into an option of our implicit
class queue (cups-browsed-dest-printer="<dest>") so that the
implicitclass backend will pick it up */

View File

@ -1,14 +0,0 @@
diff --git a/filter/foomatic-rip/spooler.c b/filter/foomatic-rip/spooler.c
index 4f27563..fee55a8 100644
--- a/filter/foomatic-rip/spooler.c
+++ b/filter/foomatic-rip/spooler.c
@@ -94,8 +94,7 @@ void init_cups(list_t *arglist, dstr_t *filelist, jobparams_t *job)
CUPS puts the print queue name into the PRINTER environment variable
when calling filters. */
strncpy(job->printer, getenv("PRINTER"), 256);
- if (strlen(getenv("PRINTER")) > 255)
- job->printer[255] = '\0';
+ job->printer[255] = '\0';
free(cups_options);
}

View File

@ -1,12 +0,0 @@
diff --git a/filter/pdf.cxx b/filter/pdf.cxx
index 5b212ca..f12607f 100644
--- a/filter/pdf.cxx
+++ b/filter/pdf.cxx
@@ -20,6 +20,7 @@
#include "pdf.h"
#include <vector>
#include <string>
+#include <cstring>
#include <qpdf/QPDF.hh>
#include <qpdf/QPDFObjectHandle.hh>
#include <qpdf/QPDFWriter.hh>

View File

@ -1,13 +0,0 @@
diff --git a/filter/gstoraster.c b/filter/gstoraster.c
index 4aec079..f3424f3 100644
--- a/filter/gstoraster.c
+++ b/filter/gstoraster.c
@@ -895,7 +895,7 @@ main (int argc, char **argv, char *envp[])
(t && (!strcasecmp(t, "true") || !strcasecmp(t, "on") ||
!strcasecmp(t, "yes")))) {
fprintf(stderr, "DEBUG: Ghostscript using Center-of-Pixel method to fill paths.\n");
- cupsArrayAdd(gs_args, strdup("0 .setfilladjust"));
+ cupsArrayAdd(gs_args, strdup("0 0 .setfilladjust2"));
} else
fprintf(stderr, "DEBUG: Ghostscript using Any-Part-of-Pixel method to fill paths.\n");

View File

@ -3,8 +3,8 @@
Summary: OpenPrinting CUPS filters and backends
Name: cups-filters
Version: 1.22.5
Release: 13%{?dist}
Version: 1.27.0
Release: 1%{?dist}
# For a breakdown of the licensing, see COPYING file
# GPLv2: filters: commandto*, imagetoraster, pdftops, rasterto*,
@ -27,26 +27,6 @@ Patch01: cups-filters-createall.patch
# instead of 'cups-browsed' as Ubuntu does. I can repack the project later,
# so cups-browsed would have separate sub package, so the link would be correct
Patch02: cups-browsed.8.patch
# issue caused by bad covscan fix, strlen() was called on NULL pointer,
# fixed upstream
Patch03: cups-filters-foomaticrip-segfault.patch
# backported from upstream, do not create encrypted file during filtering
Patch04: pdftopdf-nocrypt.patch
# backported from upstream, ftbfs with qpdf-9.0.0
Patch05: cups-filters-qpdf-9.patch
# backported from upstream, gs 9.27 uses now setfilladjust2
Patch06: cups-filters-setfilladjust.patch
# several printers report badly that they have pwg-raster support, but printing
# pwg-raster does not work. So now apple-raster is preffered when printer reports
# support of pwg-raster and apple-raster
Patch07: 0001-libcupsfilters-In-generated-PPDs-prefer-Apple-Raster.patch
# 1776271 - Updated cups-browsed in RHEL 7.7 leaks sockets
Patch08: cups-browsed-socket-leak.patch
# built with gcc 10
Patch09: 0001-foomatic-rip-fix-compilation-with-fno-common.patch
# backported from upstream, current code of pdftoraster, backported
# because of FTBFS with new gcc otherwise
Patch10: cups-filters-upstream-pdftoraster.patch
Requires: cups-filters-libs%{?_isa} = %{version}-%{release}
@ -97,6 +77,7 @@ BuildRequires: dejavu-sans-fonts
# autogen.sh
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gettext-devel
BuildRequires: libtool
# needed for systemd rpm macros in scriptlets
@ -156,15 +137,6 @@ This is the development package for OpenPrinting CUPS filters and backends.
%patch01 -p1 -b .createall
# links in manpage
%patch02 -p1 -b .manpage
# 1740122 - foomatic-rip segfaults when env variable PRINTER is not defined
%patch03 -p1 -b .foomaticrip-segfault
%patch04 -p1 -b .pdftopdf-nocrypt
%patch05 -p1 -b .qpdf-9
%patch06 -p1 -b .setfilladjust
%patch07 -p1 -b .prefer-apple-raster
%patch08 -p1 -b .socket-leak
%patch09 -p1 -b .gcc10
%patch10 -p1 -b .pdftoraster
%build
# work-around Rpath
@ -234,6 +206,23 @@ make check
%post
%systemd_post cups-browsed.service
# put UpdateCUPSQueuesMaxPerCall and PauseBetweenCUPSQueueUpdates into cups-browsed.conf
# for making cups-browsed work more stable for environments with many print queues
# remove this after 1-2 releases
for directive in "UpdateCUPSQueuesMaxPerCall" "PauseBetweenCUPSQueueUpdates"
do
found=`%{_bindir}/grep "^[[:blank:]]*$directive" %{_sysconfdir}/cups/cups-browsed.conf`
if [ -z "$found" ]
then
if [ "x$directive" == "xUpdateCUPSQueuesMaxPerCall" ]
then
%{_bindir}/echo "UpdateCUPSQueuesMaxPerCall 20" >> %{_sysconfdir}/cups/cups-browsed.conf
else
%{_bindir}/echo "PauseBetweenCUPSQueueUpdates 5" >> %{_sysconfdir}/cups/cups-browsed.conf
fi
fi
done
%preun
%systemd_preun cups-browsed.service
@ -245,15 +234,18 @@ make check
%files
%{_pkgdocdir}/README
%{_pkgdocdir}/ABOUT-NLS
%{_pkgdocdir}/AUTHORS
%{_pkgdocdir}/NEWS
%config(noreplace) %{_sysconfdir}/cups/cups-browsed.conf
%attr(0755,root,root) %{_cups_serverbin}/filter/*
%attr(0755,root,root) %{_cups_serverbin}/backend/parallel
# all backends needs to be run only as root because of kerberos
%attr(0700,root,root) %{_cups_serverbin}/backend/parallel
# Serial backend needs to run as root (bug #212577#c4).
%attr(0700,root,root) %{_cups_serverbin}/backend/serial
%attr(0755,root,root) %{_cups_serverbin}/backend/implicitclass
%attr(0755,root,root) %{_cups_serverbin}/backend/beh
# implicitclass backend must be run as root
%attr(0700,root,root) %{_cups_serverbin}/backend/implicitclass
%attr(0700,root,root) %{_cups_serverbin}/backend/beh
# cups-brf needs to be run as root, otherwise it leaves error messages
# in journal
%attr(0700,root,root) %{_cups_serverbin}/backend/cups-brf
@ -313,6 +305,10 @@ make check
%{_libdir}/libfontembed.so
%changelog
* Tue Jan 28 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.27.0-1
- 1.27.0
- add post scriptlet for update
* Wed Jan 22 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.22.5-13
- fix build with GCC 10 and remove old obsoletes

View File

@ -1,20 +0,0 @@
diff --git a/filter/pdftopdf/qpdf_pdftopdf_processor.cc b/filter/pdftopdf/qpdf_pdftopdf_processor.cc
index 73e4f06..0752a99 100644
--- a/filter/pdftopdf/qpdf_pdftopdf_processor.cc
+++ b/filter/pdftopdf/qpdf_pdftopdf_processor.cc
@@ -623,6 +623,7 @@ void QPDF_PDFTOPDF_Processor::emitFile(FILE *f,ArgOwnership take) // {{{
if (!extraheader.empty()) {
out.setExtraHeaderText(extraheader);
}
+ out.setPreserveEncryption(false);
out.write();
}
// }}}
@@ -642,6 +643,7 @@ void QPDF_PDFTOPDF_Processor::emitFilename(const char *name) // {{{
if (!extraheader.empty()) {
out.setExtraHeaderText(extraheader);
}
+ out.setPreserveEncryption(false);
out.write();
}
// }}}

View File

@ -1 +1 @@
SHA512 (cups-filters-1.22.5.tar.xz) = ed33e6d6f090c00f0f0d1d012d3b394bfaa1f81feeb5b0b7ead1dffa2399f0165ce916a99c3bf28aca7f279bffba5b6575feff700130cabfcd46eb4c904d5c59
SHA512 (cups-filters-1.27.0.tar.xz) = f49d9c3e558cd3ac7d5eb0bf323940e7bb3c088a24ef9232cde2cb84ddc0e262c77acd29eb97851ca4e3bd473d764e730480808f9c1d95b1dd6d406073614702