From 670e73ad828c62c13cd9a1438c96d428c24a6c9b Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Wed, 15 Sep 2021 11:24:55 +0200 Subject: [PATCH] 1.28.10 --- .gitignore | 1 + ...ake-NotifLeaseDuration-configurable-.patch | 128 ------------------ ...ix-page-range-like-10-in-pdftopdf-fi.patch | 26 ---- cups-filters.spec | 12 +- sources | 2 +- 5 files changed, 7 insertions(+), 162 deletions(-) delete mode 100644 0001-cups-browsed.c-Make-NotifLeaseDuration-configurable-.patch delete mode 100644 0001-libcupsfilters-Fix-page-range-like-10-in-pdftopdf-fi.patch diff --git a/.gitignore b/.gitignore index 2fc311c..1b3cbe6 100644 --- a/.gitignore +++ b/.gitignore @@ -105,3 +105,4 @@ /cups-filters-1.28.7.tar.xz /cups-filters-1.28.8.tar.xz /cups-filters-1.28.9.tar.xz +/cups-filters-1.28.10.tar.xz diff --git a/0001-cups-browsed.c-Make-NotifLeaseDuration-configurable-.patch b/0001-cups-browsed.c-Make-NotifLeaseDuration-configurable-.patch deleted file mode 100644 index df62d0c..0000000 --- a/0001-cups-browsed.c-Make-NotifLeaseDuration-configurable-.patch +++ /dev/null @@ -1,128 +0,0 @@ -From d90a4fc57b00b4a1f6c196bcb96025251b555dd9 Mon Sep 17 00:00:00 2001 -From: zdohnal -Date: Fri, 18 Jun 2021 12:27:53 +0200 -Subject: [PATCH] cups-browsed.c: Make NotifLeaseDuration configurable and - renew after half the lease duration not 60 sec before end - -1) NotifLeaseDuration directive for cups-browsed.conf - it will make - lease duration for notifications configurable by users. IMO it is not - useful for regular users, but it is helpful during sanity testing - (for verifying that we actually renew the subscription when time - comes). The current hardcoded 1 day is unusuable for that :( . - I implemented the lowest threshold to 300s to prevent a possible DoS. -2) Subscription renewal is set to happen in the middle of NotifLeaseDuration, - not one minute before lease expiration. This was a problem on busy servers, - where cups-browsed was busy and wasn't able to renew the subscription - before cupsd removed it. Then if some jobs had come before the subscription - was created again, the queue got disabled. The proposed approach is based - on behavior of DHCP. ---- - utils/cups-browsed.c | 17 +++++++++++++---- - utils/cups-browsed.conf.5 | 11 +++++++++++ - utils/cups-browsed.conf.in | 8 ++++++++ - 3 files changed, 32 insertions(+), 4 deletions(-) - -diff --git a/utils/cups-browsed.c b/utils/cups-browsed.c -index 61d6c551..2d367c59 100644 ---- a/utils/cups-browsed.c -+++ b/utils/cups-browsed.c -@@ -142,7 +142,6 @@ static int ldap_rebind_proc(LDAP *RebindLDAPHandle, - #define TIMEOUT_REMOVE -1 - #define TIMEOUT_CHECK_LIST 2 - --#define NOTIFY_LEASE_DURATION (24 * 60 * 60) - #define CUPS_DBUS_NAME "org.cups.cupsd.Notifier" - #define CUPS_DBUS_PATH "/org/cups/cupsd/Notifier" - #define CUPS_DBUS_INTERFACE "org.cups.cupsd.Notifier" -@@ -508,6 +507,7 @@ static int autoshutdown_timeout = 30; - static autoshutdown_inactivity_type_t autoshutdown_on = NO_QUEUES; - static guint autoshutdown_exec_id = 0; - static const char *default_printer = NULL; -+static unsigned int notify_lease_duration = 86400; - - static int debug_stderr = 0; - static int debug_logfile = 0; -@@ -5017,7 +5017,7 @@ create_subscription () - ippAddString (req, IPP_TAG_SUBSCRIPTION, IPP_TAG_URI, - "notify-recipient-uri", NULL, "dbus://"); - ippAddInteger (req, IPP_TAG_SUBSCRIPTION, IPP_TAG_INTEGER, -- "notify-lease-duration", NOTIFY_LEASE_DURATION); -+ "notify-lease-duration", notify_lease_duration); - - resp = cupsDoRequest (conn, req, "/"); - if (!resp || cupsLastError() != IPP_STATUS_OK) { -@@ -5060,7 +5060,7 @@ renew_subscription (int id) - ippAddString (req, IPP_TAG_SUBSCRIPTION, IPP_TAG_URI, - "notify-recipient-uri", NULL, "dbus://"); - ippAddInteger (req, IPP_TAG_SUBSCRIPTION, IPP_TAG_INTEGER, -- "notify-lease-duration", NOTIFY_LEASE_DURATION); -+ "notify-lease-duration", notify_lease_duration); - - resp = cupsDoRequest (conn, req, "/"); - if (!resp || cupsLastError() != IPP_STATUS_OK) { -@@ -11857,6 +11857,15 @@ read_configuration (const char *filename) - } else - debug_printf("Invalid %s value: %d\n", - line, t); -+ } else if (!strcasecmp(line, "NotifLeaseDuration") && value) { -+ int t = atoi(value); -+ if (t >= 300) { -+ notify_lease_duration = t; -+ debug_printf("Set %s to %d sec.\n", -+ line, t); -+ } else -+ debug_printf("Invalid %s value: %d\n", -+ line, t); - } else if (!strcasecmp(line, "HttpMaxRetries") && value) { - int t = atoi(value); - if (t > 0) { -@@ -12728,7 +12737,7 @@ int main(int argc, char*argv[]) { - /* Subscribe to CUPS' D-Bus notifications and create a proxy to receive - the notifications */ - subscription_id = create_subscription (); -- g_timeout_add_seconds (NOTIFY_LEASE_DURATION - 60, -+ g_timeout_add_seconds (notify_lease_duration / 2, - renew_subscription_timeout, - &subscription_id); - cups_notifier = cups_notifier_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, -diff --git a/utils/cups-browsed.conf.5 b/utils/cups-browsed.conf.5 -index c47f8e8d..263f0843 100644 ---- a/utils/cups-browsed.conf.5 -+++ b/utils/cups-browsed.conf.5 -@@ -966,6 +966,17 @@ shutdown. - - .fam T - .fi -+NotifLeaseDuration defines how long the D-BUS subscription created by cups-browsed -+in cupsd will last before cupsd cancels it. The default value is 1 day -+in seconds - 86400. The subscription renewal is set to happen after half of -+NotifLeaseDuration passed. The D-BUS notifications are used for watching over queues -+and doing specific actions when a D-BUS notification comes. -+.PP -+.nf -+.fam C -+ NotifLeaseDuration 86400 -+.fam T -+.fi - .SH SEE ALSO - - \fBcups-browsed\fP(8) -diff --git a/utils/cups-browsed.conf.in b/utils/cups-browsed.conf.in -index 3cc4ebb1..ffdf83d6 100644 ---- a/utils/cups-browsed.conf.in -+++ b/utils/cups-browsed.conf.in -@@ -741,3 +741,11 @@ BrowseRemoteProtocols @BROWSEREMOTEPROTOCOLS@ - # on the size of the file. - - # DebugLogFileSize 300 -+ -+# NotifLeaseDuration defines how long the D-BUS subscription created by cups-browsed -+# in cupsd will last before cupsd cancels it. The default value is 1 day -+# in seconds - 86400. The subscription renewal is set to happen after half of -+# NotifLeaseDuration passed. The D-BUS notifications are used for watching over queues -+# and doing specific actions when a D-BUS notification comes. -+ -+# NotifLeaseDuration 86400 --- -2.31.1 - diff --git a/0001-libcupsfilters-Fix-page-range-like-10-in-pdftopdf-fi.patch b/0001-libcupsfilters-Fix-page-range-like-10-in-pdftopdf-fi.patch deleted file mode 100644 index 1baab50..0000000 --- a/0001-libcupsfilters-Fix-page-range-like-10-in-pdftopdf-fi.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 022c34fedb66f706b2ab82d7506d5b5b1fa18e1f Mon Sep 17 00:00:00 2001 -From: Bryan Mason -Date: Fri, 16 Jul 2021 11:19:42 -0700 -Subject: [PATCH] libcupsfilter: Fix page range like "10-" in pdftopdf() - filter function - ---- - filter/pdftopdf/pdftopdf.cc | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/filter/pdftopdf/pdftopdf.cc b/filter/pdftopdf/pdftopdf.cc -index 5725e199..979644f1 100644 ---- a/filter/pdftopdf/pdftopdf.cc -+++ b/filter/pdftopdf/pdftopdf.cc -@@ -256,7 +256,7 @@ static void parseRanges(const char *range,IntervalSet &ret) // {{{ - } else { - upper=strtol(range,(char **)&range,10); - if (upper>=2147483647) { -- ret.add(1); -+ ret.add(lower); - } else { - ret.add(lower,upper+1); - } --- -2.31.1 - diff --git a/cups-filters.spec b/cups-filters.spec index fc7cf33..942ccb5 100644 --- a/cups-filters.spec +++ b/cups-filters.spec @@ -3,8 +3,8 @@ Summary: OpenPrinting CUPS filters and backends Name: cups-filters -Version: 1.28.9 -Release: 5%{?dist} +Version: 1.28.10 +Release: 1%{?dist} # For a breakdown of the licensing, see COPYING file # GPLv2: filters: commandto*, imagetoraster, pdftops, rasterto*, @@ -21,11 +21,6 @@ Url: http://www.linuxfoundation.org/collaborate/workgroups/openprinting/cups Source0: http://www.openprinting.org/download/cups-filters/cups-filters-%{version}.tar.xz # backported from upstream -# 1973056 - renew dbus notifications in the half of time -# upstream https://github.com/OpenPrinting/cups-filters/commit/d90a4fc57b00b4a1f6c196bcb96025251b555dd9 -Patch01: 0001-cups-browsed.c-Make-NotifLeaseDuration-configurable-.patch -# 1981603 - pdftopdf doesn't handle "page-range=10-2147483647" correctly -Patch02: 0001-libcupsfilters-Fix-page-range-like-10-in-pdftopdf-fi.patch # autogen.sh @@ -352,6 +347,9 @@ done %{_libdir}/pkgconfig/libfontembed.pc %changelog +* Tue Sep 14 2021 Zdenek Dohnal - 1.28.10-1 +- 1.28.10 + * Tue Jul 27 2021 Zdenek Dohnal - 1.28.9-5 - rebuilt with poppler-21.07.0 diff --git a/sources b/sources index b3b3063..b303a1b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (cups-filters-1.28.9.tar.xz) = fbdf01b0a3acd70e3bf036ca4944a8b85ab4ab95d945458e924692008a8a37bb0b1fb097c4d4b3cf6f5ad68ae06e8358659cdfc24974ee629be37b54f5c3dca1 +SHA512 (cups-filters-1.28.10.tar.xz) = d6079633e10c3cfdc744491df03adc73d98dab0d9c0c6d3bc426b751545ae3434ea875e0841cec9358c19336347903f2832b5f801700b371cc1959e031bfa659