From 47bca230580c90d70ea718ce132af3a1c0fbac7f Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Fri, 28 Aug 2020 08:40:06 +0200 Subject: [PATCH] 1.28.1 - added driverless fax support --- .gitignore | 1 + ...-configure-option-for-local-queues-n.patch | 90 ----- ...emove-mentions-of-README-and-AUTHORS.patch | 31 -- ...s-browsed.c-Fix-several-memory-leaks.patch | 311 ------------------ ...emoved-all-signal-handling-and-globa.patch | 165 ++++++++++ cups-filters-manual-copies.patch | 13 - cups-filters-remove-queues-on-restart.patch | 45 --- cups-filters.spec | 77 +++-- sources | 2 +- 9 files changed, 220 insertions(+), 515 deletions(-) delete mode 100644 0001-configure.ac-Add-configure-option-for-local-queues-n.patch delete mode 100644 0001-cups-browsed.8-Remove-mentions-of-README-and-AUTHORS.patch delete mode 100644 0001-cups-browsed.c-Fix-several-memory-leaks.patch create mode 100644 0001-libcupsfilters-Removed-all-signal-handling-and-globa.patch delete mode 100644 cups-filters-manual-copies.patch delete mode 100644 cups-filters-remove-queues-on-restart.patch diff --git a/.gitignore b/.gitignore index ea2a123..7fde2f5 100644 --- a/.gitignore +++ b/.gitignore @@ -98,3 +98,4 @@ /cups-filters-1.27.3.tar.xz /cups-filters-1.27.4.tar.xz /cups-filters-1.27.5.tar.xz +/cups-filters-1.28.1.tar.xz diff --git a/0001-configure.ac-Add-configure-option-for-local-queues-n.patch b/0001-configure.ac-Add-configure-option-for-local-queues-n.patch deleted file mode 100644 index 8d8a6d6..0000000 --- a/0001-configure.ac-Add-configure-option-for-local-queues-n.patch +++ /dev/null @@ -1,90 +0,0 @@ -From c2373316af1891f3a2d4af94052f12d2b4c88c49 Mon Sep 17 00:00:00 2001 -From: Zdenek Dohnal -Date: Fri, 21 Aug 2020 08:39:28 +0200 -Subject: [PATCH] configure.ac: Add configure option for local queues naming - for remote CUPS queues - ---- - configure.ac | 30 +++++++++++++++++++++++++++--- - utils/cups-browsed.c | 10 +++++++++- - 2 files changed, 36 insertions(+), 4 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 580b107d..20899740 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -850,6 +850,29 @@ PKG_CHECK_EXISTS([liblouis], [ - AM_CONDITIONAL(ENABLE_BRAILLE, test "x$enable_braille" = xyes) - AC_SUBST(TABLESDIR) - -+# ========================================= -+# Local queue naming for remote CUPS queues -+# ========================================= -+AC_ARG_WITH([remote-cups-local-queue-naming], -+ [AS_HELP_STRING([--with-remote-cups-local-queue-naming=DNS-SD|MakeModel|RemoteName], [Choose the origin of local queue naming for remote CUPS queues, default based on DNS-SD ID])], -+ [case "x$withval" in -+ "xMakeModel") -+ REMOTE_CUPS_LOCAL_QUEUE_NAMING="MakeModel" -+ AC_DEFINE([NAMING_MAKE_MODEL], [1], [Define that we create local queues for remote CUPS queues based on printer Make-Model]) -+ ;; -+ "xRemoteName") -+ REMOTE_CUPS_LOCAL_QUEUE_NAMING="RemoteName" -+ AC_DEFINE([NAMING_REMOTE_NAME], [1], [Define that we create local queues for remote CUPS queues based on their print queue name on the server]) -+ ;; -+ *) -+ REMOTE_CUPS_LOCAL_QUEUE_NAMING="DNS-SD" -+ AC_DEFINE([NAMING_DNSSD], [1], [Define that we create local queues for remote CUPS queues based on DNS-SD name]) -+ ;; -+ esac], -+ [REMOTE_CUPS_LOCAL_QUEUE_NAMING="DNS-SD" -+ AC_DEFINE([NAMING_DNSSD], [1], [Define that we create local queues for remote CUPS queues based on DNS-SD name])] -+) -+ - # ========================================================= - # Select a different shell instead of the default /bin/bash - # ========================================================= -@@ -919,9 +942,9 @@ AC_OUTPUT - AC_MSG_NOTICE([ - ============================================================================== - Environment settings: -- CFLAGS: ${CFLAGS} -- CXXFLAGS: ${CXXFLAGS} -- LDFLAGS: ${LDFLAGS} -+ CFLAGS: ${CFLAGS} -+ CXXFLAGS: ${CXXFLAGS} -+ LDFLAGS: ${LDFLAGS} - Build configuration: - cups-config: ${with_cups_config} - font directory: ${sysconfdir}/${FONTDIR} -@@ -955,6 +978,7 @@ Build configuration: - driverless: ${enable_driverless} - apple-raster: ${APPLE_RASTER_FILTER} - pclm: ${enable_pclm} -+ local queue naming for remote CUPS queues: ${REMOTE_CUPS_LOCAL_QUEUE_NAMING} - all ipp printer auto-setup: ${enable_auto_setup_all} - only driverless auto-setup: ${enable_auto_setup_driverless_only} - only local auto-setup: ${enable_auto_setup_local_only} -diff --git a/utils/cups-browsed.c b/utils/cups-browsed.c -index 9f0e7b92..64675e1c 100644 ---- a/utils/cups-browsed.c -+++ b/utils/cups-browsed.c -@@ -443,7 +443,15 @@ static unsigned int HttpRemoteTimeout = 10; - static unsigned int HttpMaxRetries = 5; - static unsigned int DNSSDBasedDeviceURIs = 1; - static ip_based_uris_t IPBasedDeviceURIs = IP_BASED_URIS_NO; --static local_queue_naming_t LocalQueueNamingRemoteCUPS=LOCAL_QUEUE_NAMING_DNSSD; -+#ifdef NAMING_MAKE_MODEL -+static local_queue_naming_t LocalQueueNamingRemoteCUPS = LOCAL_QUEUE_NAMING_MAKE_MODEL; -+#else -+# ifdef NAMING_REMOTE_NAME -+static local_queue_naming_t LocalQueueNamingRemoteCUPS = LOCAL_QUEUE_NAMING_REMOTE_NAME; -+# else -+static local_queue_naming_t LocalQueueNamingRemoteCUPS = LOCAL_QUEUE_NAMING_DNSSD; -+# endif -+#endif - static local_queue_naming_t LocalQueueNamingIPPPrinter=LOCAL_QUEUE_NAMING_DNSSD; - static unsigned int OnlyUnsupportedByCUPS = 0; - static unsigned int UseCUPSGeneratedPPDs = 0; --- -2.26.2 - diff --git a/0001-cups-browsed.8-Remove-mentions-of-README-and-AUTHORS.patch b/0001-cups-browsed.8-Remove-mentions-of-README-and-AUTHORS.patch deleted file mode 100644 index 868d60f..0000000 --- a/0001-cups-browsed.8-Remove-mentions-of-README-and-AUTHORS.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 6b650f45b21e306db482221223584497a710b54d Mon Sep 17 00:00:00 2001 -From: Zdenek Dohnal -Date: Mon, 15 Jun 2020 14:55:31 +0200 -Subject: [PATCH] cups-browsed.8: Remove mentions of README and AUTHORS files - ---- - utils/cups-browsed.8 | 8 ++------ - 1 file changed, 2 insertions(+), 6 deletions(-) - -diff --git a/utils/cups-browsed.8 b/utils/cups-browsed.8 -index cc8374ce..73c2f686 100644 ---- a/utils/cups-browsed.8 -+++ b/utils/cups-browsed.8 -@@ -96,12 +96,8 @@ that clients running cups 1.6.x plus \fBcups-browsed\fP can use the CUPS - broadcasts from servers with cups 1.5.x. As with browsing of Bonjour - broadcasts, the created local raw queues are available to applications - and command line tools. -+.PP -+This manual page was written for the Debian Project, but it may be used by others. - .SH SEE ALSO - - \fBcups-browsed.conf\fP(5) --.PP --/usr/share/doc/\fBcups-browsed\fP/README.gz --.SH AUTHOR --The authors of \fBcups-browsed\fP are listed in /usr/share/doc/\fBcups-browsed\fP/AUTHORS. --.PP --This manual page was written for the Debian Project, but it may be used by others. --- -2.26.2 - diff --git a/0001-cups-browsed.c-Fix-several-memory-leaks.patch b/0001-cups-browsed.c-Fix-several-memory-leaks.patch deleted file mode 100644 index 544631e..0000000 --- a/0001-cups-browsed.c-Fix-several-memory-leaks.patch +++ /dev/null @@ -1,311 +0,0 @@ -From ee288bfdf0b6f3778d3962087ae8d5fb1890215a Mon Sep 17 00:00:00 2001 -From: Zdenek Dohnal -Date: Tue, 18 Aug 2020 08:01:08 +0200 -Subject: [PATCH] cups-browsed.c: Fix several memory leaks - ---- - utils/cups-browsed.c | 126 ++++++++++++++++++++++++++++++++++++++----- - 1 file changed, 113 insertions(+), 13 deletions(-) - -diff --git a/utils/cups-browsed.c b/utils/cups-browsed.c -index c5eec9fd..885783ee 100644 ---- a/utils/cups-browsed.c -+++ b/utils/cups-browsed.c -@@ -1409,9 +1409,15 @@ void add_mimetype_attributes(char* cluster_name, ipp_t **merged_attributes) - ippAddStrings(*merged_attributes, IPP_TAG_PRINTER,IPP_TAG_MIMETYPE, - attributes[attr_no], num_value, NULL, - (const char * const *)values); -+ -+ for (int k = 0; k < i; k++) { -+ free(values[k]); -+ values[k] = NULL; -+ } - } -+ cupsArrayDelete(list); -+ list = NULL; - } -- cupsArrayDelete(list); - } - - /*add_tagzero_attributes - Adds attribute to the merged_attribute variable for -@@ -1476,9 +1482,15 @@ void add_tagzero_attributes(char* cluster_name, ipp_t **merged_attributes) - IPP_CONST_TAG(IPP_TAG_KEYWORD), - attributes[attr_no], num_value, NULL, - (const char * const *)values); -+ -+ for (int k = 0; k < i; k++) { -+ free(values[k]); -+ values[k] = NULL; -+ } - } -+ cupsArrayDelete(list); -+ list = NULL; - } -- cupsArrayDelete(list); - } - - /*add_keyword_attributes - Adds attributes to the merged_attribute variable for -@@ -1540,9 +1552,15 @@ void add_keyword_attributes(char* cluster_name, ipp_t **merged_attributes) - ippAddStrings(*merged_attributes, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, - attributes[attr_no], num_value, NULL, - (const char * const *)values); -+ -+ for (int k = 0; k < i; k++) { -+ free(values[k]); -+ values[k] = NULL; -+ } - } -+ cupsArrayDelete(list); -+ list = NULL; - } -- cupsArrayDelete(list); - } - - /*add_enum_attributes - Adds attributes to the merged_attribute variable for -@@ -1552,7 +1570,7 @@ void add_enum_attributes(char* cluster_name, ipp_t **merged_attributes) - { - int count, i, value; - remote_printer_t *p; -- char *str; -+ char *str = NULL; - char *q; - cups_array_t *list; - ipp_attribute_t *attr; -@@ -1600,8 +1618,14 @@ void add_enum_attributes(char* cluster_name, ipp_t **merged_attributes) - ippAddIntegers(*merged_attributes, IPP_TAG_PRINTER,IPP_TAG_ENUM, - attributes[attr_no], num_value,values); - } -+ -+ if (str != NULL) { -+ free(str); -+ str = NULL; -+ } -+ cupsArrayDelete(list); -+ list = NULL; - } -- cupsArrayDelete(list); - } - - /*add_margin_attribute - Adds margin attributes to the merged_attribute variable for the cluster.*/ -@@ -1657,8 +1681,14 @@ void add_margin_attributes(char* cluster_name, ipp_t **merged_attributes) - ippAddIntegers(*merged_attributes, IPP_TAG_PRINTER,IPP_TAG_INTEGER, - attributes[attr_no], num_value,values); - } -+ -+ if (str != NULL) { -+ free(str); -+ str = NULL; -+ } -+ cupsArrayDelete(list); -+ list = NULL; - } -- cupsArrayDelete(list); - } - - /*add_resolution_attributes - Adds resolution attributes to the merged_attribute -@@ -1710,8 +1740,9 @@ void add_resolution_attributes(char* cluster_name, ipp_t **merged_attributes) - attributes[attr_no], num_resolution, - IPP_RES_PER_INCH, xres, yres); - } -+ cupsArrayDelete(res_array); -+ res_array = NULL; - } -- cupsArrayDelete(res_array); - } - - /*add_mediasize_attribute - Adds media sizes to the merged_attribute for the -@@ -1810,7 +1841,11 @@ void add_mediasize_attributes(char* cluster_name, ipp_t **merged_attributes) - } - } - } -+ -+ free(temp); -+ free(temp_range); - cupsArrayDelete(sizes); -+ cupsArrayDelete(size_ranges); - } - - /*add_mediadatabase_attribute - Adds media-col-database attributes for the -@@ -1928,6 +1963,8 @@ add_mediadatabase_attributes(char* cluster_name, ipp_t **merged_attributes) - } - } - } -+ -+ free(temp); - cupsArrayDelete(media_database); - } - -@@ -1974,8 +2011,11 @@ void add_jobpresets_attribute(char* cluster_name, ipp_t ** merged_attributes) - } - } - -- if (num_preset == 0) -+ if (num_preset == 0) { -+ cupsArrayDelete(list); -+ cupsArrayDelete(added_presets); - return; -+ } - - preset_attribute = ippAddCollections(*merged_attributes, IPP_TAG_PRINTER, - "job-presets-supported", num_preset, -@@ -1998,6 +2038,9 @@ void add_jobpresets_attribute(char* cluster_name, ipp_t ** merged_attributes) - } - } - } -+ -+ cupsArrayDelete(list); -+ cupsArrayDelete(added_presets); - } - - /* get_pagesize: Function returns the standard/custom page size using -@@ -2029,6 +2072,8 @@ static cups_array_t* get_pagesize(ipp_t *printer_attributes) - cupsArrayAdd(page_media, ppdsizename); - } - free(ppdsizename); -+ cupsArrayDelete(sizes); -+ - return page_media; - } - -@@ -2669,8 +2714,14 @@ cups_array_t* get_cluster_sizes(char* cluster_name) - } - } - } -+ -+ cupsArrayDelete(sizes); -+ sizes = NULL; - } - } -+ -+ cupsArrayDelete(sizes_ppdname); -+ - return cluster_sizes; - } - -@@ -2718,6 +2769,9 @@ cups_array_t* generate_cluster_conflicts(char* cluster_name, - cupsArrayAdd(pagesizes, ppdsizename); - } - cluster_options[i] = pagesizes; -+ -+ cupsArrayDelete(sizes); -+ sizes = NULL; - } - } - -@@ -2774,10 +2828,21 @@ cups_array_t* generate_cluster_conflicts(char* cluster_name, - cupsArrayAdd(conflict_pairs, constraint); - } - } -+ -+ cupsArrayDelete(printer_second_options); -+ printer_second_options = NULL; - } - } -+ -+ cupsArrayDelete(printer_first_options); -+ printer_first_options = NULL; - } - } -+ -+ for(i = 0; i < no_of_ppd_keywords; i ++) { -+ cupsArrayDelete(cluster_options[i]); -+ } -+ - free(ppdsizename); - return conflict_pairs; - } -@@ -3010,6 +3075,8 @@ void get_cluster_default_attributes(ipp_t** merged_attributes, - temp->bottom_margin, - temp->media_source, temp->media_type); - ippSetCollection(*merged_attributes, &media_col_default, 0, current_media); -+ -+ free(temp); - } - - /*Finding the default colormodel for the cluster*/ -@@ -3691,7 +3758,8 @@ get_printer_uuid(http_t *http_printer, - const char* raw_uri) - { - ipp_t *response = NULL; -- ipp_attribute_t *attr; -+ ipp_attribute_t *attr = NULL; -+ char * uuid = NULL; - - const char * const pattrs[] = { - "printer-uuid", -@@ -3713,13 +3781,18 @@ get_printer_uuid(http_t *http_printer, - } - - attr = ippFindAttribute(response, "printer-uuid", IPP_TAG_URI); -+ -+ - if (attr) -- return (ippGetString(attr, 0, NULL) + 9); -+ uuid = ippGetString(attr, 0, NULL) + 9; - else { - debug_printf ("Printer with URI %s: Cannot read \"printer-uuid\" IPP attribute!\n", - raw_uri); -- return NULL; - } -+ -+ ippDelete(response); -+ -+ return uuid; - } - - static void -@@ -8114,6 +8187,19 @@ gboolean update_cups_queues(gpointer unused) { - ppdfile = strdup(buffer); - } - } -+ -+ if (num_cluster_printers != 1) { -+ free(default_pagesize); -+ default_pagesize = NULL; -+ free(make_model); -+ make_model = NULL; -+ cupsArrayDelete(conflicts); -+ conflicts = NULL; -+ ippDelete(printer_attributes); -+ printer_attributes = NULL; -+ cupsArrayDelete(sizes); -+ sizes = NULL; -+ } - } else if (IPPPrinterQueueType == PPD_NO) { - ppdfile = NULL; - -@@ -8430,6 +8516,19 @@ gboolean update_cups_queues(gpointer unused) { - } - } - } -+ -+ if (num_cluster_printers != 1) { -+ free(default_pagesize); -+ default_pagesize = NULL; -+ free(make_model); -+ make_model = NULL; -+ cupsArrayDelete(conflicts); -+ conflicts = NULL; -+ ippDelete(printer_attributes); -+ printer_attributes = NULL; -+ cupsArrayDelete(sizes); -+ sizes = NULL; -+ } - } else { - /* Device URI: using implicitclass backend for IPP network printer */ - httpAssembleURI(HTTP_URI_CODING_ALL, device_uri, sizeof(device_uri), -@@ -8531,8 +8630,9 @@ gboolean update_cups_queues(gpointer unused) { - cupsFilePrintf(out, "%s\n", line); - } - /* Save the NickName of the PPD to check whether external -- manipulations of the print queue have replaced the PPD */ -- if (!strncmp(line, "*NickName:", 10)) { -+ manipulations of the print queue have replaced the PPD. -+ Check whether nickname is defined too */ -+ if (!strncmp(line, "*NickName:", 10) && p->nickname == NULL) { - ptr = strchr(line, '"'); - if (ptr) { - ptr ++; --- -2.26.2 - diff --git a/0001-libcupsfilters-Removed-all-signal-handling-and-globa.patch b/0001-libcupsfilters-Removed-all-signal-handling-and-globa.patch new file mode 100644 index 0000000..a8aedfa --- /dev/null +++ b/0001-libcupsfilters-Removed-all-signal-handling-and-globa.patch @@ -0,0 +1,165 @@ +From ffce73c94f92c9a1b193858b96399e319268a1fa Mon Sep 17 00:00:00 2001 +From: Till Kamppeter +Date: Thu, 27 Aug 2020 15:45:22 +0200 +Subject: [PATCH] libcupsfilters: Removed all signal handling and global + variables from get_printer_attributes() and ippfind_based_uri_converter() + +(cherry picked from commit 23a9dc4010cefe239b8393e4500eb834b0f5ee32) +--- + cupsfilters/ipp.c | 86 ++++------------------------------------------- + 1 file changed, 6 insertions(+), 80 deletions(-) + +diff --git a/cupsfilters/ipp.c b/cupsfilters/ipp.c +index c9138fe2..21861a59 100644 +--- a/cupsfilters/ipp.c ++++ b/cupsfilters/ipp.c +@@ -36,25 +36,24 @@ + #if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5) + #define HAVE_CUPS_1_6 1 + #endif +-static int debug = 0; +-static int job_canceled = 0; +-static void cancel_job(int sig); + + enum resolve_uri_converter_type /**** Resolving DNS-SD based URI ****/ + { + CUPS_BACKEND_URI_CONVERTER = -1, + IPPFIND_BASED_CONVERTER_FOR_PRINT_URI = 0, + IPPFIND_BASED_CONVERTER_FOR_FAX_URI = 1 +-} ; ++}; ++ + static int + convert_to_port(char *a) + { + int port = 0; +- for( int i = 0; i - 1.28.1-1 +- 1.28.1 - added driverless fax support + * Fri Aug 21 2020 Zdenek Dohnal - 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 diff --git a/sources b/sources index ca231de..ba96251 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (cups-filters-1.27.5.tar.xz) = 8bc917b2a168add1062d091d02d99c39d72861c0d0cb1242c34b2bf117c9943e7fdc1fe002de7cde4cb1919fbce41073adc34916c328fc99e66e389b0a4fe103 +SHA512 (cups-filters-1.28.1.tar.xz) = 23f6fa31e2c64aaa1b7321280bb92dffb25456289c21aa91aec46afca80a8b4e9ea6697ed5ed574d4bbb0c2ab790618cc926d46bb35f2eec576d0ab88a0f2aff