Compare commits
165 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41507f739c | ||
|
|
a7475c5579 | ||
|
|
a8ee5f8620 | ||
|
|
18de77feb8 | ||
|
|
398b8d5a28 | ||
|
|
480a0f0325 | ||
|
|
66a0dd1a21 | ||
|
|
c1695f504f | ||
|
|
b7ff25e58f | ||
|
|
dbeabdf333 | ||
|
|
1b3fda0c3a | ||
|
|
e1f2a90397 | ||
|
|
076e45cca6 | ||
|
|
c869cf5c9b | ||
|
|
c6632c6f3d | ||
|
|
2b363dc375 | ||
|
|
03fb9b0bd1 | ||
|
|
519dbe7090 | ||
|
|
4e647ff37f | ||
|
|
fdab9d0e8f | ||
|
|
ccbeab52d9 | ||
|
|
393fd69e1d | ||
|
|
1c4f6516ea | ||
|
|
87de6c1b71 | ||
|
|
8b92a1c707 | ||
|
|
67255d297e | ||
|
|
7ae4e25c32 | ||
|
|
f3cae0b36d | ||
|
|
5586866204 | ||
|
|
a5ecb63ada | ||
|
|
7883e3153a | ||
|
|
f0c5de2a54 | ||
|
|
8f9f9c570a | ||
|
|
e6af6aa338 | ||
|
|
45d85af8c2 | ||
|
|
5e7f450887 | ||
|
|
efb7d03fdc | ||
|
|
2b31ce337d | ||
|
|
d3304142ee | ||
|
|
177ffd57f4 | ||
|
|
91d4f55012 | ||
|
|
ad798b5ac0 | ||
|
|
6ac942088c | ||
|
|
ba20eaa5fa | ||
|
|
7b818ff3e9 | ||
|
|
06431fc214 | ||
|
|
c7f670cf9b | ||
|
|
662860bd6d | ||
|
|
62dde7da62 | ||
|
|
6ea383d6ac | ||
|
|
d0a8a52f31 | ||
|
|
86b38d6d57 | ||
|
|
15366e173e | ||
|
|
2c091ba0e4 | ||
|
|
67ee5bbd71 | ||
|
|
ca565205ee | ||
|
|
6e20b40da9 | ||
|
|
faec0dbe07 | ||
|
|
226ec8183a | ||
|
|
948b35290b | ||
|
|
5210c94838 | ||
|
|
73dbd2a677 | ||
|
|
9809963904 | ||
|
|
14621a6e82 | ||
|
|
4ac3a5a53f | ||
|
|
0874da6cc2 | ||
|
|
670e73ad82 | ||
|
|
925c0f3f69 | ||
|
|
5cab1ec88e | ||
|
|
5aab7baafb | ||
|
|
d17a3ad727 | ||
|
|
84a28971d9 | ||
|
|
b712bd6dba | ||
|
|
d456002635 | ||
|
|
3f27a10b68 | ||
|
|
0ffeb35189 | ||
|
|
fe20c1aeb6 | ||
|
|
8404225612 | ||
|
|
7975201239 | ||
|
|
0423ef0468 | ||
|
|
f08a23d0dd | ||
|
|
0b4e8e3f04 | ||
|
|
a2ea1b6f10 | ||
|
|
3a7b047594 | ||
|
|
5d1b2b21fe | ||
|
|
6a6ba51b99 | ||
|
|
d613403cce | ||
|
|
12bd665536 | ||
|
|
7f6989d5c2 | ||
|
|
0a471b82f7 | ||
|
|
d6cf1a69c5 | ||
|
|
08a1bd7590 | ||
|
|
3b950f0025 | ||
|
|
91fd1dacc7 | ||
|
|
1b2594f02a | ||
|
|
47bca23058 | ||
|
|
649f2110e9 | ||
|
|
9003c6ec4b | ||
|
|
592296aa15 | ||
|
|
f282cc8514 | ||
|
|
63ff06c16a | ||
|
|
e0f5d959cd | ||
|
|
bb10dc7b6f | ||
|
|
970239102a | ||
|
|
9866ec1f82 | ||
|
|
a784c2a3f0 | ||
|
|
5b19b86468 | ||
|
|
f62a89ac90 | ||
|
|
401449b6bf | ||
|
|
5ab9f50bd8 | ||
|
|
2ef13432e5 | ||
|
|
69c633e97b | ||
|
|
1fc0a67de9 | ||
|
|
890dbaf30a | ||
|
|
39704fa792 | ||
|
|
3606bde648 | ||
|
|
3154c5b1e8 | ||
|
|
b970f11618 | ||
|
|
719f16e709 | ||
|
|
165fc502ac | ||
|
|
bc3414ce3e | ||
|
|
3a0eca877e | ||
|
|
0cd045c7fe | ||
|
|
3e0de52e39 | ||
|
|
5f198ebd13 | ||
|
|
1d9a177ccf | ||
|
|
c80a629db4 | ||
|
|
2bc24c38e4 | ||
|
|
a667ded3e9 | ||
|
|
8a4dc09994 | ||
|
|
f6fb823829 | ||
|
|
61e9e90047 | ||
|
|
87d6b5e0ba | ||
|
|
a568cb9b30 | ||
|
|
9b15b8eea6 | ||
|
|
6c9c9cf9f5 | ||
|
|
14b31aac55 | ||
|
|
6746325d61 | ||
|
|
63e6f8adf5 | ||
|
|
a8f75f2927 | ||
|
|
cc60395a8c |
||
|
|
0e6742b393 |
||
|
|
2010263180 | ||
|
|
6239c46f66 | ||
|
|
8ab2c03a62 | ||
|
|
ef3e4c55ce | ||
|
|
1b4fbffc07 | ||
|
|
896c4186e8 | ||
|
|
71c6baacf4 | ||
|
|
5d00506944 | ||
|
|
065cfc122f | ||
|
|
8a7e13d197 | ||
|
|
e834146303 | ||
|
|
e8b2b7289a | ||
|
|
adfe73a4b6 | ||
|
|
5a8bdd4187 | ||
|
|
7c37df15dd | ||
|
|
12094716ea | ||
|
|
b5d9adf81e | ||
|
|
eac2d98b5b | ||
|
|
1c0cb681f9 | ||
|
|
805d0c618c | ||
|
|
b28dd5f442 | ||
|
|
36a0663c97 | ||
|
|
8535a417f1 |
17 changed files with 2744 additions and 1140 deletions
1
.fmf/version
Normal file
1
.fmf/version
Normal file
|
|
@ -0,0 +1 @@
|
|||
1
|
||||
85
.gitignore
vendored
85
.gitignore
vendored
|
|
@ -1,84 +1 @@
|
|||
/cups-filters-1.0.20.tar.xz
|
||||
/cups-filters-1.0.22.tar.xz
|
||||
/cups-filters-1.0.23.tar.xz
|
||||
/cups-filters-1.0.24.tar.xz
|
||||
/cups-filters-1.0.25.tar.xz
|
||||
/cups-filters-1.0.28.tar.xz
|
||||
/cups-filters-1.0.29.tar.xz
|
||||
/cups-filters-1.0.30.tar.xz
|
||||
/cups-filters-1.0.31.tar.xz
|
||||
/cups-filters-1.0.32.tar.xz
|
||||
/cups-filters-1.0.33.tar.xz
|
||||
/cups-filters-1.0.34.tar.xz
|
||||
/cups-filters-1.0.35.tar.xz
|
||||
/cups-filters-1.0.36.tar.xz
|
||||
/cups-filters-1.0.37.tar.xz
|
||||
/cups-filters-1.0.38.tar.xz
|
||||
/cups-filters-1.0.39.tar.xz
|
||||
/cups-filters-1.0.40.tar.xz
|
||||
/cups-filters-1.0.41.tar.xz
|
||||
/cups-filters-1.0.42.tar.xz
|
||||
/cups-filters-1.0.43.tar.xz
|
||||
/cups-filters-1.0.44.tar.xz
|
||||
/cups-filters-1.0.45.tar.xz
|
||||
/cups-filters-1.0.46.tar.xz
|
||||
/cups-filters-1.0.47.tar.xz
|
||||
/cups-filters-1.0.48.tar.xz
|
||||
/cups-filters-1.0.49.tar.xz
|
||||
/cups-filters-1.0.50.tar.xz
|
||||
/cups-filters-1.0.51.tar.xz
|
||||
/cups-filters-1.0.52.tar.xz
|
||||
/cups-filters-1.0.53.tar.xz
|
||||
/cups-filters-1.0.54.tar.xz
|
||||
/cups-filters-1.0.55.tar.xz
|
||||
/cups-filters-1.0.58.tar.xz
|
||||
/cups-filters-1.0.59.tar.xz
|
||||
/cups-filters-1.0.60.tar.xz
|
||||
/cups-filters-1.0.61.tar.xz
|
||||
/cups-filters-1.0.65.tar.xz
|
||||
/cups-filters-1.0.66.tar.xz
|
||||
/cups-filters-1.0.67.tar.xz
|
||||
/cups-filters-1.0.68.tar.xz
|
||||
/cups-filters-1.0.69.tar.xz
|
||||
/cups-filters-1.0.70.tar.xz
|
||||
/cups-filters-1.0.71.tar.xz
|
||||
/cups-filters-1.0.73.tar.xz
|
||||
/cups-filters-1.0.74.tar.xz
|
||||
/cups-filters-1.0.75.tar.xz
|
||||
/cups-filters-1.0.76.tar.xz
|
||||
/cups-filters-1.1.0.tar.xz
|
||||
/cups-filters-1.2.0.tar.xz
|
||||
/cups-filters-1.3.0.tar.xz
|
||||
/cups-filters-1.4.0.tar.xz
|
||||
/cups-filters-1.5.0.tar.xz
|
||||
/cups-filters-1.6.0.tar.xz
|
||||
/cups-filters-1.7.0.tar.xz
|
||||
/cups-filters-1.8.0.tar.xz
|
||||
/cups-filters-1.8.1.tar.xz
|
||||
/cups-filters-1.8.2.tar.xz
|
||||
/cups-filters-1.8.3.tar.xz
|
||||
/cups-filters-1.9.0.tar.xz
|
||||
/cups-filters-1.10.0.tar.xz
|
||||
/cups-filters-1.11.2.tar.xz
|
||||
/cups-filters-1.11.3.tar.xz
|
||||
/cups-filters-1.11.4.tar.xz
|
||||
/cups-filters-1.11.5.tar.xz
|
||||
/cups-filters-1.11.6.tar.xz
|
||||
/cups-filters-1.12.0.tar.xz
|
||||
/cups-filters-1.13.0.tar.xz
|
||||
/cups-filters-1.13.1.tar.xz
|
||||
/cups-filters-1.13.2.tar.xz
|
||||
/cups-filters-1.13.3.tar.xz
|
||||
/cups-filters-1.13.4.tar.xz
|
||||
/cups-filters-1.13.5.tar.xz
|
||||
/cups-filters-1.14.0.tar.xz
|
||||
/cups-filters-1.14.1.tar.xz
|
||||
/cups-filters-1.16.0.tar.xz
|
||||
/cups-filters-1.16.1.tar.xz
|
||||
/cups-filters-1.16.3.tar.xz
|
||||
/cups-filters-1.17.2.tar.xz
|
||||
/cups-filters-1.17.7.tar.xz
|
||||
/cups-filters-1.17.8.tar.xz
|
||||
/cups-filters-1.17.9.tar.xz
|
||||
/cups-filters-1.19.0.tar.xz
|
||||
/cups-filters-1.20.0.tar.xz
|
||||
/cups-filters-*.tar.gz
|
||||
|
|
|
|||
27
0001-Fix-build-failure-with-GCC-15-and-std-c23.patch
Normal file
27
0001-Fix-build-failure-with-GCC-15-and-std-c23.patch
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
From 44f59a1aa74c48515d8feba5a61b7ea3aaa592c4 Mon Sep 17 00:00:00 2001
|
||||
From: Zdenek Dohnal <zdohnal@redhat.com>
|
||||
Date: Fri, 24 Jan 2025 09:44:58 +0100
|
||||
Subject: [PATCH] Fix build failure with GCC 15 and -std=c23
|
||||
|
||||
The newest standard has more strict data type checks, function pointers
|
||||
in function prototypes have to declare data types of its arguments.
|
||||
---
|
||||
filter/foomatic-rip/process.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/filter/foomatic-rip/process.h b/filter/foomatic-rip/process.h
|
||||
index f6e15f65c..54a42923a 100644
|
||||
--- a/filter/foomatic-rip/process.h
|
||||
+++ b/filter/foomatic-rip/process.h
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <sys/wait.h>
|
||||
|
||||
|
||||
-pid_t start_process(const char *name, int (*proc_func)(), void *user_arg,
|
||||
+pid_t start_process(const char *name, int (*proc_func)(FILE*, FILE*, void*), void *user_arg,
|
||||
FILE **fdin, FILE **fdout);
|
||||
pid_t start_system_process(const char *name, const char *command, FILE **fdin,
|
||||
FILE **fdout);
|
||||
--
|
||||
2.48.1
|
||||
|
||||
1485
0001-Introduce-foomatic-hash-and-reject-unauthorized-valu.patch
Normal file
1485
0001-Introduce-foomatic-hash-and-reject-unauthorized-valu.patch
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,79 @@
|
|||
From 0fe46c511e81062575b05936f804eb18c9f0a011 Mon Sep 17 00:00:00 2001
|
||||
From: Zdenek Dohnal <zdohnal@redhat.com>
|
||||
Date: Wed, 12 Nov 2025 15:47:24 +0100
|
||||
Subject: [PATCH] rastertopclx.c: Fix infinite loop caused by crafted file
|
||||
|
||||
Infinite loop happened because of crafted input raster file, which led
|
||||
into heap buffer overflow of `CompressBuf` array.
|
||||
|
||||
Based on comments there should be always some `count` when compressing
|
||||
the data, and processing of crafted file ended with offset and count
|
||||
being 0.
|
||||
|
||||
Fixes CVE-2025-64524
|
||||
---
|
||||
filter/rastertopclx.c | 25 +++++++++++++++++++++++--
|
||||
1 file changed, 23 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/filter/rastertopclx.c b/filter/rastertopclx.c
|
||||
index ded86f114..39cb378bf 100644
|
||||
--- a/filter/rastertopclx.c
|
||||
+++ b/filter/rastertopclx.c
|
||||
@@ -825,10 +825,10 @@ StartPage(cf_filter_data_t *data, // I - filter data
|
||||
}
|
||||
|
||||
if (header->cupsCompression)
|
||||
- CompBuffer = malloc(DotBufferSize * 4);
|
||||
+ CompBuffer = calloc(DotBufferSize * 4, sizeof(unsigned char));
|
||||
|
||||
if (header->cupsCompression >= 3)
|
||||
- SeedBuffer = malloc(DotBufferSize);
|
||||
+ SeedBuffer = calloc(DotBufferSize, sizeof(unsigned char));
|
||||
|
||||
SeedInvalid = 1;
|
||||
|
||||
@@ -1159,6 +1159,13 @@ CompressData(unsigned char *line, // I - Data to compress
|
||||
seed ++;
|
||||
count ++;
|
||||
}
|
||||
+
|
||||
+ //
|
||||
+ // Bail out if we don't have count to compress
|
||||
+ //
|
||||
+
|
||||
+ if (count == 0)
|
||||
+ break;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1252,6 +1259,13 @@ CompressData(unsigned char *line, // I - Data to compress
|
||||
|
||||
count = line_ptr - start;
|
||||
|
||||
+ //
|
||||
+ // Bail out if we don't have count to compress
|
||||
+ //
|
||||
+
|
||||
+ if (count == 0)
|
||||
+ break;
|
||||
+
|
||||
#if 0
|
||||
fprintf(stderr,
|
||||
"DEBUG: offset=%d, count=%d, comp_ptr=%p(%d of %d)...\n",
|
||||
@@ -1424,6 +1438,13 @@ CompressData(unsigned char *line, // I - Data to compress
|
||||
|
||||
count = (line_ptr - start) / 3;
|
||||
|
||||
+ //
|
||||
+ // Bail out if we don't have count to compress
|
||||
+ //
|
||||
+
|
||||
+ if (count == 0)
|
||||
+ break;
|
||||
+
|
||||
//
|
||||
// Place mode 10 compression data in the buffer; each sequence
|
||||
// starts with a command byte that looks like:
|
||||
--
|
||||
2.51.1
|
||||
|
||||
1
ci.fmf
Normal file
1
ci.fmf
Normal file
|
|
@ -0,0 +1 @@
|
|||
resultsdb-testcase: separate
|
||||
BIN
cups-filters-1.28.13.tar.xz
Normal file
BIN
cups-filters-1.28.13.tar.xz
Normal file
Binary file not shown.
|
|
@ -1,21 +0,0 @@
|
|||
diff -up cups-filters-1.16.1/utils/cups-browsed.conf.in.createall cups-filters-1.16.1/utils/cups-browsed.conf.in
|
||||
--- cups-filters-1.16.1/utils/cups-browsed.conf.in.createall 2018-01-02 17:17:51.555941155 +0100
|
||||
+++ cups-filters-1.16.1/utils/cups-browsed.conf.in 2018-01-02 17:19:49.651048564 +0100
|
||||
@@ -359,7 +359,7 @@ BrowseRemoteProtocols @BROWSEREMOTEPROTO
|
||||
|
||||
# LocalQueueNamingRemoteCUPS DNS-SD
|
||||
# LocalQueueNamingRemoteCUPS MakeModel
|
||||
-# LocalQueueNamingRemoteCUPS RemoteName
|
||||
+LocalQueueNamingRemoteCUPS RemoteName
|
||||
# LocalQueueNamingIPPPrinter DNS-SD
|
||||
# LocalQueueNamingIPPPrinter MakeModel
|
||||
|
||||
@@ -453,7 +453,7 @@ BrowseRemoteProtocols @BROWSEREMOTEPROTO
|
||||
# CreateIPPPrinterQueues AppleRaster
|
||||
# CreateIPPPrinterQueues Everywhere AppleRaster
|
||||
# CreateIPPPrinterQueues Driverless
|
||||
-# CreateIPPPrinterQueues All
|
||||
+CreateIPPPrinterQueues All
|
||||
|
||||
|
||||
# If cups-browsed is automatically creating print queues for native
|
||||
|
|
@ -1,100 +1,90 @@
|
|||
%if 0%{?fedora}
|
||||
%bcond_without mdns
|
||||
%bcond_without braille
|
||||
%else
|
||||
%bcond_with mdns
|
||||
%bcond_with braille
|
||||
%endif
|
||||
|
||||
# currently we use CUPS PPD compiler which will be removed
|
||||
# in CUPS 3.0, then we will use PPD compiler from libppd-tools
|
||||
%bcond_without cups_ppdc
|
||||
|
||||
# we build CUPS also with relro
|
||||
%global _hardened_build 1
|
||||
|
||||
Summary: OpenPrinting CUPS filters and backends
|
||||
Summary: OpenPrinting CUPS filters for CUPS 2.X
|
||||
Name: cups-filters
|
||||
Version: 1.20.0
|
||||
Release: 6%{?dist}
|
||||
Epoch: 1
|
||||
Version: 2.0.1
|
||||
Release: 12%{?dist}
|
||||
|
||||
# For a breakdown of the licensing, see COPYING file
|
||||
# GPLv2: filters: commandto*, imagetoraster, pdftops, rasterto*,
|
||||
# imagetopdf, pstopdf, texttopdf
|
||||
# backends: parallel, serial
|
||||
# GPLv2+: filters: gstopxl, textonly, texttops, imagetops, foomatic-rip
|
||||
# GPLv3: filters: bannertopdf
|
||||
# GPLv3+: filters: urftopdf, rastertopdf
|
||||
# LGPLv2+: utils: cups-browsed
|
||||
# MIT: filters: gstoraster, pdftoijs, pdftoopvp, pdftopdf, pdftoraster
|
||||
License: GPLv2 and GPLv2+ and GPLv3 and GPLv3+ and LGPLv2+ and MIT
|
||||
# the CUPS exception text is the same as LLVM exception, so using that name with
|
||||
# agreement from legal team
|
||||
# https://lists.fedoraproject.org/archives/list/legal@lists.fedoraproject.org/message/A7GFSD6M3GYGSI32L2FC5KB22DUAEQI3/
|
||||
License: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
Url: http://www.linuxfoundation.org/collaborate/workgroups/openprinting/cups-filters
|
||||
Source0: http://www.openprinting.org/download/cups-filters/cups-filters-%{version}.tar.xz
|
||||
URL: https://github.com/OpenPrinting/cups-filters
|
||||
Source0: %{URL}/releases/download/%{version}/%{name}-%{version}.tar.gz
|
||||
Source1: lftocrlf.ppd
|
||||
Source2: lftocrlf
|
||||
|
||||
Patch01: cups-filters-createall.patch
|
||||
|
||||
Requires: cups-filters-libs%{?_isa} = %{version}-%{release}
|
||||
# Patches
|
||||
# https://github.com/OpenPrinting/cups-filters/pull/618
|
||||
Patch001: 0001-Fix-build-failure-with-GCC-15-and-std-c23.patch
|
||||
# introducing foomatic-hash, but without rejecting values in foomatic-rip
|
||||
# https://github.com/OpenPrinting/cups-filters/pull/648
|
||||
Patch002: 0001-Introduce-foomatic-hash-and-reject-unauthorized-valu.patch
|
||||
# make sure errors from foomatic-rip are propagated
|
||||
# https://github.com/OpenPrinting/cups-filters/pull/649
|
||||
Patch003: foomatic-ripdie-error.patch
|
||||
# rejecting the unknown values in foomatic-rip
|
||||
# https://github.com/OpenPrinting/cups-filters/pull/648
|
||||
Patch004: foomaticrip-reject-unknown-values.patch
|
||||
# CVE-2025-64524 fix
|
||||
Patch005: 0001-rastertopclx.c-Fix-infinite-loop-caused-by-crafted-f.patch
|
||||
|
||||
# gcc and gcc-c++ is not in buildroot by default
|
||||
|
||||
# gcc for backends (implicitclass, parallel, serial, backend error handling)
|
||||
# cupsfilters (colord, color manager...), filter (banners,
|
||||
# commandto*, braille, foomatic-rip, imagetoraster, imagetopdf, gstoraster e.g.),
|
||||
# fontembed, cups-browsed
|
||||
BuildRequires: gcc
|
||||
# gcc-c++ for pdftoopvp, pdftopdf
|
||||
BuildRequires: gcc-c++
|
||||
|
||||
BuildRequires: cups-devel
|
||||
BuildRequires: pkgconfig
|
||||
# pdftopdf
|
||||
BuildRequires: pkgconfig(libqpdf)
|
||||
# pdftops
|
||||
BuildRequires: poppler-utils
|
||||
# pdftoijs, pdftoopvp, pdftoraster, gstoraster
|
||||
BuildRequires: pkgconfig(poppler)
|
||||
BuildRequires: poppler-cpp-devel
|
||||
BuildRequires: libjpeg-devel
|
||||
BuildRequires: libtiff-devel
|
||||
BuildRequires: pkgconfig(libpng)
|
||||
BuildRequires: pkgconfig(zlib)
|
||||
BuildRequires: pkgconfig(dbus-1)
|
||||
BuildRequires: ghostscript
|
||||
# libijs
|
||||
BuildRequires: pkgconfig(ijs)
|
||||
BuildRequires: pkgconfig(freetype2)
|
||||
BuildRequires: pkgconfig(fontconfig)
|
||||
BuildRequires: pkgconfig(lcms2)
|
||||
# cups-browsed
|
||||
BuildRequires: avahi-devel
|
||||
BuildRequires: pkgconfig(avahi-glib)
|
||||
BuildRequires: pkgconfig(glib-2.0)
|
||||
BuildRequires: systemd
|
||||
|
||||
# Make sure we get postscriptdriver tags.
|
||||
BuildRequires: python3-cups
|
||||
|
||||
# Testing font for test scripts.
|
||||
BuildRequires: dejavu-sans-fonts
|
||||
# driverless backend/driver was moved into a separate package to
|
||||
# remove avahi dependency for filters
|
||||
# remove once C10S is released and F40 is EOL
|
||||
Conflicts: cups-filters-driverless < 1:2.0.0-3
|
||||
|
||||
# autogen.sh
|
||||
BuildRequires: autoconf
|
||||
# autogen.sh
|
||||
BuildRequires: automake
|
||||
# filter binaries and backends are written in C
|
||||
BuildRequires: gcc
|
||||
# autogen.sh
|
||||
BuildRequires: gettext-devel
|
||||
# for autosetup
|
||||
BuildRequires: git-core
|
||||
# autogen.sh
|
||||
BuildRequires: libtool
|
||||
# uses make for compiling
|
||||
BuildRequires: make
|
||||
# we use pkgconfig to get a proper devel packages
|
||||
# proper CFLAGS and LDFLAGS
|
||||
BuildRequires: pkgconf-pkg-config
|
||||
# uses CUPS API
|
||||
BuildRequires: pkgconfig(cups) >= 2.2.2
|
||||
# uses cupsfilters API
|
||||
BuildRequires: pkgconfig(libcupsfilters) >= 2.0b3
|
||||
# uses PPD API
|
||||
BuildRequires: pkgconfig(libppd) >= 2.0b3
|
||||
# Make sure we get postscriptdriver tags.
|
||||
BuildRequires: python3-cups
|
||||
# for systemd unit for upgrade
|
||||
BuildRequires: systemd-rpm-macros
|
||||
|
||||
%if %{with braille}
|
||||
Recommends: braille-printer-app
|
||||
%endif
|
||||
# needs cups dirs
|
||||
Requires: cups-filesystem
|
||||
Requires: poppler-utils
|
||||
|
||||
# texttopdf
|
||||
Requires: liberation-mono-fonts
|
||||
|
||||
# pstopdf
|
||||
Requires: bc grep sed which
|
||||
|
||||
# cups-browsed
|
||||
Requires(post): systemd
|
||||
Requires(preun): systemd
|
||||
Requires(postun): systemd
|
||||
|
||||
%package libs
|
||||
Summary: OpenPrinting CUPS filters and backends - cupsfilters and fontembed libraries
|
||||
# LGPLv2: libcupsfilters
|
||||
# MIT: libfontembed
|
||||
License: LGPLv2 and MIT
|
||||
|
||||
%package devel
|
||||
Summary: OpenPrinting CUPS filters and backends - development environment
|
||||
License: LGPLv2 and MIT
|
||||
Requires: cups-filters-libs%{?_isa} = %{version}-%{release}
|
||||
|
||||
%description
|
||||
Contains backends, filters, and other software that was
|
||||
|
|
@ -103,189 +93,680 @@ Apple Inc. In addition it contains additional filters developed
|
|||
independently of Apple, especially filters for the PDF-centric printing
|
||||
workflow introduced by OpenPrinting.
|
||||
|
||||
%description libs
|
||||
This package provides cupsfilters and fontembed libraries.
|
||||
|
||||
%description devel
|
||||
This is the development package for OpenPrinting CUPS filters and backends.
|
||||
%package driverless
|
||||
Summary: OpenPrinting driverless backends and drivers for CUPS 2.X
|
||||
License: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
# backends and drivers has been moved from the main package to subpackage
|
||||
# to remove the avahi/mdns dependency needed for driverless
|
||||
# remove after F40 is EOL and C10S is released
|
||||
Conflicts: cups-filters < 1:2.0.0-3
|
||||
|
||||
# finding device via driverless depends on running avahi-daemon
|
||||
Requires: avahi
|
||||
# ippfind is used in driverless backend, not needed classic PPD based print queue
|
||||
Requires: cups-ipptool
|
||||
# cups-browsed needs systemd-resolved or nss-mdns for resolving .local addresses of remote print queues
|
||||
# let's not require a specific package and let the user decide what he wants to use.
|
||||
# just recommend nss-mdns for Fedora for now to have working default, but
|
||||
# don't hardwire it for resolved users
|
||||
%if %{with mdns}
|
||||
Recommends: nss-mdns
|
||||
%endif
|
||||
|
||||
# needs cups dirs
|
||||
Requires: cups-filesystem
|
||||
|
||||
|
||||
%description driverless
|
||||
Contains backends and drivers for driverless implementation for cups-filters,
|
||||
which makes driverless printers to be seen when listing printers nearby and gives
|
||||
a specific generated driver for driverless printer in the local network. They are
|
||||
tools for backward compatibility with applications which don't handle CUPS temporary
|
||||
queues.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%autosetup -S git -N
|
||||
|
||||
%patch01 -p1 -b .createall
|
||||
%if 0%{?fedora} >= 43 || 0%{?rhel} >=9
|
||||
%autopatch
|
||||
%else
|
||||
%autopatch -M 3
|
||||
%endif
|
||||
|
||||
|
||||
%build
|
||||
# work-around Rpath
|
||||
./autogen.sh
|
||||
|
||||
# --with-pdftops=hybrid - use Poppler's pdftops instead of Ghostscript for
|
||||
# Brother, Minolta, and Konica Minolta to work around
|
||||
# bugs in the printer's PS interpreters
|
||||
# --with-rcdir=no - don't install SysV init script
|
||||
# --enable-auto-setup-driverless - enable automatic setup of IPP network printers
|
||||
# with driverless support
|
||||
# --enable-driverless - enable PPD generator for driverless printing in
|
||||
# /usr/lib/cups/driver, it is for manual setup of
|
||||
# driverless printers with printer setup tool
|
||||
# --disable-static - do not build static libraries (becuase of Fedora Packaging
|
||||
# Guidelines)
|
||||
# --enable-dbus - enable DBus Connection Manager's code
|
||||
# --disable-silent-rules - verbose build output
|
||||
# --disable-mutool - mupdf is retired in Fedora, use qpdf
|
||||
|
||||
%configure --disable-static \
|
||||
--disable-silent-rules \
|
||||
--with-pdftops=hybrid \
|
||||
--enable-dbus \
|
||||
--with-rcdir=no \
|
||||
%configure --enable-driverless \
|
||||
--enable-individual-cups-filters \
|
||||
--disable-universal-cups-filter \
|
||||
--disable-mutool \
|
||||
--enable-driverless \
|
||||
--enable-auto-setup-driverless
|
||||
--disable-rpath \
|
||||
--disable-silent-rules \
|
||||
--disable-static
|
||||
|
||||
%make_build
|
||||
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
make install DESTDIR=%{buildroot}
|
||||
%make_install
|
||||
|
||||
# Don't ship libtool la files.
|
||||
rm -f %{buildroot}%{_libdir}/lib*.la
|
||||
# 2229776 - Add textonly driver back, but as lftocrlf
|
||||
install -p -m 0755 %{SOURCE2} %{buildroot}%{_cups_serverbin}/filter/lftocrlf
|
||||
install -p -m 0644 %{SOURCE1} %{buildroot}%{_datadir}/ppd/cupsfilters/lftocrlf.ppd
|
||||
|
||||
# Not sure what is this good for.
|
||||
rm -f %{buildroot}%{_bindir}/ttfread
|
||||
# remove this once F43 is EOL
|
||||
%if 0%{?fedora} >= 43 || 0%{?rhel} >=9
|
||||
|
||||
rm -f %{buildroot}%{_pkgdocdir}/INSTALL
|
||||
mkdir -p %{buildroot}%{_pkgdocdir}/fontembed/
|
||||
cp -p fontembed/README %{buildroot}%{_pkgdocdir}/fontembed/
|
||||
mkdir -p %{buildroot}%{_libexecdir}/%{name}
|
||||
|
||||
cat > %{buildroot}%{_libexecdir}/%{name}/posttrans.sh << EOF
|
||||
#!/usr/bin/bash
|
||||
|
||||
if \$(grep -q -R 'FoomaticRIPCommandLine\|FoomaticRipOptionSetting' %{_sysconfdir}/cups/ppd)
|
||||
then
|
||||
tmpfile=\$(mktemp -p /var/tmp foomatic-scan.XXXXXXXX)
|
||||
|
||||
for ppd in %{_sysconfdir}/cups/ppd/*.ppd
|
||||
do
|
||||
foomatic-hash --ppd \$ppd \$tmpfile %{_sysconfdir}/foomatic/hashes.d/hashes.upgrade || :
|
||||
done
|
||||
|
||||
if test -f %{_sysconfdir}/foomatic/hashes.d/hashes.upgrade
|
||||
then
|
||||
echo "Foomatic-rip values which can inject code found - review findings in \$tmpfile. Read release notes for instructions." || :
|
||||
fi
|
||||
else
|
||||
touch %{_sysconfdir}/foomatic/hashes.d/hashes.new
|
||||
fi
|
||||
|
||||
exit 0
|
||||
EOF
|
||||
|
||||
# systemd unit file
|
||||
mkdir -p %{buildroot}%{_unitdir}
|
||||
install -p -m 644 utils/cups-browsed.service %{buildroot}%{_unitdir}
|
||||
|
||||
cat > %{buildroot}%{_unitdir}/foomaticrip-upgrade.service << EOF
|
||||
[Unit]
|
||||
Description=Allowing already installed printers for foomatic-rip
|
||||
ConditionPathIsDirectory=%{_sysconfdir}/foomatic/hashes.d
|
||||
ConditionDirectoryNotEmpty=!%{_sysconfdir}/foomatic/hashes.d
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=bash -c %{_libexecdir}/%{name}/posttrans.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
mkdir -p %{buildroot}%{_unitdir}/cups.service.d
|
||||
|
||||
cat > %{buildroot}%{_unitdir}/cups.service.d/10-foomaticrip-upgrade.conf << EOF
|
||||
[Unit]
|
||||
After=foomaticrip-upgrade.service
|
||||
Wants=foomaticrip-upgrade.service
|
||||
EOF
|
||||
|
||||
%endif
|
||||
|
||||
|
||||
# LSB3.2 requires /usr/bin/foomatic-rip,
|
||||
# create it temporarily as a relative symlink
|
||||
# we may use symlink to universal filter, but LSB is about guaranteed compatibility set
|
||||
# among distibutions, so rather have the strict foomatic-rip filter...
|
||||
ln -sf %{_cups_serverbin}/filter/foomatic-rip %{buildroot}%{_bindir}/foomatic-rip
|
||||
|
||||
# Don't ship urftopdf for now (bug #1002947).
|
||||
rm -f %{buildroot}%{_cups_serverbin}/filter/urftopdf
|
||||
sed -i '/urftopdf/d' %{buildroot}%{_datadir}/cups/mime/cupsfilters.convs
|
||||
%if %{with cups_ppdc}
|
||||
mkdir -p %{buildroot}%{_datadir}/cups/ppdc
|
||||
mv %{buildroot}%{_datadir}/{ppdc/pcl.h,cups/ppdc/pcl.h}
|
||||
mv %{buildroot}%{_datadir}/{ppdc/escp.h,cups/ppdc/escp.h}
|
||||
%endif
|
||||
|
||||
# Don't ship pdftoopvp for now (bug #1027557).
|
||||
rm -f %{buildroot}%{_cups_serverbin}/filter/pdftoopvp
|
||||
rm -f %{buildroot}%{_sysconfdir}/fonts/conf.d/99pdftoopvp.conf
|
||||
# remove license files which are in %%pkgdocdir
|
||||
rm -f %{buildroot}%{_pkgdocdir}/{COPYING,NOTICE,LICENSE}
|
||||
|
||||
# remove INSTALL since it is unnecessary
|
||||
rm -f %{buildroot}%{_pkgdocdir}/INSTALL
|
||||
|
||||
# remove CHANGES-1.x.md, since it is carried by a dependency
|
||||
rm -f %{buildroot}%{_pkgdocdir}/CHANGES-1.x.md
|
||||
|
||||
|
||||
%check
|
||||
make check
|
||||
|
||||
|
||||
%post
|
||||
%systemd_post cups-browsed.service
|
||||
|
||||
# Initial installation
|
||||
if [ $1 -eq 1 ] ; then
|
||||
IN=%{_sysconfdir}/cups/cupsd.conf
|
||||
OUT=%{_sysconfdir}/cups/cups-browsed.conf
|
||||
keyword=BrowsePoll
|
||||
|
||||
# We can remove this after few releases, it's just for the introduction of cups-browsed.
|
||||
if [ -f "$OUT" ]; then
|
||||
echo -e "\n# NOTE: This file is not part of CUPS.\n# You need to enable cups-browsed service\n# and allow ipp-client service in firewall." >> "$OUT"
|
||||
fi
|
||||
|
||||
# move BrowsePoll from cupsd.conf to cups-browsed.conf
|
||||
if [ -f "$IN" ] && grep -iq ^$keyword "$IN"; then
|
||||
if ! grep -iq ^$keyword "$OUT"; then
|
||||
(cat >> "$OUT" <<EOF
|
||||
|
||||
# Settings automatically moved from cupsd.conf by RPM package:
|
||||
EOF
|
||||
) || :
|
||||
(grep -i ^$keyword "$IN" >> "$OUT") || :
|
||||
#systemctl enable cups-browsed.service >/dev/null 2>&1 || :
|
||||
fi
|
||||
sed -i -e "s,^$keyword,#$keyword directive moved to cups-browsed.conf\n#$keyword,i" "$IN" || :
|
||||
fi
|
||||
# remove PPD cache to make bz#2351389 fix work right away
|
||||
# remove after F43 EOL
|
||||
if [ $1 -gt 1 ]
|
||||
then
|
||||
rm -f /var/cache/cups/ppds.dat || :
|
||||
fi
|
||||
|
||||
%if 0%{?fedora} >= 43 || 0%{?rhel} >=9
|
||||
%systemd_post foomaticrip-upgrade.service
|
||||
%endif
|
||||
|
||||
|
||||
%preun
|
||||
%systemd_preun cups-browsed.service
|
||||
%if 0%{?fedora} >= 43 || 0%{?rhel} >=9
|
||||
%systemd_preun foomaticrip-upgrade.service
|
||||
%endif
|
||||
|
||||
|
||||
%postun
|
||||
%systemd_postun_with_restart cups-browsed.service
|
||||
%if 0%{?fedora} >= 43 || 0%{?rhel} >=9
|
||||
%systemd_postun foomaticrip-upgrade.service
|
||||
%endif
|
||||
|
||||
%post libs -p /sbin/ldconfig
|
||||
|
||||
%postun libs -p /sbin/ldconfig
|
||||
%posttrans
|
||||
%if 0%{?fedora} >= 43 || 0%{?rhel} >=9
|
||||
%systemd_posttrans_with_reload foomaticrip-upgrade.service
|
||||
%endif
|
||||
|
||||
if [ $1 -gt 1 ]
|
||||
then
|
||||
# since we moved to individual filters, we have to restart cups
|
||||
# to load new conversion tables if it is running
|
||||
# remove by F43 EOL and C11S release
|
||||
if systemctl is-active cups &> /dev/null
|
||||
then
|
||||
systemctl restart cups || :
|
||||
fi
|
||||
|
||||
%if 0%{?fedora} >= 43 || 0%{?rhel} >=9
|
||||
systemctl start foomaticrip-upgrade.service || :
|
||||
%endif
|
||||
fi
|
||||
|
||||
|
||||
%files
|
||||
%{_pkgdocdir}/README
|
||||
%{_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
|
||||
# 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
|
||||
%attr(0755,root,root) %{_cups_serverbin}/backend/cups-brf
|
||||
%license COPYING LICENSE NOTICE
|
||||
%doc AUTHORS ABOUT-NLS CHANGES.md CONTRIBUTING.md DEVELOPING.md README.md
|
||||
%{_bindir}/foomatic-hash
|
||||
%{_bindir}/foomatic-rip
|
||||
%{_bindir}/driverless
|
||||
%{_cups_serverbin}/backend/driverless
|
||||
%{_cups_serverbin}/driver/driverless
|
||||
%{_datadir}/cups/banners
|
||||
%{_datadir}/cups/braille
|
||||
%{_datadir}/cups/charsets
|
||||
%{_datadir}/cups/data/*
|
||||
# this needs to be in the main package because of cupsfilters.drv
|
||||
%{_datadir}/cups/ppdc/pcl.h
|
||||
%{_datadir}/cups/ppdc/braille.defs
|
||||
%{_datadir}/cups/ppdc/fr-braille.po
|
||||
%{_datadir}/cups/ppdc/imagemagick.defs
|
||||
%{_datadir}/cups/ppdc/index.defs
|
||||
%{_datadir}/cups/ppdc/liblouis.defs
|
||||
%{_datadir}/cups/ppdc/liblouis1.defs
|
||||
%{_datadir}/cups/ppdc/liblouis2.defs
|
||||
%{_datadir}/cups/ppdc/liblouis3.defs
|
||||
%{_datadir}/cups/ppdc/liblouis4.defs
|
||||
%{_datadir}/cups/ppdc/media-braille.defs
|
||||
%attr(0744,root,root) %{_cups_serverbin}/backend/beh
|
||||
# all backends needs to be run only as root because of kerberos
|
||||
%attr(0744,root,root) %{_cups_serverbin}/backend/parallel
|
||||
# Serial backend needs to run as root (bug #212577#c4).
|
||||
%attr(0744,root,root) %{_cups_serverbin}/backend/serial
|
||||
%attr(0755,root,root) %{_cups_serverbin}/filter/bannertopdf
|
||||
%attr(0755,root,root) %{_cups_serverbin}/filter/commandtoescpx
|
||||
%attr(0755,root,root) %{_cups_serverbin}/filter/commandtopclx
|
||||
%attr(0755,root,root) %{_cups_serverbin}/filter/foomatic-rip
|
||||
%attr(0755,root,root) %{_cups_serverbin}/filter/gstopdf
|
||||
%attr(0755,root,root) %{_cups_serverbin}/filter/gstopxl
|
||||
%attr(0755,root,root) %{_cups_serverbin}/filter/gstoraster
|
||||
%attr(0755,root,root) %{_cups_serverbin}/filter/imagetopdf
|
||||
%attr(0755,root,root) %{_cups_serverbin}/filter/imagetops
|
||||
%attr(0755,root,root) %{_cups_serverbin}/filter/imagetoraster
|
||||
# 2229776 - Add textonly driver back, but as lftocrlf
|
||||
%attr(0755,root,root) %{_cups_serverbin}/filter/lftocrlf
|
||||
%attr(0755,root,root) %{_cups_serverbin}/filter/pclmtoraster
|
||||
%attr(0755,root,root) %{_cups_serverbin}/filter/pdftopdf
|
||||
%attr(0755,root,root) %{_cups_serverbin}/filter/pdftops
|
||||
%attr(0755,root,root) %{_cups_serverbin}/filter/pdftoraster
|
||||
%attr(0755,root,root) %{_cups_serverbin}/filter/pwgtopclm
|
||||
%attr(0755,root,root) %{_cups_serverbin}/filter/pwgtopdf
|
||||
%attr(0755,root,root) %{_cups_serverbin}/filter/pwgtoraster
|
||||
%attr(0755,root,root) %{_cups_serverbin}/filter/rastertoescpx
|
||||
%attr(0755,root,root) %{_cups_serverbin}/filter/rastertopclx
|
||||
%attr(0755,root,root) %{_cups_serverbin}/filter/rastertops
|
||||
%attr(0755,root,root) %{_cups_serverbin}/filter/texttopdf
|
||||
%attr(0755,root,root) %{_cups_serverbin}/filter/texttops
|
||||
%attr(0755,root,root) %{_cups_serverbin}/filter/texttotext
|
||||
%{_datadir}/cups/drv/cupsfilters.drv
|
||||
%{_datadir}/cups/drv/generic-brf.drv
|
||||
%{_datadir}/cups/drv/generic-ubrl.drv
|
||||
%{_datadir}/cups/drv/indexv3.drv
|
||||
%{_datadir}/cups/drv/indexv4.drv
|
||||
%{_datadir}/cups/mime/cupsfilters.types
|
||||
%{_datadir}/cups/mime/cupsfilters.convs
|
||||
%{_datadir}/cups/mime/cupsfilters-ghostscript.convs
|
||||
%{_datadir}/cups/mime/cupsfilters-individual.convs
|
||||
%{_datadir}/cups/mime/cupsfilters-poppler.convs
|
||||
%{_datadir}/cups/mime/braille.convs
|
||||
%{_datadir}/cups/mime/braille.types
|
||||
%dir %{_datadir}/foomatic
|
||||
%dir %{_datadir}/foomatic/hashes.d
|
||||
%{_datadir}/ppd/cupsfilters
|
||||
%{_sbindir}/cups-browsed
|
||||
%{_unitdir}/cups-browsed.service
|
||||
%{_mandir}/man8/cups-browsed.8.gz
|
||||
%{_mandir}/man5/cups-browsed.conf.5.gz
|
||||
%if %{with cups_ppdc}
|
||||
# escp.h and pcl.h are required during runtime, because
|
||||
# CUPS PPD compiler (ppdc) uses them for generating drivers
|
||||
# per request from cupsfilters.drv file
|
||||
%{_datadir}/cups/ppdc/escp.h
|
||||
%{_datadir}/cups/ppdc/pcl.h
|
||||
%else
|
||||
%dir %{_datadir}/ppdc
|
||||
%{_datadir}/ppdc/escp.h
|
||||
%{_datadir}/ppdc/pcl.h
|
||||
%endif
|
||||
%{_mandir}/man1/foomatic-hash.1.gz
|
||||
%{_mandir}/man1/foomatic-rip.1.gz
|
||||
%config(noreplace) %{_sysconfdir}/foomatic
|
||||
%if 0%{?fedora} >= 43 || 0%{?rhel} >=9
|
||||
%dir %{_libexecdir}/%{name}
|
||||
%attr(0744,root,root) %{_libexecdir}/%{name}/posttrans.sh
|
||||
%ghost %attr(0644,root,root) %{_sysconfdir}/foomatic/hashes.d/hashes.new
|
||||
%dir %{_unitdir}/cups.service.d
|
||||
%{_unitdir}/cups.service.d/10-foomaticrip-upgrade.conf
|
||||
%{_unitdir}/foomaticrip-upgrade.service
|
||||
%endif
|
||||
|
||||
%files driverless
|
||||
%license COPYING LICENSE NOTICE
|
||||
%{_bindir}/driverless
|
||||
%{_bindir}/driverless-fax
|
||||
%{_cups_serverbin}/backend/driverless
|
||||
%{_cups_serverbin}/backend/driverless-fax
|
||||
%{_cups_serverbin}/driver/driverless
|
||||
%{_cups_serverbin}/driver/driverless-fax
|
||||
%{_mandir}/man1/driverless.1.gz
|
||||
|
||||
%files libs
|
||||
%dir %{_pkgdocdir}/
|
||||
%{_pkgdocdir}/COPYING
|
||||
%{_pkgdocdir}/fontembed/README
|
||||
%{_libdir}/libcupsfilters.so.*
|
||||
%{_libdir}/libfontembed.so.*
|
||||
|
||||
%files devel
|
||||
%{_includedir}/cupsfilters
|
||||
%{_includedir}/fontembed
|
||||
%{_datadir}/cups/ppdc/escp.h
|
||||
%{_libdir}/pkgconfig/libcupsfilters.pc
|
||||
%{_libdir}/pkgconfig/libfontembed.pc
|
||||
%{_libdir}/libcupsfilters.so
|
||||
%{_libdir}/libfontembed.so
|
||||
|
||||
%changelog
|
||||
* Fri Nov 28 2025 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0.1-12
|
||||
- fix CVE-2025-64524
|
||||
|
||||
* Mon Nov 10 2025 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0.1-11
|
||||
- change return value of foomatic-hash if built without libppd
|
||||
|
||||
* Wed Oct 01 2025 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0.1-10
|
||||
- protect older Fedoras from F43+ changes, fix installability report about hashes.new
|
||||
|
||||
* Thu Jul 31 2025 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0.1-9
|
||||
- Reject unknown values in foomatic-rip in F43+
|
||||
|
||||
* Wed Jul 30 2025 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0.1-8
|
||||
- Introduce foomatic-hash, but not rejecting values in foomatic-rip
|
||||
|
||||
* Wed Jul 23 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.0.1-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
|
||||
|
||||
* Mon Jun 09 2025 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0.1-6
|
||||
- CUPS restart has to happen after universal filter is gone for good (in posttrans) (fedora#2370978)
|
||||
|
||||
* Mon Jun 02 2025 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0.1-5
|
||||
- individual filters have to explicitly enabled
|
||||
|
||||
* Mon Jun 02 2025 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0.1-4
|
||||
- disable universal filter for now - some 3rd party drivers did not work with it
|
||||
|
||||
* Tue Mar 11 2025 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0.1-3
|
||||
- textonly driver was missing (fedora#2351389)
|
||||
|
||||
* Fri Jan 24 2025 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0.1-2
|
||||
- fix FTBFS (fedora#2340017)
|
||||
|
||||
* Thu Jan 16 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.0.1-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
|
||||
|
||||
* Thu Aug 15 2024 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0.1-1
|
||||
- 2.0.1
|
||||
|
||||
* Fri Jul 19 2024 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0.0-9
|
||||
- fix missing epochs in conflicts
|
||||
|
||||
* Wed Jul 17 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.0.0-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
|
||||
|
||||
* Tue May 28 2024 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0.0-7
|
||||
- 2283295 - The directory /usr/share/ppdc/ is not in the RPM database.
|
||||
|
||||
* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.0.0-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.0.0-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
* Tue Dec 19 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0.0-4
|
||||
- make driverless subpackage require avahi and ipptool - they don't
|
||||
work without them
|
||||
|
||||
* Tue Dec 19 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0.0-3
|
||||
- introduce cups-filters-driverless to strip avahi dependency for filters
|
||||
|
||||
* Tue Dec 19 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0.0-2
|
||||
- use exact foomatic-rip filter to comply with LSB
|
||||
|
||||
* Thu Oct 19 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0.0-1
|
||||
- rebase to 2.0.0
|
||||
|
||||
* Mon Aug 07 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0~rc2-3
|
||||
- 2229776 - Add textonly driver back as lftocrlf driver
|
||||
|
||||
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.0~rc2-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
||||
|
||||
* Wed Jun 28 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0~rc2-1
|
||||
- 2.0rc2
|
||||
|
||||
* Wed May 17 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0~rc1-2
|
||||
- 2207970 - CVE-2023-24805 cups-filters: remote code execution in cups-filters, beh CUPS backend
|
||||
|
||||
* Thu Apr 27 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0~rc1-1
|
||||
- 2.0rc1
|
||||
|
||||
* Wed Mar 01 2023 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.0~b3-2
|
||||
- use epoch to ensure clean upgrade path, because I didn't read FPG carefully
|
||||
|
||||
* Mon Feb 20 2023 Zdenek Dohnal <zdohnal@redhat.com> - 2.0b3-1
|
||||
- 2170538 - rebase to 2.0b3
|
||||
|
||||
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.28.16-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
||||
|
||||
* Thu Oct 13 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.16-6
|
||||
- really build with qpdf-11.1.1 (forgot to wait for qpdf in side tag...)
|
||||
|
||||
* Thu Oct 13 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.16-5
|
||||
- rebuilt with qpdf-11.1.1
|
||||
|
||||
* Thu Sep 22 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.16-4
|
||||
- rebuilt with qpdf-11.1.0
|
||||
|
||||
* Thu Sep 22 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.16-3
|
||||
- build braille subpackage only on Fedora and CentOS Stream > 9
|
||||
|
||||
* Wed Sep 21 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.16-2
|
||||
- disable frequent network interface data update, which slows down the queue creation
|
||||
|
||||
* Thu Sep 08 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.16-1
|
||||
- 1.28.16
|
||||
|
||||
* Thu Sep 08 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.15-3
|
||||
- 2123809 - rpm -Va reports error on /etc/cups/cups-browsed.conf
|
||||
|
||||
* Wed Jul 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.28.15-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||
|
||||
* Wed Apr 20 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.15-1
|
||||
- 1.28.15
|
||||
|
||||
* Thu Apr 07 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.14-1
|
||||
- 1.28.14
|
||||
|
||||
* Mon Mar 28 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.13-1
|
||||
- 1.28.13
|
||||
|
||||
* Tue Mar 08 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.12-1
|
||||
- 1.28.12
|
||||
|
||||
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.28.11-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||
|
||||
* Tue Jan 18 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.11-2
|
||||
- raise the NVR to get a new build
|
||||
|
||||
* Mon Jan 17 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.11-1
|
||||
- 1.28.11
|
||||
|
||||
* Mon Jan 17 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.10-4
|
||||
- fix typo in braille requires
|
||||
|
||||
* Mon Jan 17 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.10-3
|
||||
- 2040973 - Make Braille printing support optional
|
||||
|
||||
* Mon Dec 06 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.10-2
|
||||
- 1995728 - Enable braille printing
|
||||
|
||||
* Tue Sep 14 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.10-1
|
||||
- 1.28.10
|
||||
|
||||
* Tue Jul 27 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.9-5
|
||||
- rebuilt with poppler-21.07.0
|
||||
|
||||
* Tue Jul 27 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.9-4
|
||||
- remove build requirement on poppler-devel - we need just poppler-cpp-devel
|
||||
|
||||
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.28.9-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||
|
||||
* Wed Jul 14 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.9-2
|
||||
- 1981603 - pdftopdf doesn't handle "page-range=10-2147483647" correctly
|
||||
|
||||
* Mon Jun 21 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.9-1
|
||||
- 1.28.9
|
||||
|
||||
* Mon Jun 21 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.8-2
|
||||
- 1973056 - cups-browsed doesn't renew DBus subscription in time and all printing comes to a halt
|
||||
|
||||
* Fri May 14 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.8-1
|
||||
- 1.28.8
|
||||
|
||||
* Wed Apr 28 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.7-7
|
||||
- 1954524 - cups-browsed doesn't save "*-default" options
|
||||
|
||||
* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.28.7-6
|
||||
- Rebuilt for updated systemd-rpm-macros
|
||||
See https://pagure.io/fesco/issue/2583.
|
||||
|
||||
* Mon Feb 01 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.7-5
|
||||
- put nss-mdns only for Fedora
|
||||
|
||||
* Thu Jan 28 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.7-4
|
||||
- remove nss-mdns - dont require a specific way how to resolve .local addresses
|
||||
|
||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.28.7-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
* Mon Jan 25 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.7-2
|
||||
- unpush fix for 1904405 - M281fdw now often chokes on URF
|
||||
|
||||
* Mon Jan 11 2021 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.7-1
|
||||
- 1.28.7, urftopdf nor pdftoopvp aren't compiled anymore
|
||||
- 1904405 - HP M281fdw: čžš characters printed as squares with "driverless" driver
|
||||
|
||||
* Mon Dec 07 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.6-1
|
||||
- 1.28.6
|
||||
|
||||
* Tue Dec 01 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.5-4
|
||||
- filters using ijs were removed, removed the dep
|
||||
|
||||
* Tue Nov 24 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.5-3
|
||||
- fix various memory issues within cups-browsed
|
||||
|
||||
* Thu Nov 05 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.5-2
|
||||
- use make and git-core
|
||||
|
||||
* Mon Nov 02 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.5-1
|
||||
- 1.28.5, 1881365 - cups-browsed crashing
|
||||
|
||||
* Tue Sep 29 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.2-3
|
||||
- 1891720 - foomatic-rip files up /var/spool/tmp with temporary files
|
||||
|
||||
* Thu Sep 17 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.2-2
|
||||
- 1879147 - driverless cannot generate ppd for dns-sd based uris
|
||||
|
||||
* Tue Sep 15 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.2-1
|
||||
- 1.28.2
|
||||
|
||||
* Thu Sep 03 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.1-2
|
||||
- revert previous commit - systemd-resolved doesn't work with avahi right now
|
||||
because missing link in NetworkManager
|
||||
|
||||
* Mon Aug 31 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.1-2
|
||||
- MDNS resolving should be done by systemd-resolved now
|
||||
|
||||
* Thu Aug 27 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.28.1-1
|
||||
- 1.28.1 - added driverless fax support
|
||||
|
||||
* Fri Aug 21 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.27.5-7
|
||||
- use configure option instead of downstream, cups-browsed.conf editing, patch
|
||||
- the exact path in cups-browsed manpage was removed, use the patch removing it instead of downstream one
|
||||
- use configure option to dont save queues between restarts instead of downstream patch reverting the issue
|
||||
- memory leaks patch is from upstream too
|
||||
|
||||
* Wed Aug 19 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.27.5-6
|
||||
- 1867412 - cups-browsed leaks memory
|
||||
|
||||
* Thu Aug 06 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.27.5-5
|
||||
- require ipptool explicitly
|
||||
- remove buildrequire on ipptool
|
||||
|
||||
* Wed Aug 05 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.27.5-4
|
||||
- use %%make_build and %%make_install according FPG
|
||||
- own 'new' directories
|
||||
|
||||
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.27.5-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Mon Jul 20 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.27.5-2
|
||||
- 1848575 - [cups, cups-filters] PPD generators creates invalid cupsManualCopies entry
|
||||
|
||||
* Mon Jun 08 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.27.5-1
|
||||
- 1.27.5
|
||||
|
||||
* Tue Apr 14 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.27.4-1
|
||||
- 1.27.4
|
||||
|
||||
* Wed Apr 08 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.27.3-3
|
||||
- memory issues in cups-browsed
|
||||
|
||||
* Mon Apr 06 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.27.3-2
|
||||
- make nss-mdns and avahi recommended
|
||||
|
||||
* Mon Mar 23 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.27.3-1
|
||||
- 1.27.3
|
||||
|
||||
* Fri Mar 13 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.27.2-2
|
||||
- fix leaks in cups-browsed
|
||||
- add require on nss-mdns
|
||||
|
||||
* Mon Mar 02 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.27.2-1
|
||||
- 1.27.2
|
||||
|
||||
* Tue Feb 25 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.27.1-2
|
||||
- 1806862 - foomatic-rip handles empty files in bad way
|
||||
|
||||
* Tue Feb 18 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.27.1-1
|
||||
- 1.27.1
|
||||
|
||||
* Tue Feb 18 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.27.0-2
|
||||
- 1802969 - Service "cups-browsed" is crashing all the time
|
||||
|
||||
* 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
|
||||
|
||||
* Fri Jan 17 2020 Marek Kasik <mkasik@redhat.com> - 1.22.5-11
|
||||
- Rebuild for poppler-0.84.0
|
||||
|
||||
* Wed Jan 15 2020 Zdenek Dohnal <zdohnal@redhat.com> - 1.22.5-11
|
||||
- add buildrequires fro systemd-rpm-macros
|
||||
|
||||
* Tue Nov 26 2019 Zdenek Dohnal <zdohnal@redhat.com> - 1.22.5-10
|
||||
- 1776271 - Updated cups-browsed in RHEL 7.7 leaks sockets
|
||||
|
||||
* Tue Nov 19 2019 Zdenek Dohnal <zdohnal@redhat.com> - 1.22.5-9
|
||||
- rebuilt for qpdf-9.1.0
|
||||
|
||||
* Tue Oct 22 2019 Zdenek Dohnal <zdohnal@redhat.com> - 1.22.5-8
|
||||
- 1756726 - Epson ET 7700 reports pwg support, but pwg does not work
|
||||
|
||||
* Wed Oct 09 2019 Zdenek Dohnal <zdohnal@redhat.com> - 1.22.5-7
|
||||
- gs 9.27 now uses setfilladjust2
|
||||
|
||||
* Tue Sep 17 2019 Zdenek Dohnal <zdohnal@redhat.com> - 1.22.5-6
|
||||
- ftbfs with qpdf-9.0.0
|
||||
- pdftopdf output should not be encrypted
|
||||
|
||||
* Wed Sep 11 2019 Zdenek Dohnal <zdohnal@redhat.com> - 1.22.5-5
|
||||
- require colord, because it is needed for ICC profiles for filters
|
||||
|
||||
* Tue Aug 13 2019 Zdenek Dohnal <zdohnal@redhat.com> - 1.22.5-4
|
||||
- 1740122 - foomatic-rip segfaults when env variable PRINTER is not defined
|
||||
|
||||
* Wed Aug 07 2019 Zdenek Dohnal <zdohnal@redhat.com> - 1.22.5-3
|
||||
- remove unneeded scriptlet
|
||||
|
||||
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.22.5-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
* Mon Apr 08 2019 Zdenek Dohnal <zdohnal@redhat.com> - 1.22.5-1
|
||||
- 1.22.5
|
||||
|
||||
* Tue Mar 26 2019 Zdenek Dohnal <zdohnal@redhat.com> - 1.22.3-1
|
||||
- 1.22.3
|
||||
|
||||
* Fri Feb 01 2019 Zdenek Dohnal <zdohnal@redhat.com> - 1.22.0-4
|
||||
- cups-brf needs to be run as root
|
||||
|
||||
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.22.0-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
* Fri Jan 25 2019 Marek Kasik <mkasik@redhat.com> - 1.22.0-2
|
||||
- Rebuild for poppler-0.73.0
|
||||
|
||||
* Fri Jan 25 2019 Zdenek Dohnal <zdohnal@redhat.com> - 1.22.0-1
|
||||
- 1.22.0
|
||||
|
||||
* Mon Jan 14 2019 Björn Esser <besser82@fedoraproject.org> - 1.21.6-2
|
||||
- Rebuilt for libcrypt.so.2 (#1666033)
|
||||
|
||||
* Tue Jan 08 2019 Zdenek Dohnal <zdohnal@redhat.com> - 1.21.6-1
|
||||
- 1.21.6
|
||||
|
||||
* Thu Dec 13 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.21.5-1
|
||||
- 1.21.5
|
||||
|
||||
* Mon Nov 12 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.21.2-4
|
||||
- links in manpages are wrong
|
||||
|
||||
* Mon Sep 24 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.21.2-3
|
||||
- 1632267 - cups-filters needs to obsolete ghostscript-cups and foomatic-filters
|
||||
- rebuilt for qpdf-8.2.1
|
||||
|
||||
* Fri Sep 21 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.21.2-2
|
||||
- 1628255 - cups-filters: Sticky EOF behavior in glibc breaks descriptor concatenation using dup2 (breaks printing)
|
||||
|
||||
* Mon Sep 10 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.21.2-1
|
||||
- 1.21.2
|
||||
|
||||
* Tue Aug 14 2018 Marek Kasik <mkasik@redhat.com> - 1.20.3-7
|
||||
- Rebuild for poppler-0.67.0
|
||||
|
||||
* Tue Jul 24 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.20.3-6
|
||||
- correcting license
|
||||
|
||||
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.20.3-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||
|
||||
* Mon Jun 25 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.20.3-4
|
||||
- rebuilt for new qpdf-8.1.0
|
||||
|
||||
* Tue Jun 12 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.20.3-3
|
||||
- hybrid pdftops filter requires poppler and ghostscript for run
|
||||
|
||||
* Tue Jun 12 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.20.3-2
|
||||
- cups-browsed needs to have cups.service to run
|
||||
|
||||
* Fri Apr 13 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.20.3-1
|
||||
- 1.20.3
|
||||
|
||||
* Wed Apr 04 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.20.2-1
|
||||
- 1.20.2
|
||||
- fixing discovering of remote CUPS queues and LDAP queues
|
||||
- dependency on poppler-utils is now only recommended
|
||||
|
||||
* Fri Mar 23 2018 Marek Kasik <mkasik@redhat.com> - 1.20.1-4
|
||||
- Rebuild for poppler-0.63.0
|
||||
|
||||
* Wed Mar 07 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.20.1-3
|
||||
- Rebuilt for qpdf-8.0.2
|
||||
|
||||
* Mon Mar 05 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.20.1-2
|
||||
- 1.20.1
|
||||
|
||||
* Wed Feb 28 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.20.0-8
|
||||
- add explicit soname -> warning about soname change
|
||||
|
||||
* Wed Feb 21 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.20.0-7
|
||||
- libjpeg is shipped in libjpeg-turbo and pkgconfig in pkgconf-pkg-config
|
||||
|
||||
* Mon Feb 19 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1.20.0-6
|
||||
- gcc and gcc-c++ is no longer in buildroot by default
|
||||
|
||||
|
|
|
|||
13
foomatic-ripdie-error.patch
Normal file
13
foomatic-ripdie-error.patch
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/filter/foomatic-rip/util.c b/filter/foomatic-rip/util.c
|
||||
index 508bc09..ad79fbf 100644
|
||||
--- a/filter/foomatic-rip/util.c
|
||||
+++ b/filter/foomatic-rip/util.c
|
||||
@@ -76,7 +76,7 @@ rip_die(int status,
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
- _log("Process is dying with \"");
|
||||
+ _log("ERROR: Process is dying with \"");
|
||||
va_start(ap, msg);
|
||||
_logv(msg, ap);
|
||||
va_end(ap);
|
||||
188
foomaticrip-reject-unknown-values.patch
Normal file
188
foomaticrip-reject-unknown-values.patch
Normal file
|
|
@ -0,0 +1,188 @@
|
|||
From 41c5f2f6139e4d3693c2483ee4281202a80ae451 Mon Sep 17 00:00:00 2001
|
||||
From: zdohnal <zdohnal@redhat.com>
|
||||
Date: Tue, 22 Jul 2025 15:12:19 +0200
|
||||
Subject: [PATCH] Introduce foomatic-hash and reject unauthorized values in
|
||||
foomatic-rip (#648)
|
||||
|
||||
The change provides a way for users to have control over what values are
|
||||
allowed for the foomatic-rip-related PPD keywords FoomaticRIPCommandLine,
|
||||
FoomaticRIPCommandLinePDF, and FoomaticRIPOptionSetting. Since the
|
||||
values can be later used when constructing a shell command, the filter
|
||||
foomatic-rip was a target of several exploits (caused by issues at
|
||||
different places in CUPS or in different projects of the printing stack) to
|
||||
do arbitrary code execution when the filter is used.
|
||||
|
||||
By default the filter is run by user lp, so the issue is mitigated, but
|
||||
this PR gives admin complete control over what can be run in
|
||||
foomatic-rip and reject anything injected into system via different
|
||||
ways.
|
||||
|
||||
First, the new tool - foomatic-hash - can be called on a PPD file or
|
||||
directory with drivers/PPDs, with scan output and file with hexadecimal
|
||||
representation of hashed values. Once the scan output is reviewed by
|
||||
admin, admin can decide to put the resulting hashes into
|
||||
/etc/foomatic/hashes.d and allow them for the filter.
|
||||
---
|
||||
Makefile.am | 44 ++-
|
||||
README.md | 23 ++
|
||||
configure.ac | 2 +-
|
||||
filter/foomatic-rip/foomatic-hash.1 | 66 ++++
|
||||
filter/foomatic-rip/foomatic-hash.c | 549 ++++++++++++++++++++++++++
|
||||
filter/foomatic-rip/foomatic-rip.1.in | 16 +
|
||||
filter/foomatic-rip/foomaticrip.c | 75 ----
|
||||
filter/foomatic-rip/foomaticrip.h | 40 --
|
||||
filter/foomatic-rip/options.c | 67 ++++
|
||||
filter/foomatic-rip/process.c | 9 +
|
||||
filter/foomatic-rip/process.h | 3 +
|
||||
filter/foomatic-rip/util.c | 341 +++++++++++++++-
|
||||
filter/foomatic-rip/util.h | 67 ++++
|
||||
13 files changed, 1178 insertions(+), 124 deletions(-)
|
||||
create mode 100644 filter/foomatic-rip/foomatic-hash.1
|
||||
create mode 100644 filter/foomatic-rip/foomatic-hash.c
|
||||
|
||||
diff --git a/filter/foomatic-rip/foomatic-rip.1.in b/filter/foomatic-rip/foomatic-rip.1.in
|
||||
index 9685a95f5..3dff5215f 100644
|
||||
--- a/filter/foomatic-rip/foomatic-rip.1.in
|
||||
+++ b/filter/foomatic-rip/foomatic-rip.1.in
|
||||
@@ -193,6 +193,15 @@ friends. Several PPD files use shell constructs that require a more
|
||||
modern shell like \fBbash\fR, \fBzsh\fR, or \fBksh\fR.
|
||||
|
||||
|
||||
+.SH PPD OPTION VALUE RESTRICTIONS AND EXCEPTIONS
|
||||
+
|
||||
+The values of PPD options \fBFoomaticRIPCommandLine\fR, \fBFoomaticRIPCommandLinePDF\fR and \fBFoomaticRIPOptionSetting\fR
|
||||
+are rejected in the default configuration because of security implications. Users can use the tool \fBfoomatic-hash(1)\fR, which provides
|
||||
+values of affected PPD options from found drivers and hashes of those values in hexadecimal format. User is expected to review the found values,
|
||||
+and if there is nothing suspicious in the output, copy the file with hashes into into the directory \fB@sysconfdir@/foomatic/hashes.d\fR
|
||||
+to allow the exceptions for found values.
|
||||
+
|
||||
+
|
||||
.SH FILES
|
||||
.PD 0
|
||||
.TP 0
|
||||
@@ -209,6 +218,13 @@ The PPD files of the currently defined printers
|
||||
|
||||
Configuration file for foomatic-rip
|
||||
|
||||
+.TP 0
|
||||
+@sysconfdir@/foomatic/hashes.d
|
||||
+.TP 0
|
||||
+@datadir@/foomatic/hashes.d
|
||||
+
|
||||
+Directories with hashes of allowed values
|
||||
+
|
||||
.PD 0
|
||||
|
||||
.\".SH SEE ALSO
|
||||
diff --git a/filter/foomatic-rip/options.c b/filter/foomatic-rip/options.c
|
||||
index bad833bc1..032fe9ec3 100644
|
||||
--- a/filter/foomatic-rip/options.c
|
||||
+++ b/filter/foomatic-rip/options.c
|
||||
@@ -102,6 +102,42 @@ get_icc_profile_for_qualifier(const char **qualifier)
|
||||
}
|
||||
|
||||
|
||||
+//
|
||||
+// 'is_allowed_value' - Check if the option value is allowed.
|
||||
+//
|
||||
+
|
||||
+int // O - Boolean value - true 1 / false 0
|
||||
+is_allowed_value(cups_array_t *ar, // I - Array of already known hashes from system
|
||||
+ char *value, // I - Scanned value from PPD file
|
||||
+ size_t value_len) // I - Value length
|
||||
+{
|
||||
+ char hash_string[65]; // Help array to store hexadecimal hashed string
|
||||
+
|
||||
+ //
|
||||
+ // Empty string is allowed...
|
||||
+ //
|
||||
+
|
||||
+ if (!value_len)
|
||||
+ return (1);
|
||||
+
|
||||
+ //
|
||||
+ // Hash the value and get hexadecimal string for it...
|
||||
+ //
|
||||
+
|
||||
+ if (hash_data((unsigned char*)value, value_len, hash_string, sizeof(hash_string)))
|
||||
+ return (0);
|
||||
+
|
||||
+ //
|
||||
+ // Check if the found hexadecimal hashed string is in the array -> allowed on the system...
|
||||
+ //
|
||||
+
|
||||
+ if (cupsArrayFind(ar, hash_string))
|
||||
+ return (1);
|
||||
+
|
||||
+ return (0);
|
||||
+}
|
||||
+
|
||||
+
|
||||
// a selector is a general tri-dotted specification.
|
||||
// The 2nd and 3rd elements of the qualifier are optionally modified by
|
||||
// cupsICCQualifier2 and cupsICCQualifier3:
|
||||
@@ -1866,12 +1902,19 @@ read_ppd_file(const char *filename)
|
||||
option_t *opt, *current_opt = NULL;
|
||||
param_t *param;
|
||||
icc_mapping_entry_t *entry;
|
||||
+ cups_array_t *known_hashes = NULL;
|
||||
|
||||
fh = fopen(filename, "r");
|
||||
if (!fh)
|
||||
rip_die(EXIT_PRNERR_NORETRY_BAD_SETTINGS, "Unable to open PPD file %s\n", filename);
|
||||
_log("Parsing PPD file ...\n");
|
||||
|
||||
+ if (load_system_hashes(&known_hashes))
|
||||
+ {
|
||||
+ fclose(fh);
|
||||
+ rip_die(EXIT_PRNERR_NORETRY, "Not enough memory for array allocation\n.");
|
||||
+ }
|
||||
+
|
||||
dstrassure(value, 256);
|
||||
|
||||
qualifier_data = list_create();
|
||||
@@ -1955,10 +1998,26 @@ read_ppd_file(const char *filename)
|
||||
}
|
||||
else if (strcmp(key, "FoomaticRIPCommandLine") == 0)
|
||||
{
|
||||
+ if (!is_allowed_value(known_hashes, value->data, strlen(value->data)))
|
||||
+ {
|
||||
+ cupsArrayDelete(known_hashes);
|
||||
+ fclose(fh);
|
||||
+
|
||||
+ rip_die(EXIT_PRNERR_NOTALLOWED, "ERROR: The value of the key %s is not among the allowed values - see foomatic-rip man page for more instructions.\n", key);
|
||||
+ }
|
||||
+
|
||||
unhtmlify(cmd, 4096, value->data);
|
||||
}
|
||||
else if (strcmp(key, "FoomaticRIPCommandLinePDF") == 0)
|
||||
{
|
||||
+ if (!is_allowed_value(known_hashes, value->data, strlen(value->data)))
|
||||
+ {
|
||||
+ cupsArrayDelete(known_hashes);
|
||||
+ fclose(fh);
|
||||
+
|
||||
+ rip_die(EXIT_PRNERR_NOTALLOWED, "ERROR: The value of the key %s is not among the allowed values - see foomatic-rip man page for more instructions.\n", key);
|
||||
+ }
|
||||
+
|
||||
unhtmlify(cmd_pdf, 4096, value->data);
|
||||
}
|
||||
else if (!strcmp(key, "cupsFilter"))
|
||||
@@ -2097,6 +2156,14 @@ read_ppd_file(const char *filename)
|
||||
}
|
||||
else if (!strcmp(key, "FoomaticRIPOptionSetting"))
|
||||
{
|
||||
+ if (!is_allowed_value(known_hashes, value->data, strlen(value->data)))
|
||||
+ {
|
||||
+ cupsArrayDelete(known_hashes);
|
||||
+ fclose(fh);
|
||||
+
|
||||
+ rip_die(EXIT_PRNERR_NOTALLOWED, "ERROR: The value of the key %s is not among the allowed values - see foomatic-rip man page for more instructions.\n", key);
|
||||
+ }
|
||||
+
|
||||
// "*FoomaticRIPOptionSetting <option>[=<choice>]: <code>
|
||||
// For boolean options <choice> is not given
|
||||
option_set_choice(assure_option(name),
|
||||
--
|
||||
2.50.1
|
||||
|
||||
28
gating.yaml
Normal file
28
gating.yaml
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
--- !Policy
|
||||
product_versions:
|
||||
- fedora-*
|
||||
decision_context: bodhi_update_push_testing
|
||||
subject_type: koji_build
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/tier1-public.functional}
|
||||
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/cups-tier1-public.functional}
|
||||
#Rawhide
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- fedora-*
|
||||
decision_context: bodhi_update_push_stable
|
||||
subject_type: koji_build
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/tier1-public.functional}
|
||||
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/cups-tier1-public.functional}
|
||||
|
||||
#gating rhel
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-*
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/tier1-public.functional}
|
||||
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/tier1-internal.functional}
|
||||
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/cups-tier1-public.functional}
|
||||
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/cups-tier1-internal.functional}
|
||||
124
lftocrlf
Normal file
124
lftocrlf
Normal file
|
|
@ -0,0 +1,124 @@
|
|||
#!/bin/bash
|
||||
## Copyright (C) 2003-2006 Red Hat, Inc.
|
||||
## Copyright (C) 2003-2006 Tim Waugh <twaugh@redhat.com>
|
||||
## Changed on 2007/05/17, Opher Shachar, LADPC Ltd.
|
||||
## Added support for page-ranges option.
|
||||
## Added page accounting.
|
||||
|
||||
## This program is free software; you can redistribute it and/or
|
||||
## modify it under the terms of the GNU General Public License
|
||||
## as published by the Free Software Foundation; either version 2
|
||||
## of the License, or (at your option) any later version.
|
||||
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
if [ $# == 0 ]; then
|
||||
echo >&2 "ERROR: $0 job-id user title copies options [file]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Extract the papersize
|
||||
SENDFF=`grep '^\*DefaultSendFF' "$PPD" | cut -d\ -f2`
|
||||
COPIES=1
|
||||
if [ $# -ge 4 ]; then
|
||||
COPIES="$4"
|
||||
fi
|
||||
|
||||
if [ $# -lt 6 ]; then
|
||||
unset TMPFILE
|
||||
trap -- 'rm -f "$TMPFILE"' EXIT
|
||||
TMPFILE=$(mktemp ${TMPDIR:-/tmp}/lftocrlf.XXXXXX)
|
||||
cat > "$TMPFILE"
|
||||
else
|
||||
TMPFILE="$6"
|
||||
fi
|
||||
|
||||
PR=${5#*page-ranges=}
|
||||
# Do options specify page-ranges?
|
||||
if [[ "$PR" != "$5" ]]; then
|
||||
PR=${PR%% *}
|
||||
else
|
||||
#unset PR
|
||||
PR=1-999999
|
||||
fi
|
||||
|
||||
if [[ "$PR" ]]; then
|
||||
TMPFILE2=$(mktemp ${TMPDIR:-/tmp}/lftocrlf2.XXXXXX)
|
||||
pagenum=0
|
||||
EOF=
|
||||
{
|
||||
while [[ "$PR" ]]; do
|
||||
pl=${PR%%,*} ;# take first subrange
|
||||
PR=${PR#$pl};PR=${PR#,} ;# remove from range list
|
||||
pu=${pl#*-} ;# extract upper and lower
|
||||
pl=${pl%-*} ;# pages of subrange
|
||||
# Allows interpreting 0-5,3-10 as 1-5,6-10 rejects 5-1 or 1-
|
||||
(( pagenum >= pl )) && pl=$(( pagenum + 1 ))
|
||||
(( pl > pu )) && continue
|
||||
|
||||
# Loop reading pages until at or over lower page of subrange.
|
||||
while read -d `echo -ne '\f'` -r; do
|
||||
(( pagenum++ ))
|
||||
(( pagenum == pl )) && break
|
||||
done
|
||||
# Did we reach lower page of subrange or EOF?
|
||||
if (( pagenum < pl )); then
|
||||
[[ ! "$REPLY" ]] && break ;# empty last page - we're done.
|
||||
(( pagenum++ ))
|
||||
EOF=y
|
||||
fi
|
||||
# Output page and report to page log
|
||||
if (( pagenum == pl )); then
|
||||
echo -n "${REPLY}" >>"$TMPFILE2"
|
||||
# If EOF then page has no final FF
|
||||
[[ ! "$EOF" ]] && echo -ne '\f' >>"$TMPFILE2"
|
||||
echo "PAGE: $pagenum $COPIES" >&2
|
||||
fi
|
||||
[[ "$EOF" ]] && break
|
||||
# Is the current subrange a single page?
|
||||
(( pagenum == pu )) && continue
|
||||
while read -d `echo -ne '\f'` -r; do
|
||||
(( pagenum++ ))
|
||||
echo -ne "${REPLY}\f" >>"$TMPFILE2"
|
||||
echo "PAGE: $pagenum $COPIES" >&2
|
||||
(( pagenum == pu )) && break
|
||||
done
|
||||
# Could be that we reached EOF before page boundry
|
||||
if (( pagenum < pu )); then
|
||||
if [[ "$REPLY" ]]; then
|
||||
(( pagenum++ ))
|
||||
echo -n "${REPLY}" >>"$TMPFILE2"
|
||||
echo "PAGE: $pagenum $COPIES" >&2
|
||||
fi
|
||||
break
|
||||
fi
|
||||
done
|
||||
} <"$TMPFILE"
|
||||
else
|
||||
TMPFILE2="$TMPFILE"
|
||||
pc=$(grep -co `echo -ne '\f'` "$TMPFILE2")
|
||||
pc=$(( pc * $COPIES ))
|
||||
echo "PAGE: $pc" >&2
|
||||
fi
|
||||
|
||||
while [ "$COPIES" -gt 0 ]; do
|
||||
# Just translate LF->CRLF at the moment, until the PPD has options added.
|
||||
sed -e 's/$/'`echo -ne '\r'`'/g' "$TMPFILE2"
|
||||
|
||||
if [ "$SENDFF" == "True" ]
|
||||
then
|
||||
echo -ne \\014
|
||||
fi
|
||||
|
||||
COPIES=$(($COPIES - 1))
|
||||
done
|
||||
# Cleanup
|
||||
[[ "$TMPFILE" != "$TMPFILE2" ]] && rm -f "$TMPFILE2"
|
||||
exit 0
|
||||
47
lftocrlf.ppd
Normal file
47
lftocrlf.ppd
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
*PPD-Adobe: "4.3"
|
||||
*%
|
||||
*% Text-only printer definition
|
||||
*%
|
||||
*FormatVersion: "4.3"
|
||||
*FileVersion: "1.1"
|
||||
*LanguageVersion: English
|
||||
*LanguageEncoding: ISOLatin1
|
||||
*PCFileName: "LFTOCRLF.PPD"
|
||||
*Manufacturer: "Generic"
|
||||
*Product: "(Generic)"
|
||||
*cupsVersion: 1.0
|
||||
*cupsManualCopies: True
|
||||
*cupsModelNumber: 2
|
||||
*cupsFilter: "text/plain 0 lftocrlf"
|
||||
*ModelName: "Generic LF-to-CRLF printer"
|
||||
*ShortNickName: "Generic LF-to-CRLF printer"
|
||||
*NickName: "Generic LF-to-CRLF printer"
|
||||
*PSVersion: "(2017.000) 0"
|
||||
*LanguageLevel: "2"
|
||||
*ColorDevice: False
|
||||
*DefaultColorSpace: Gray
|
||||
*FileSystem: False
|
||||
*Throughput: "8"
|
||||
*LandscapeOrientation: Plus90
|
||||
*VariablePaperSize: False
|
||||
*TTRasterizer: Type42
|
||||
*DefaultImageableArea: Letter
|
||||
*ImageableArea Letter/US Letter: "18 36 594 756"
|
||||
*DefaultPaperDimension: Letter
|
||||
*PaperDimension Letter/Letter: "612 792"
|
||||
*OpenUI *PageSize/Media Size: PickOne
|
||||
*OrderDependency: 10 AnySetup *PageSize
|
||||
*DefaultPageSize: Letter
|
||||
*PageSize Letter/Letter: "<</PageSize[612 792]/ImagingBBox null>>setpagedevice"
|
||||
*CloseUI: *PageSize
|
||||
*OpenUI *PageRegion: PickOne
|
||||
*OrderDependency: 10 AnySetup *PageRegion
|
||||
*DefaultPageRegion: Letter
|
||||
*PageRegion Letter/Letter: "<</PageSize[612 792]/ImagingBBox null>>setpagedevice"
|
||||
*CloseUI: *PageRegion
|
||||
|
||||
*OpenUI *SendFF: Boolean
|
||||
*DefaultSendFF: False
|
||||
*SendFF True/True: ""
|
||||
*SendFF False/False: ""
|
||||
*CloseUI: *SendFF
|
||||
59
plans.fmf
Normal file
59
plans.fmf
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
/tier1-internal:
|
||||
plan:
|
||||
import:
|
||||
url: https://gitlab.com/redhat/centos-stream/tests/cups-filters.git
|
||||
name: /plans/tier1/internal
|
||||
|
||||
/tier1-public:
|
||||
plan:
|
||||
import:
|
||||
url: https://gitlab.com/redhat/centos-stream/tests/cups-filters.git
|
||||
name: /plans/tier1/public
|
||||
|
||||
/tier2-tier3-internal:
|
||||
plan:
|
||||
import:
|
||||
url: https://gitlab.com/redhat/centos-stream/tests/cups-filters.git
|
||||
name: /plans/tier2-tier3/internal
|
||||
|
||||
/tier2-tier3-public:
|
||||
plan:
|
||||
import:
|
||||
url: https://gitlab.com/redhat/centos-stream/tests/cups-filters.git
|
||||
name: /plans/tier2-tier3/public
|
||||
|
||||
/others-internal:
|
||||
plan:
|
||||
import:
|
||||
url: https://gitlab.com/redhat/centos-stream/tests/cups-filters.git
|
||||
name: /plans/others/internal
|
||||
|
||||
/others-public:
|
||||
plan:
|
||||
import:
|
||||
url: https://gitlab.com/redhat/centos-stream/tests/cups-filters.git
|
||||
name: /plans/others/public
|
||||
|
||||
/multihost:
|
||||
plan:
|
||||
import:
|
||||
url: https://gitlab.com/redhat/centos-stream/tests/cups-filters.git
|
||||
name: /plans/multihost/multihost
|
||||
|
||||
/fips-internal:
|
||||
plan:
|
||||
import:
|
||||
url: https://gitlab.com/redhat/centos-stream/tests/cups-filters.git
|
||||
name: /plans/others/fips
|
||||
|
||||
/cups-tier1-internal:
|
||||
plan:
|
||||
import:
|
||||
url: https://gitlab.com/redhat/centos-stream/tests/cups.git
|
||||
name: /plans/tier1/internal
|
||||
|
||||
/cups-tier1-public:
|
||||
plan:
|
||||
import:
|
||||
url: https://gitlab.com/redhat/centos-stream/tests/cups.git
|
||||
name: /plans/tier1/public
|
||||
|
|
@ -1,825 +0,0 @@
|
|||
=== modified file 'filter/pdf.cxx'
|
||||
--- filter/pdf.cxx 2017-08-15 18:32:47 +0000
|
||||
+++ filter/pdf.cxx 2017-09-07 16:02:01 +0000
|
||||
@@ -129,64 +129,125 @@
|
||||
Object array;
|
||||
Ref r;
|
||||
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ pageobj = xref->fetch(pageref->num, pageref->gen);
|
||||
+#else
|
||||
xref->fetch(pageref->num, pageref->gen, &pageobj);
|
||||
- if (!pageobj.isDict() || !pageobj.dictLookupNF("Contents", &contents)) {
|
||||
+#endif
|
||||
+ if (!pageobj.isDict() ||
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ (contents = pageobj.dictLookupNF("Contents")).isNull()
|
||||
+#else
|
||||
+ !pageobj.dictLookupNF("Contents", &contents)
|
||||
+#endif
|
||||
+ ) {
|
||||
fprintf(stderr, "Error: malformed pdf\n");
|
||||
return;
|
||||
}
|
||||
|
||||
- if (contents.isRef())
|
||||
+ if (contents.isRef()) {
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ contents = xref->fetch(contents.getRefNum(), contents.getRefGen());
|
||||
+#else
|
||||
xref->fetch(contents.getRefNum(), contents.getRefGen(), &contents);
|
||||
+#endif
|
||||
+ }
|
||||
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ (void) lenobj;
|
||||
+ dict = Object(new Dict(xref));
|
||||
+ dict.dictSet("Length", Object(static_cast<int>(len)));
|
||||
+ stream = Object(static_cast<Stream *>(new MemStream(buf, 0, len, std::move(dict))));
|
||||
+#else
|
||||
lenobj.initInt(len);
|
||||
dict.initDict(xref);
|
||||
dict.dictSet("Length", &lenobj);
|
||||
stream.initStream(new MemStream(buf, 0, len, &dict));
|
||||
+#endif
|
||||
|
||||
r = xref->addIndirectObject(&stream);
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ streamrefobj = Object(r.num, r.gen);
|
||||
+#else
|
||||
streamrefobj.initRef(r.num, r.gen);
|
||||
+#endif
|
||||
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ array = Object(new Array(xref));
|
||||
+ array.arrayAdd(std::move(streamrefobj));
|
||||
+#else
|
||||
array.initArray(xref);
|
||||
array.arrayAdd(&streamrefobj);
|
||||
+#endif
|
||||
|
||||
if (contents.isStream()) {
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ contents = pageobj.dictLookupNF("Contents"); // streams must be indirect, i.e. not fetch()-ed
|
||||
+ array.arrayAdd(std::move(contents));
|
||||
+#else
|
||||
pageobj.dictLookupNF("Contents", &contents); // streams must be indirect, i.e. not fetch()-ed
|
||||
array.arrayAdd(&contents);
|
||||
+#endif
|
||||
}
|
||||
else if (contents.isArray()) {
|
||||
int i, len = contents.arrayGetLength();
|
||||
Object obj;
|
||||
for (i = 0; i < len; i++) {
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ obj = contents.arrayGetNF(i);
|
||||
+ array.arrayAdd(std::move(obj));
|
||||
+#else
|
||||
contents.arrayGetNF(i, &obj);
|
||||
array.arrayAdd(&obj);
|
||||
+#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
fprintf(stderr, "Error: malformed pdf\n");
|
||||
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ pageobj.dictSet("Contents", std::move(array));
|
||||
+#else
|
||||
pageobj.dictSet("Contents", &array);
|
||||
+#endif
|
||||
|
||||
xref->setModifiedObject(&pageobj, *pageref);
|
||||
+#if POPPLER_VERSION_MAJOR <= 0 && POPPLER_VERSION_MINOR < 58
|
||||
pageobj.free();
|
||||
-}
|
||||
-
|
||||
-
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
+
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+static Object name_object(const char *s)
|
||||
+{
|
||||
+ return Object(new GooString(s));
|
||||
+}
|
||||
+#else
|
||||
static Object * name_object(const char *s)
|
||||
{
|
||||
Object *o = new Object();
|
||||
o->initName((char *)s);
|
||||
return o;
|
||||
}
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* Create new PDF integer type object.
|
||||
*/
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+static Object int_object(int i)
|
||||
+{
|
||||
+ return Object(i);
|
||||
+}
|
||||
+#else
|
||||
static Object * int_object(int i)
|
||||
{
|
||||
Object *o = new Object();
|
||||
o->initInt(i);
|
||||
return o;
|
||||
}
|
||||
+#endif
|
||||
|
||||
static Object * get_resource_dict(XRef *xref,
|
||||
Dict *pagedict,
|
||||
@@ -196,21 +257,36 @@
|
||||
Object res;
|
||||
|
||||
/* TODO resource dict can also be inherited */
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ res = pagedict->lookupNF("Resources");
|
||||
+ if (res.isNull())
|
||||
+#else
|
||||
if (!pagedict->lookupNF("Resources", &res))
|
||||
+#endif
|
||||
return NULL;
|
||||
|
||||
if (res.isRef()) {
|
||||
*resref = res.getRef();
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ *resdict = xref->fetch(resref->num, resref->gen);
|
||||
+#else
|
||||
xref->fetch(resref->num, resref->gen, resdict);
|
||||
+#endif
|
||||
}
|
||||
else if (res.isDict()) {
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ *resdict = res.copy();
|
||||
+#else
|
||||
res.copy(resdict);
|
||||
+#endif
|
||||
resref->num = 0;
|
||||
}
|
||||
else
|
||||
resdict = NULL;
|
||||
|
||||
+#if POPPLER_VERSION_MAJOR <= 0 && POPPLER_VERSION_MINOR < 58
|
||||
res.free();
|
||||
+#endif
|
||||
return resdict;
|
||||
}
|
||||
|
||||
@@ -226,7 +302,11 @@
|
||||
Object resdict;
|
||||
Ref resref;
|
||||
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ pageobj = xref->fetch(pageref->num, pageref->gen);
|
||||
+#else
|
||||
xref->fetch(pageref->num, pageref->gen, &pageobj);
|
||||
+#endif
|
||||
if (!pageobj.isDict()) {
|
||||
fprintf(stderr, "Error: malformed pdf\n");
|
||||
return;
|
||||
@@ -234,21 +314,35 @@
|
||||
|
||||
if (!get_resource_dict(xref, pageobj.getDict(), &resdict, &resref)) {
|
||||
fprintf(stderr, "Error: malformed pdf\n");
|
||||
+#if POPPLER_VERSION_MAJOR <= 0 && POPPLER_VERSION_MINOR < 58
|
||||
pageobj.free();
|
||||
+#endif
|
||||
return;
|
||||
}
|
||||
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ font = Object(new Dict(xref));
|
||||
+#else
|
||||
font.initDict(xref);
|
||||
+#endif
|
||||
font.dictSet("Type", name_object("Font"));
|
||||
font.dictSet("Subtype", name_object("Type1"));
|
||||
font.dictSet("BaseFont", name_object(name));
|
||||
xref->addIndirectObject(&font);
|
||||
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ fonts = resdict.dictLookupNF("Font");
|
||||
+#else
|
||||
resdict.dictLookupNF("Font", &fonts);
|
||||
+#endif
|
||||
if (fonts.isNull()) {
|
||||
/* Create new font dic obj in page's resources */
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ resdict.dictSet("Font", Object(new Dict(xref)));
|
||||
+#else
|
||||
fonts.initDict(xref);
|
||||
resdict.dictSet("Font", &fonts);
|
||||
+#endif
|
||||
}
|
||||
|
||||
Object *fonts_dic;
|
||||
@@ -259,7 +353,11 @@
|
||||
fonts_dic = &fonts;
|
||||
} else if ( fonts.isRef() ) {
|
||||
/* "Font" resource is indirect reference object */
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ dereferenced_obj = xref->fetch(fonts.getRefNum(), fonts.getRefGen());
|
||||
+#else
|
||||
xref->fetch(fonts.getRefNum(), fonts.getRefGen(), &dereferenced_obj);
|
||||
+#endif
|
||||
fonts_dic = &dereferenced_obj;
|
||||
}
|
||||
|
||||
@@ -269,7 +367,11 @@
|
||||
}
|
||||
|
||||
/* Add new entry to "Font" resource */
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ fonts_dic->dictSet("bannertopdf-font", std::move(font));
|
||||
+#else
|
||||
fonts_dic->dictSet("bannertopdf-font", &font);
|
||||
+#endif
|
||||
|
||||
/* Notify poppler about changes */
|
||||
if ( fonts.isRef() ) {
|
||||
@@ -281,7 +383,9 @@
|
||||
else
|
||||
xref->setModifiedObject(&resdict, resref);
|
||||
|
||||
+#if POPPLER_VERSION_MAJOR <= 0 && POPPLER_VERSION_MINOR < 58
|
||||
pageobj.free();
|
||||
+#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -293,23 +397,38 @@
|
||||
Array *array;
|
||||
int i;
|
||||
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ o = dict->dictLookup(key);
|
||||
+ if (o.isNull())
|
||||
+#else
|
||||
if (!dict->dictLookup(key, &o))
|
||||
+#endif
|
||||
return false;
|
||||
|
||||
if (!o.isArray()) {
|
||||
+#if POPPLER_VERSION_MAJOR <= 0 && POPPLER_VERSION_MINOR < 58
|
||||
o.free();
|
||||
+#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
array = o.getArray();
|
||||
for (i = 0; i < 4; i++) {
|
||||
Object el;
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ el = array->get(i);
|
||||
+ if (el.isNum())
|
||||
+ rect[i] = el.getNum();
|
||||
+#else
|
||||
if (array->get(i, &el) && el.isNum())
|
||||
rect[i] = el.getNum();
|
||||
el.free();
|
||||
+#endif
|
||||
}
|
||||
|
||||
+#if POPPLER_VERSION_MAJOR <= 0 && POPPLER_VERSION_MINOR < 58
|
||||
o.free();
|
||||
+#endif
|
||||
return i == 4;
|
||||
}
|
||||
|
||||
@@ -322,6 +441,15 @@
|
||||
Object array;
|
||||
int i;
|
||||
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ array = Object(new Array(xref));
|
||||
+
|
||||
+ for (i = 0; i < 4; i++) {
|
||||
+ array.arrayAdd(Object(static_cast<double>(rect[i])));
|
||||
+ }
|
||||
+
|
||||
+ dict->dictSet(key, std::move(array));
|
||||
+#else
|
||||
array.initArray(xref);
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
@@ -331,6 +459,7 @@
|
||||
}
|
||||
|
||||
dict->dictSet(key, &array);
|
||||
+#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -361,7 +490,11 @@
|
||||
float mediabox[4] = { 0.0, 0.0, width, length };
|
||||
float old_mediabox[4];
|
||||
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ pageobj = xref->fetch(pageref->num, pageref->gen);
|
||||
+#else
|
||||
xref->fetch(pageref->num, pageref->gen, &pageobj);
|
||||
+#endif
|
||||
if (!pageobj.isDict()) {
|
||||
fprintf(stderr, "Error: malformed pdf\n");
|
||||
return;
|
||||
@@ -381,7 +514,9 @@
|
||||
dict_set_rect (xref, &pageobj, "BleedBox", mediabox);
|
||||
|
||||
xref->setModifiedObject(&pageobj, *pageref);
|
||||
+#if POPPLER_VERSION_MAJOR <= 0 && POPPLER_VERSION_MINOR < 58
|
||||
pageobj.free();
|
||||
+#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -394,21 +529,34 @@
|
||||
Object page, parentref, parent, kids, ref, countobj;
|
||||
int i;
|
||||
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ page = xref->fetch(pageref->num, pageref->gen);
|
||||
+#else
|
||||
xref->fetch(pageref->num, pageref->gen, &page);
|
||||
+#endif
|
||||
if (!page.isDict("Page")) {
|
||||
fprintf(stderr, "Error: malformed pdf (invalid Page object)\n");
|
||||
return;
|
||||
}
|
||||
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ parentref = page.dictLookupNF("Parent");
|
||||
+ parent = parentref.fetch(xref);
|
||||
+#else
|
||||
page.dictLookupNF("Parent", &parentref);
|
||||
parentref.fetch(xref, &parent);
|
||||
+#endif
|
||||
if (!parent.isDict("Pages")) {
|
||||
fprintf(stderr, "Error: malformed pdf (Page.Parent must point to a "
|
||||
"Pages object)\n");
|
||||
return;
|
||||
}
|
||||
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ kids = parent.dictLookup("Kids");
|
||||
+#else
|
||||
parent.dictLookup("Kids", &kids);
|
||||
+#endif
|
||||
if (!kids.isArray()) {
|
||||
fprintf(stderr, "Error: malformed pdf (Pages.Kids must be an array)\n");
|
||||
return;
|
||||
@@ -420,14 +568,22 @@
|
||||
// the pages tree (not supported by major pdf implementations).
|
||||
for (i = 1; i < count; i++) {
|
||||
Ref r = xref->addIndirectObject(&page);
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ kids.arrayAdd(Object(r.num, r.gen));
|
||||
+#else
|
||||
ref.initRef(r.num, r.gen);
|
||||
kids.arrayAdd(&ref);
|
||||
ref.free();
|
||||
+#endif
|
||||
}
|
||||
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ parent.dictSet("Count", Object(count));
|
||||
+#else
|
||||
countobj.initInt(count);
|
||||
parent.dictSet("Count", &countobj);
|
||||
countobj.free();
|
||||
+#endif
|
||||
|
||||
xref->setModifiedObject(&parent, parentref.getRef());
|
||||
}
|
||||
@@ -523,7 +679,11 @@
|
||||
}
|
||||
Object pageobj;
|
||||
Ref pageref = page->getRef();
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ pageobj = xref->fetch(pageref.num, pageref.gen);
|
||||
+#else
|
||||
xref->fetch(pageref.num, pageref.gen, &pageobj);
|
||||
+#endif
|
||||
|
||||
const char *font_size = lookup_opt(opt, "banner-font-size");
|
||||
if ( ! font_size ) {
|
||||
@@ -614,8 +774,12 @@
|
||||
|
||||
/* Modify field's appearance */
|
||||
Object appearance_obj;
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ field_obj->getDict()->set("DA", Object(appearance));
|
||||
+#else
|
||||
appearance_obj.initString(appearance);
|
||||
field_obj->getDict()->set("DA", &appearance_obj);
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* Create /AP - entry stuff.
|
||||
@@ -653,7 +817,11 @@
|
||||
appearance_stream->append("EMC\n");
|
||||
|
||||
Object appearance_stream_dic;
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ appearance_stream_dic = Object(new Dict(xref));
|
||||
+#else
|
||||
appearance_stream_dic.initDict(xref);
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* Appearance stream dic.
|
||||
@@ -663,12 +831,46 @@
|
||||
appearance_stream_dic.dictSet("Type", name_object("XObject"));
|
||||
appearance_stream_dic.dictSet("Subtype", name_object("Form"));
|
||||
appearance_stream_dic.dictSet("FormType", int_object(1));
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ appearance_stream_dic.dictSet("Resources", Object(resref.num, resref.gen));
|
||||
+#else
|
||||
Object obj_ref_x;
|
||||
obj_ref_x.initRef(resref.num, resref.gen);
|
||||
appearance_stream_dic.dictSet("Resources", &obj_ref_x);
|
||||
+#endif
|
||||
|
||||
/* BBox array: TODO. currently out of the head. */
|
||||
Object array;
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ array = Object(new Array(xref));
|
||||
+ array.arrayAdd(Object(0.0));
|
||||
+ array.arrayAdd(Object(0.0));
|
||||
+ array.arrayAdd(Object(237.0));
|
||||
+ array.arrayAdd(Object(25.0));
|
||||
+
|
||||
+ appearance_stream_dic.dictSet("BBox", std::move(array));
|
||||
+ appearance_stream_dic.dictSet("Length", Object(appearance_stream->getLength()));
|
||||
+
|
||||
+ MemStream *mem_stream = new MemStream(appearance_stream->getCString(),
|
||||
+ 0, appearance_stream->getLength(), std::move(appearance_stream_dic));
|
||||
+
|
||||
+ /* Make obj stream */
|
||||
+ Object stream = Object(static_cast<Stream *>(mem_stream));
|
||||
+
|
||||
+ Ref r = xref->addIndirectObject(&stream);
|
||||
+
|
||||
+ /* Update Xref table */
|
||||
+ Object obj_ref = Object(r.num, r.gen);
|
||||
+
|
||||
+ /*
|
||||
+ * Fill Annotation's appearance streams dic /AP
|
||||
+ * See: 8.4.4 Appearance Streams
|
||||
+ */
|
||||
+ Object appearance_streams_dic = Object(new Dict(xref));
|
||||
+ appearance_streams_dic.dictSet("N", std::move(obj_ref));
|
||||
+
|
||||
+ field_obj->getDict()->set("AP", std::move(appearance_streams_dic));
|
||||
+#else
|
||||
array.initArray(xref);
|
||||
Object el;
|
||||
el.initReal(0);
|
||||
@@ -705,6 +907,7 @@
|
||||
appearance_streams_dic.dictSet("N", &obj_ref);
|
||||
|
||||
field_obj->getDict()->set("AP", &appearance_streams_dic);
|
||||
+#endif
|
||||
|
||||
/* Notify poppler about changes */
|
||||
xref->setModifiedObject(field_obj, field_ref);
|
||||
@@ -721,24 +924,38 @@
|
||||
* OpenOffice - by default sets it to 'true'.
|
||||
*/
|
||||
Object *obj_form = catalog->getAcroForm();
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ obj_form->dictSet("NeedAppearances", Object(gFalse));
|
||||
+#else
|
||||
Object obj1;
|
||||
obj1.initBool(gFalse);
|
||||
obj_form->dictSet("NeedAppearances", &obj1);
|
||||
+#endif
|
||||
+
|
||||
/* Add AccroForm as indirect obj */
|
||||
Ref ref_form = xref->addIndirectObject(obj_form);
|
||||
|
||||
/*
|
||||
* So update Catalog object.
|
||||
*/
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ Object catObj = xref->getCatalog();
|
||||
+#else
|
||||
Object* catObj = new Object();
|
||||
catObj = xref->getCatalog(catObj);
|
||||
+#endif
|
||||
Ref catRef;
|
||||
catRef.gen = xref->getRootGen();
|
||||
catRef.num = xref->getRootNum();
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ catObj.dictSet("AcroForm", Object(ref_form.num, ref_form.gen));
|
||||
+ xref->setModifiedObject(&catObj, catRef);
|
||||
+#else
|
||||
Object obj2;
|
||||
obj2.initRef(ref_form.num, ref_form.gen);
|
||||
catObj->dictSet("AcroForm", &obj2);
|
||||
xref->setModifiedObject(catObj, catRef);
|
||||
+#endif
|
||||
|
||||
/* Success */
|
||||
return 1;
|
||||
@@ -780,7 +997,11 @@
|
||||
|
||||
/* Font dictionary object for embeded font */
|
||||
Object f_dic;
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ f_dic = Object(new Dict(xref));
|
||||
+#else
|
||||
f_dic.initDict(xref);
|
||||
+#endif
|
||||
f_dic.dictSet("Type", name_object("Font"));
|
||||
|
||||
/* Stream lenght */
|
||||
@@ -798,12 +1019,18 @@
|
||||
}
|
||||
|
||||
/* Create memory stream font. Add it to font dic. */
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ MemStream *mem_stream = new MemStream(font_stream->getCString(),
|
||||
+ 0, outlen, std::move(f_dic));
|
||||
+ Object stream = Object(static_cast<Stream *>(mem_stream));
|
||||
+#else
|
||||
MemStream *mem_stream = new MemStream(font_stream->getCString(),
|
||||
0, outlen, &f_dic);
|
||||
|
||||
/* Make obj stream */
|
||||
Object stream;
|
||||
stream.initStream(mem_stream);
|
||||
+#endif
|
||||
|
||||
Ref r;
|
||||
|
||||
@@ -813,7 +1040,11 @@
|
||||
/* Get page object */
|
||||
Object pageobj;
|
||||
Ref pageref = page->getRef();
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ pageobj = xref->fetch(pageref.num, pageref.gen);
|
||||
+#else
|
||||
xref->fetch(pageref.num, pageref.gen, &pageobj);
|
||||
+#endif
|
||||
if (!pageobj.isDict()) {
|
||||
fprintf(stderr, "Error: malformed pdf.\n");
|
||||
return 0;
|
||||
@@ -825,18 +1056,29 @@
|
||||
Object *ret = get_resource_dict(xref, pageobj.getDict(), &resdict, &resref);
|
||||
if ( !ret ) {
|
||||
fprintf(stderr, "Error: malformed pdf\n");
|
||||
+#if POPPLER_VERSION_MAJOR <= 0 && POPPLER_VERSION_MINOR < 58
|
||||
pageobj.free();
|
||||
+#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Dictionary for all fonts in page's resources */
|
||||
Object fonts;
|
||||
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ fonts = resdict.dictLookupNF("Font");
|
||||
+#else
|
||||
resdict.dictLookupNF("Font", &fonts);
|
||||
+#endif
|
||||
if (fonts.isNull()) {
|
||||
/* Create new one, if doesn't exists */
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ resdict.dictSet("Font", Object(new Dict(xref)));
|
||||
+ fonts = resdict.dictLookupNF("Font");
|
||||
+#else
|
||||
fonts.initDict(xref);
|
||||
resdict.dictSet("Font", &fonts);
|
||||
+#endif
|
||||
fprintf(stderr, "Create new font dict in page's resources.\n");
|
||||
}
|
||||
|
||||
@@ -866,7 +1108,11 @@
|
||||
|
||||
/* r - cid resource dic */
|
||||
Object font_res_obj_ref;
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ font_res_obj_ref = Object(r.num, r.gen);
|
||||
+#else
|
||||
font_res_obj_ref.initRef(r.num, r.gen);
|
||||
+#endif
|
||||
|
||||
Object *fonts_dic;
|
||||
Object dereferenced_obj;
|
||||
@@ -876,7 +1122,11 @@
|
||||
fonts_dic = &fonts;
|
||||
} else if ( fonts.isRef() ) {
|
||||
/* "Font" resource is indirect reference object */
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ dereferenced_obj = xref->fetch(fonts.getRefNum(), fonts.getRefGen());
|
||||
+#else
|
||||
xref->fetch(fonts.getRefNum(), fonts.getRefGen(), &dereferenced_obj);
|
||||
+#endif
|
||||
fonts_dic = &dereferenced_obj;
|
||||
}
|
||||
|
||||
@@ -886,7 +1136,11 @@
|
||||
}
|
||||
|
||||
/* Add to fonts dic new font */
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ fonts_dic->dictSet("stanv_font", std::move(font_res_obj_ref));
|
||||
+#else
|
||||
fonts_dic->dictSet("stanv_font", &font_res_obj_ref);
|
||||
+#endif
|
||||
|
||||
/* Notify poppler about changes in fonts dic */
|
||||
if ( fonts.isRef() ) {
|
||||
@@ -897,7 +1151,9 @@
|
||||
xref->setModifiedObject(&resdict, resref);
|
||||
fprintf(stderr, "Resource dict was changed.\n");
|
||||
|
||||
+#if POPPLER_VERSION_MAJOR <= 0 && POPPLER_VERSION_MINOR < 58
|
||||
pageobj.free();
|
||||
+#endif
|
||||
|
||||
/* Success */
|
||||
return 1;
|
||||
@@ -1104,8 +1360,12 @@
|
||||
XRef *xref = doc->getXRef();
|
||||
|
||||
/* Font dictionary for embeded font */
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ Object *dic = new Object(new Dict(xref));
|
||||
+#else
|
||||
Object *dic = new Object();
|
||||
dic->initDict(xref);
|
||||
+#endif
|
||||
|
||||
dic->dictSet("Type", name_object("FontDescriptor"));
|
||||
dic->dictSet(
|
||||
@@ -1119,6 +1379,15 @@
|
||||
dic->dictSet("StemV", int_object(fdes->stemV));
|
||||
|
||||
/* FontBox array */
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ Object array = Object(new Array(xref));
|
||||
+ array.arrayAdd(Object(static_cast<double>(fdes->bbxmin)));
|
||||
+ array.arrayAdd(Object(static_cast<double>(fdes->bbymin)));
|
||||
+ array.arrayAdd(Object(static_cast<double>(fdes->bbxmax)));
|
||||
+ array.arrayAdd(Object(static_cast<double>(fdes->bbymax)));
|
||||
+
|
||||
+ dic->dictSet("FontBBox", std::move(array));
|
||||
+#else
|
||||
Object array;
|
||||
array.initArray(xref);
|
||||
|
||||
@@ -1137,6 +1406,7 @@
|
||||
array.arrayAdd(&el);
|
||||
|
||||
dic->dictSet("FontBBox", &array);
|
||||
+#endif
|
||||
|
||||
if (fdes->xHeight) {
|
||||
dic->dictSet("XHeight", int_object(fdes->xHeight));
|
||||
@@ -1149,20 +1419,34 @@
|
||||
if (fdes->panose) {
|
||||
/* Font dictionary for embeded font */
|
||||
Object style_dic;
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ style_dic = Object(new Dict(xref));
|
||||
+#else
|
||||
style_dic.initDict(xref);
|
||||
-
|
||||
+#endif
|
||||
+
|
||||
+ GooString *panose_str = new GooString(fdes->panose, 12);
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ style_dic.dictSet("Panose", Object(panose_str));
|
||||
+
|
||||
+ dic->dictSet("Style", std::move(style_dic));
|
||||
+#else
|
||||
Object panose;
|
||||
|
||||
- GooString *panose_str = new GooString(fdes->panose, 12);
|
||||
panose.initString(panose_str);
|
||||
style_dic.dictSet("Panose", &panose);
|
||||
|
||||
dic->dictSet("Style", &style_dic);
|
||||
+#endif
|
||||
}
|
||||
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ dic->dictSet(emb_pdf_get_fontfile_key(emb), Object(fontfile_obj_ref.num, fontfile_obj_ref.gen));
|
||||
+#else
|
||||
Object ref_obj;
|
||||
ref_obj.initRef(fontfile_obj_ref.num, fontfile_obj_ref.gen);
|
||||
dic->dictSet(emb_pdf_get_fontfile_key(emb), &ref_obj);
|
||||
+#endif
|
||||
|
||||
return dic;
|
||||
}
|
||||
@@ -1181,8 +1465,12 @@
|
||||
/* Get XREF table */
|
||||
XRef *xref = doc->getXRef();
|
||||
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ Object *dic = new Object(new Dict(xref));
|
||||
+#else
|
||||
Object *dic = new Object();
|
||||
dic->initDict(xref);
|
||||
+#endif
|
||||
|
||||
dic->dictSet("Type", name_object("Font"));
|
||||
dic->dictSet(
|
||||
@@ -1192,15 +1480,23 @@
|
||||
"BaseFont",
|
||||
name_object(copyString(emb_pdf_escape_name(fdes->fontname,-1))));
|
||||
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ dic->dictSet("FontDescriptor", Object(fontdescriptor_obj_ref.num, fontdescriptor_obj_ref.gen));
|
||||
+#else
|
||||
Object ref_obj;
|
||||
ref_obj.initRef(fontdescriptor_obj_ref.num, fontdescriptor_obj_ref.gen);
|
||||
dic->dictSet("FontDescriptor", &ref_obj);
|
||||
+#endif
|
||||
|
||||
if ( emb->plan & EMB_A_MULTIBYTE ) {
|
||||
assert(fwid->warray);
|
||||
|
||||
Object CIDSystemInfo_dic;
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ CIDSystemInfo_dic = Object(new Dict(xref));
|
||||
+#else
|
||||
CIDSystemInfo_dic.initDict(xref);
|
||||
+#endif
|
||||
|
||||
Object registry;
|
||||
Object ordering;
|
||||
@@ -1208,16 +1504,28 @@
|
||||
GooString *str;
|
||||
|
||||
str = new GooString(copyString(fdes->registry));
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ CIDSystemInfo_dic.dictSet("Registry", Object(str));
|
||||
+#else
|
||||
registry.initString(str);
|
||||
CIDSystemInfo_dic.dictSet("Registry", ®istry);
|
||||
+#endif
|
||||
|
||||
str = new GooString(copyString(fdes->ordering));
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ CIDSystemInfo_dic.dictSet("Ordering", Object(str));
|
||||
+#else
|
||||
ordering.initString(str);
|
||||
CIDSystemInfo_dic.dictSet("Ordering", &ordering);
|
||||
+#endif
|
||||
|
||||
CIDSystemInfo_dic.dictSet("Supplement", int_object(fdes->supplement));
|
||||
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ dic->dictSet("CIDSystemInfo", std::move(CIDSystemInfo_dic));
|
||||
+#else
|
||||
dic->dictSet("CIDSystemInfo", &CIDSystemInfo_dic);
|
||||
+#endif
|
||||
|
||||
dic->dictSet("DW", int_object(fwid->default_width));
|
||||
}
|
||||
@@ -1249,8 +1557,12 @@
|
||||
/* Get XREF table */
|
||||
XRef *xref = doc->getXRef();
|
||||
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ Object *dic = new Object(new Dict(xref));
|
||||
+#else
|
||||
Object *dic = new Object();
|
||||
dic->initDict(xref);
|
||||
+#endif
|
||||
|
||||
dic->dictSet("Type", name_object("Font"));
|
||||
dic->dictSet("Subtype", name_object("Type0"));
|
||||
@@ -1267,13 +1579,24 @@
|
||||
dic->dictSet("Encoding", name_object(copyString(encoding)));
|
||||
|
||||
Object obj;
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ obj = Object(fontdescriptor_obj_ref.num, fontdescriptor_obj_ref.gen);
|
||||
+#else
|
||||
obj.initRef(fontdescriptor_obj_ref.num, fontdescriptor_obj_ref.gen);
|
||||
+#endif
|
||||
|
||||
Object array;
|
||||
+#if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 58
|
||||
+ array = Object(new Array(xref));
|
||||
+ array.arrayAdd(std::move(obj));
|
||||
+
|
||||
+ dic->dictSet("DescendantFonts", std::move(array));
|
||||
+#else
|
||||
array.initArray(xref);
|
||||
array.arrayAdd(&obj);
|
||||
|
||||
dic->dictSet("DescendantFonts", &array);
|
||||
+#endif
|
||||
|
||||
return dic;
|
||||
}
|
||||
|
||||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
SHA512 (cups-filters-1.20.0.tar.xz) = b71722cc14f81cf8cbed5b8e980c9689adc2daf6cfa72e4174b6842bd89574090831f0e986b5e32a0e9fc4e29836f04e74e72c48918d7f3a8f65faa3a6c077af
|
||||
SHA512 (cups-filters-2.0.1.tar.gz) = b5d7b8f5a89a6a6bba0e861dd3c3263195be75996d22129d123f325f6bff74fbabf22f2ee2d953908ffb8294d825af5568af6695896c76ef4082ae98cd19c42c
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue