summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDidier Raboud <odyx@debian.org>2018-12-14 15:34:09 +0100
committerDidier Raboud <odyx@debian.org>2018-12-14 15:34:18 +0100
commitfc28ccaf39f8b9ce9eda9978f4653a54b18266b4 (patch)
tree224937a829bf38dd0dd7eb24099f9c552e024d8f
parent58b34ab3c8556e7d7468a777683ddfd6684cb0e7 (diff)
parent6c690f9ccb35e762e79b469e4632e25cdc8308bd (diff)
merge patched-debian/experimental into debian/experimental
-rw-r--r--cups/ipp.c116
-rw-r--r--debian/.git-dpm4
-rw-r--r--debian/patches/0019-Let-snmp-backend-also-use-manufacturer-specific-MIBs.patch (renamed from debian/patches/0021-Let-snmp-backend-also-use-manufacturer-specific-MIBs.patch)2
-rw-r--r--debian/patches/0034-Build-mantohtml-with-the-build-architecture-compiler.patch (renamed from debian/patches/0037-Build-mantohtml-with-the-build-architecture-compiler.patch)2
-rw-r--r--debian/patches/airprint-support.patch2
-rw-r--r--debian/patches/confdirperms.patch2
-rw-r--r--debian/patches/cups-deviced-allow-device-ids-with-newline.patch56
-rw-r--r--debian/patches/cups-set-default-error-policy-retry-job.patch2
-rw-r--r--debian/patches/cupsd-set-default-for-SyncOnClose-to-Yes.patch2
-rw-r--r--debian/patches/debianize_cups-config.patch2
-rw-r--r--debian/patches/default_log_settings.patch2
-rw-r--r--debian/patches/do-not-broadcast-with-hostnames.patch2
-rw-r--r--debian/patches/log-debug-history-nearly-unlimited.patch2
-rw-r--r--debian/patches/logfiles_adm_readable.patch2
-rw-r--r--debian/patches/man-cups-lpd-drop-dangling-references.patch2
-rw-r--r--debian/patches/manpage-translations.patch2
-rw-r--r--debian/patches/no-conffile-timestamp.patch11
-rw-r--r--debian/patches/printer-filtering.patch148
-rw-r--r--debian/patches/reactivate_recommended_driver.patch2
-rw-r--r--debian/patches/read-embedded-options-from-incoming-postscript-and-add-to-ipp-attrs.patch122
-rw-r--r--debian/patches/removecvstag.patch2
-rw-r--r--debian/patches/rename-systemd-units.patch2
-rw-r--r--debian/patches/series7
-rw-r--r--debian/patches/show-compile-command-lines.patch2
-rw-r--r--scheduler/cups-deviced.c23
-rw-r--r--scheduler/ipp.c84
-rw-r--r--scheduler/job.c2
27 files changed, 31 insertions, 576 deletions
diff --git a/cups/ipp.c b/cups/ipp.c
index c033fa369..d96f77404 100644
--- a/cups/ipp.c
+++ b/cups/ipp.c
@@ -2640,120 +2640,6 @@ ippNew(void)
return (temp);
}
-/*
- * 'ippFilterPrinters()' - Filter printer list based on environment variables
- */
-ipp_state_t /* O - Current state */
-ippFilterPrinters(ipp_t *ipp) /* I - IPP data */
-{
- char *env_printer_list = NULL;
- char *result_printer_list;
- char delim_printers[] = ",";
- char **printer_list_array;
- char *default_printer_env;
- int printer_list_size = 0;
- ipp_attribute_t *filtertmpattr;
- ipp_attribute_t *filtertmpattr2;
- int i = 0;
- int j = 0;
- int found = 0;
- int printer_name_found = 0;
- int len = 0;
- int last_null = 0;
-
- /*
- * First we create an array from PRINTER and PRINTER_LIST
- */
- if(getenv("PRINTER") != NULL) {
- default_printer_env = getenv("PRINTER");
- printer_list_size++;
- } else {
- default_printer_env = (char *)malloc(sizeof(char));
- default_printer_env = "";
- }
-
- env_printer_list = strdup(getenv("PRINTER_LIST"));
- result_printer_list = strtok(env_printer_list, delim_printers);
- while(result_printer_list) {
- if(default_printer_env && strcasecmp(result_printer_list, default_printer_env) != 0)
- printer_list_size++;
- result_printer_list = strtok( NULL, delim_printers);
- }
-
- printer_list_array = (char **)malloc(printer_list_size * sizeof(char *));
-
- env_printer_list = strdup(getenv("PRINTER_LIST"));
-
- result_printer_list = strtok(env_printer_list, delim_printers);
- while(result_printer_list) {
- /*
- * Don't add the default printer if it's defined
- */
- if(strcasecmp(result_printer_list, default_printer_env) != 0) {
- printer_list_array[i] = (char *)malloc(sizeof(result_printer_list));
- printer_list_array[i++] = result_printer_list;
- }
- result_printer_list = strtok( NULL, delim_printers);
- }
-
- if(strcasecmp(default_printer_env, "") != 0)
- printer_list_array[printer_list_size-1] = default_printer_env;
-
- // number of attributes
- for (filtertmpattr = ipp->attrs; filtertmpattr != NULL; filtertmpattr = filtertmpattr->next) {
- len++;
- }
- ipp_attribute_t* array[len];
-
- for (filtertmpattr = ipp->attrs; filtertmpattr != NULL; filtertmpattr = filtertmpattr->next) {
- array[j++] = filtertmpattr;
- }
-
- for (j=0; j<len; j++) {
- filtertmpattr = array[j];
- // if the current attribute is a printer_name, find it in the list
- if ((filtertmpattr->value_tag == IPP_TAG_NAME) &&
- (strcasecmp(filtertmpattr->name, "printer-name") == 0)) {
- printer_name_found = 1;
-
- // compare the current printer with the values in the list
- for(i = 0; i < printer_list_size; i++) {
- if (printer_list_array[i] && filtertmpattr->values[0].string.text &&
- (strcasecmp(filtertmpattr->values[0].string.text, printer_list_array[i]) == 0)) {
- found = 1;
- }
- }
- }
-
- // last attribute of a printer (separator) or last attribute
- if (filtertmpattr->value_tag == IPP_TAG_ZERO || filtertmpattr->next == NULL) {
- if(found == 0 && printer_name_found == 1) { // not found so we remove it
- // First printer
- if(last_null == 0) {
- ipp->attrs = filtertmpattr->next;
- } else {
- // Printer in the middle
- (array[last_null])->next = filtertmpattr->next;
- }
- } else {
- // the last known good printer
- last_null = j;
- }
- printer_name_found = 0;
- found = 0;
- }
- }
-
- // remove the last IPP_TAG_ZERO if the last element in the list
- for (filtertmpattr = ipp->attrs; filtertmpattr != NULL; filtertmpattr = filtertmpattr->next){
- if (filtertmpattr->value_tag == IPP_TAG_ZERO && filtertmpattr->next == NULL){
- filtertmpattr2->next = NULL;
- }
- filtertmpattr2 = filtertmpattr;
- }
- return 0;
-}
-
/*
* 'ippNewRequest()' - Allocate a new IPP request message.
@@ -3100,8 +2986,6 @@ ippReadIO(void *src, /* I - Data source */
*/
DEBUG_puts("2ippReadIO: IPP_TAG_END.");
- if(getenv("PRINTER_LIST"))
- ippFilterPrinters(ipp);
ipp->state = IPP_STATE_DATA;
break;
diff --git a/debian/.git-dpm b/debian/.git-dpm
index 963bdede3..1781b9484 100644
--- a/debian/.git-dpm
+++ b/debian/.git-dpm
@@ -1,6 +1,6 @@
# see git-dpm(1) from git-dpm package
-3b2c80920d609226e0963b8b1eb957f7b4580e5d
-3b2c80920d609226e0963b8b1eb957f7b4580e5d
+6c690f9ccb35e762e79b469e4632e25cdc8308bd
+6c690f9ccb35e762e79b469e4632e25cdc8308bd
c13e2f44eb15bcdbff9126df86d1ed9a5108e47c
c13e2f44eb15bcdbff9126df86d1ed9a5108e47c
cups_2.3~b6.orig.tar.gz
diff --git a/debian/patches/0021-Let-snmp-backend-also-use-manufacturer-specific-MIBs.patch b/debian/patches/0019-Let-snmp-backend-also-use-manufacturer-specific-MIBs.patch
index 08f2eb2b9..97b6cde0b 100644
--- a/debian/patches/0021-Let-snmp-backend-also-use-manufacturer-specific-MIBs.patch
+++ b/debian/patches/0019-Let-snmp-backend-also-use-manufacturer-specific-MIBs.patch
@@ -1,4 +1,4 @@
-From ff9a071e72e0fd2a8baac49b423bf7317c1ef90d Mon Sep 17 00:00:00 2001
+From 58cbe1f0e0faa219b76f39eae13d5ecf2600224e Mon Sep 17 00:00:00 2001
From: Tim Waugh <twaugh@redhat.com>
Date: Tue, 9 Aug 2016 18:11:30 +0200
Subject: Let snmp backend also use manufacturer-specific MIBs
diff --git a/debian/patches/0037-Build-mantohtml-with-the-build-architecture-compiler.patch b/debian/patches/0034-Build-mantohtml-with-the-build-architecture-compiler.patch
index 3c27038d7..5252f50d1 100644
--- a/debian/patches/0037-Build-mantohtml-with-the-build-architecture-compiler.patch
+++ b/debian/patches/0034-Build-mantohtml-with-the-build-architecture-compiler.patch
@@ -1,4 +1,4 @@
-From b75417e7e94caae37e541dfb130d14314bb33fe2 Mon Sep 17 00:00:00 2001
+From b5e5e1a472bdfff510390f6aad3022335e9a6e79 Mon Sep 17 00:00:00 2001
From: Helmut Grohne <helmut@subdivi.de>
Date: Tue, 9 Aug 2016 18:11:49 +0200
Subject: Build mantohtml with the build architecture compiler
diff --git a/debian/patches/airprint-support.patch b/debian/patches/airprint-support.patch
index 76c2c15b5..e1d10f32e 100644
--- a/debian/patches/airprint-support.patch
+++ b/debian/patches/airprint-support.patch
@@ -1,4 +1,4 @@
-From aa8ec5aa5fda3c9c7cbb4401d304eb8858d725e9 Mon Sep 17 00:00:00 2001
+From bb47ff28be53f135572f3bc4f0fd4fda23b33624 Mon Sep 17 00:00:00 2001
From: Till Kamppeter <till.kamppeter@gmail.com>
Date: Tue, 9 Aug 2016 18:11:29 +0200
Subject: Patch to support Apple AirPrint (printing from iPhone, iPad, iPod
diff --git a/debian/patches/confdirperms.patch b/debian/patches/confdirperms.patch
index 2912a5108..c62e45d11 100644
--- a/debian/patches/confdirperms.patch
+++ b/debian/patches/confdirperms.patch
@@ -1,4 +1,4 @@
-From d45e30822bb0fe17c69dcf0b7555fb93bbfa4d7c Mon Sep 17 00:00:00 2001
+From 5ad311f768e51520d73057c20483f1bbeaf62b6b Mon Sep 17 00:00:00 2001
From: Martin Pitt <mpitt@debian.org>
Date: Tue, 9 Aug 2016 18:11:41 +0200
Subject: Do not mess with the permissions of cupsd.conf.
diff --git a/debian/patches/cups-deviced-allow-device-ids-with-newline.patch b/debian/patches/cups-deviced-allow-device-ids-with-newline.patch
deleted file mode 100644
index cc44ef1cf..000000000
--- a/debian/patches/cups-deviced-allow-device-ids-with-newline.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From f6b933d2cb84657360f1913aff6d4148b5006f38 Mon Sep 17 00:00:00 2001
-From: Till Kamppeter <till.kamppeter@gmail.com>
-Date: Tue, 9 Aug 2016 18:11:28 +0200
-Subject: Some printers have broken device IDs with newline
-
- characters inside. These break the cups-deviced printer discovery
- mechanism and so the printers get ignored. This patch allows newline
- characters in device IDs
-Bug-Ubuntu: https://bugs.launchpad.net/bugs/468701
-Bug: https://www.cups.org/str.php?L4345
-Last-Update: 2015-02-10
-
-Patch-Name: cups-deviced-allow-device-ids-with-newline.patch
----
- scheduler/cups-deviced.c | 23 +++++++++++++++++++----
- 1 file changed, 19 insertions(+), 4 deletions(-)
-
-diff --git a/scheduler/cups-deviced.c b/scheduler/cups-deviced.c
-index 14478fd99..e45f058a5 100644
---- a/scheduler/cups-deviced.c
-+++ b/scheduler/cups-deviced.c
-@@ -559,15 +559,30 @@ get_device(cupsd_backend_t *backend) /* I - Backend to read from */
-
- if (*ptr == '\"')
- {
-- for (ptr ++, device_id = ptr; *ptr && *ptr != '\"'; ptr ++)
-+ for (ptr ++, device_id = ptr; *ptr != '\"'; ptr ++)
- {
- if (*ptr == '\\' && ptr[1])
- _cups_strcpy(ptr, ptr + 1);
-+ if (!*ptr)
-+ {
-+ fprintf(stderr, "WARNING: [cups-deviced] Possible newline in device ID \"%s\": %s\n",
-+ backend->name, line);
-+ *ptr = ' ';
-+ ptr ++;
-+ *ptr = 0;
-+ if (!cupsFileGets(backend->pipe, ptr, sizeof(line) - (ptr - temp)))
-+ {
-+ cupsFileClose(backend->pipe);
-+ backend->pipe = NULL;
-+ fprintf(stderr, "ERROR: [cups-deviced] Bad line from \"%s\": %s\n",
-+ backend->name, line);
-+ return (-1);
-+ }
-+ }
-+ if (!*ptr)
-+ goto error;
- }
-
-- if (*ptr != '\"')
-- goto error;
--
- for (*ptr++ = '\0'; isspace(*ptr & 255); *ptr++ = '\0');
-
- /*
diff --git a/debian/patches/cups-set-default-error-policy-retry-job.patch b/debian/patches/cups-set-default-error-policy-retry-job.patch
index 819408498..d70ce41cf 100644
--- a/debian/patches/cups-set-default-error-policy-retry-job.patch
+++ b/debian/patches/cups-set-default-error-policy-retry-job.patch
@@ -1,4 +1,4 @@
-From 52fb025c5a55d79d46dfe512aa0518d73690db17 Mon Sep 17 00:00:00 2001
+From 5365bcb9966544a5dea91330820066f6ce139cb8 Mon Sep 17 00:00:00 2001
From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Tue, 9 Aug 2016 18:11:47 +0200
Subject: Set default job error policy to "retry-job", since it is less
diff --git a/debian/patches/cupsd-set-default-for-SyncOnClose-to-Yes.patch b/debian/patches/cupsd-set-default-for-SyncOnClose-to-Yes.patch
index bef9def0e..f591b2231 100644
--- a/debian/patches/cupsd-set-default-for-SyncOnClose-to-Yes.patch
+++ b/debian/patches/cupsd-set-default-for-SyncOnClose-to-Yes.patch
@@ -1,4 +1,4 @@
-From 448c2bec91df35d5ca3de9bfaccb1f279f5822c8 Mon Sep 17 00:00:00 2001
+From 951b3718cb0011b3b8062361923dbc1db3aafc1d Mon Sep 17 00:00:00 2001
From: Tim Waugh <twaugh@redhat.com>
Date: Tue, 9 Aug 2016 18:11:46 +0200
Subject: Set the default for SyncOnClose to Yes
diff --git a/debian/patches/debianize_cups-config.patch b/debian/patches/debianize_cups-config.patch
index 2a3b072bb..4560d4242 100644
--- a/debian/patches/debianize_cups-config.patch
+++ b/debian/patches/debianize_cups-config.patch
@@ -1,4 +1,4 @@
-From d5b44f1d980ff249d310e881fd8dab009ac18e28 Mon Sep 17 00:00:00 2001
+From 59338e4ef6c8cdd4c08547e12734902c341f15e6 Mon Sep 17 00:00:00 2001
From: Didier Raboud <odyx@debian.org>
Date: Tue, 9 Aug 2016 18:11:49 +0200
Subject: Use dpkg-architecture in cups-config to make it
diff --git a/debian/patches/default_log_settings.patch b/debian/patches/default_log_settings.patch
index 45ca38100..187abfbef 100644
--- a/debian/patches/default_log_settings.patch
+++ b/debian/patches/default_log_settings.patch
@@ -1,4 +1,4 @@
-From 51a3f43949c5bf989cbbe1628ad21275d971740b Mon Sep 17 00:00:00 2001
+From 2dccbe4982487ce8c9df786f480e79133bd6df0b Mon Sep 17 00:00:00 2001
From: Didier Raboud <odyx@debian.org>
Date: Tue, 9 Aug 2016 18:11:40 +0200
Subject: Deactivate CUPS' own log rotating as the system already provides a
diff --git a/debian/patches/do-not-broadcast-with-hostnames.patch b/debian/patches/do-not-broadcast-with-hostnames.patch
index fc242e046..943eb36bb 100644
--- a/debian/patches/do-not-broadcast-with-hostnames.patch
+++ b/debian/patches/do-not-broadcast-with-hostnames.patch
@@ -1,4 +1,4 @@
-From dc8a2ac3e2fddfcfcb409360cda7288274f50e45 Mon Sep 17 00:00:00 2001
+From 386e44d4ba979bc65263cf805895e1c90f28d192 Mon Sep 17 00:00:00 2001
From: Till Kampetter <till.kampetter@gmail.com>
Date: Tue, 9 Aug 2016 18:11:35 +0200
Subject: Do not use host names for broadcasting print queues and
diff --git a/debian/patches/log-debug-history-nearly-unlimited.patch b/debian/patches/log-debug-history-nearly-unlimited.patch
index 96231ea17..4f155ba2b 100644
--- a/debian/patches/log-debug-history-nearly-unlimited.patch
+++ b/debian/patches/log-debug-history-nearly-unlimited.patch
@@ -1,4 +1,4 @@
-From a5875c07890865ff17f92866c85eb397b544c5ef Mon Sep 17 00:00:00 2001
+From f97dd6caedde61e955e657cb6ea574723e1bfba3 Mon Sep 17 00:00:00 2001
From: Till Kampetter <till.kampetter@gmail.com>
Date: Tue, 9 Aug 2016 18:11:45 +0200
Subject: Make log debug history nearly unlimited
diff --git a/debian/patches/logfiles_adm_readable.patch b/debian/patches/logfiles_adm_readable.patch
index 846283d8c..a36136486 100644
--- a/debian/patches/logfiles_adm_readable.patch
+++ b/debian/patches/logfiles_adm_readable.patch
@@ -1,4 +1,4 @@
-From e5dfccfa4081e823aaa8c6729834f8794a145cca Mon Sep 17 00:00:00 2001
+From 41457e63395fb83289ec90b7081b44d4104672c0 Mon Sep 17 00:00:00 2001
From: Martin Pitt <mpitt@debian.org>
Date: Tue, 9 Aug 2016 18:11:38 +0200
Subject: Make log files readable to group "adm", if present.
diff --git a/debian/patches/man-cups-lpd-drop-dangling-references.patch b/debian/patches/man-cups-lpd-drop-dangling-references.patch
index a22db1bf6..650ea3006 100644
--- a/debian/patches/man-cups-lpd-drop-dangling-references.patch
+++ b/debian/patches/man-cups-lpd-drop-dangling-references.patch
@@ -1,4 +1,4 @@
-From ac576e6eaeabfb5d2c4138e86fad91ce73b2055a Mon Sep 17 00:00:00 2001
+From ce58d57dc0256cf16d7054fac56e2b6ecb146bf7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= <bastien.roucaries@u-cergy.fr>
Date: Tue, 9 Aug 2016 18:11:48 +0200
Subject: Drop dangling references from cups-lpd.man
diff --git a/debian/patches/manpage-translations.patch b/debian/patches/manpage-translations.patch
index f133ee525..b85436f27 100644
--- a/debian/patches/manpage-translations.patch
+++ b/debian/patches/manpage-translations.patch
@@ -1,4 +1,4 @@
-From 3b2c80920d609226e0963b8b1eb957f7b4580e5d Mon Sep 17 00:00:00 2001
+From 6c690f9ccb35e762e79b469e4632e25cdc8308bd Mon Sep 17 00:00:00 2001
From: Didier Raboud <odyx@debian.org>
Date: Tue, 9 Aug 2016 18:11:50 +0200
Subject: po4a infrastructure and translations for manpages.
diff --git a/debian/patches/no-conffile-timestamp.patch b/debian/patches/no-conffile-timestamp.patch
index 6e4d18f93..34f40a442 100644
--- a/debian/patches/no-conffile-timestamp.patch
+++ b/debian/patches/no-conffile-timestamp.patch
@@ -1,12 +1,11 @@
-From 461b14854913641a0d710efd95e968e7ed3a2e03 Mon Sep 17 00:00:00 2001
+From d452eb94c91cb297968d6b6345da2f77852d8724 Mon Sep 17 00:00:00 2001
From: Joey Hess <joeyh@debian.org>
Date: Tue, 9 Aug 2016 18:11:31 +0200
Subject: Disable time stamps in conffiles, to avoid ever-changing files in
/etc.
-Bug: http://www.cups.org/str.php?L3067
-Bug-Debian: http://bugs.debian.org/549673
-Last-Update: 2015-02-10
+Bug: https://github.com/apple/cups/issues/3067
+Bug-Debian: https://bugs.debian.org/549673
Patch-Name: no-conffile-timestamp.patch
---
@@ -30,7 +29,7 @@ index 776e79a91..ec6357ffe 100644
/*
diff --git a/scheduler/job.c b/scheduler/job.c
-index de22a5f55..56d818ba9 100644
+index de22a5f55..8e9e5ba55 100644
--- a/scheduler/job.c
+++ b/scheduler/job.c
@@ -2202,7 +2202,7 @@ cupsdSaveAllJobs(void)
@@ -38,7 +37,7 @@ index de22a5f55..56d818ba9 100644
cupsFilePuts(fp, "# Job cache file for " CUPS_SVERSION "\n");
- cupsFilePrintf(fp, "# Written by cupsd on %s\n", temp);
-+ cupsFilePrintf(fp, "# Written by cupsd\n", temp);
++ cupsFilePrintf(fp, "# Written by cupsd\n");
cupsFilePrintf(fp, "NextJobId %d\n", NextJobId);
/*
diff --git a/debian/patches/printer-filtering.patch b/debian/patches/printer-filtering.patch
deleted file mode 100644
index 8e3117de2..000000000
--- a/debian/patches/printer-filtering.patch
+++ /dev/null
@@ -1,148 +0,0 @@
-From 985825c7b910e9108aca52adb5405cfe160f11a7 Mon Sep 17 00:00:00 2001
-From: Julien Desfossez at Revolution Linux
- <Julien Desfossez at Revolution Linux>
-Date: Tue, 9 Aug 2016 18:11:42 +0200
-Subject: Filter printers based on PRINTER_LIST
-
-Last-Update: 2015-10-02
-
-=== modified file 'cups-1.3.9/cups/ipp.c'
-Patch-Name: printer-filtering.patch
----
- cups/ipp.c | 116 +++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 116 insertions(+)
-
-diff --git a/cups/ipp.c b/cups/ipp.c
-index d96f77404..c033fa369 100644
---- a/cups/ipp.c
-+++ b/cups/ipp.c
-@@ -2640,6 +2640,120 @@ ippNew(void)
- return (temp);
- }
-
-+/*
-+ * 'ippFilterPrinters()' - Filter printer list based on environment variables
-+ */
-+ipp_state_t /* O - Current state */
-+ippFilterPrinters(ipp_t *ipp) /* I - IPP data */
-+{
-+ char *env_printer_list = NULL;
-+ char *result_printer_list;
-+ char delim_printers[] = ",";
-+ char **printer_list_array;
-+ char *default_printer_env;
-+ int printer_list_size = 0;
-+ ipp_attribute_t *filtertmpattr;
-+ ipp_attribute_t *filtertmpattr2;
-+ int i = 0;
-+ int j = 0;
-+ int found = 0;
-+ int printer_name_found = 0;
-+ int len = 0;
-+ int last_null = 0;
-+
-+ /*
-+ * First we create an array from PRINTER and PRINTER_LIST
-+ */
-+ if(getenv("PRINTER") != NULL) {
-+ default_printer_env = getenv("PRINTER");
-+ printer_list_size++;
-+ } else {
-+ default_printer_env = (char *)malloc(sizeof(char));
-+ default_printer_env = "";
-+ }
-+
-+ env_printer_list = strdup(getenv("PRINTER_LIST"));
-+ result_printer_list = strtok(env_printer_list, delim_printers);
-+ while(result_printer_list) {
-+ if(default_printer_env && strcasecmp(result_printer_list, default_printer_env) != 0)
-+ printer_list_size++;
-+ result_printer_list = strtok( NULL, delim_printers);
-+ }
-+
-+ printer_list_array = (char **)malloc(printer_list_size * sizeof(char *));
-+
-+ env_printer_list = strdup(getenv("PRINTER_LIST"));
-+
-+ result_printer_list = strtok(env_printer_list, delim_printers);
-+ while(result_printer_list) {
-+ /*
-+ * Don't add the default printer if it's defined
-+ */
-+ if(strcasecmp(result_printer_list, default_printer_env) != 0) {
-+ printer_list_array[i] = (char *)malloc(sizeof(result_printer_list));
-+ printer_list_array[i++] = result_printer_list;
-+ }
-+ result_printer_list = strtok( NULL, delim_printers);
-+ }
-+
-+ if(strcasecmp(default_printer_env, "") != 0)
-+ printer_list_array[printer_list_size-1] = default_printer_env;
-+
-+ // number of attributes
-+ for (filtertmpattr = ipp->attrs; filtertmpattr != NULL; filtertmpattr = filtertmpattr->next) {
-+ len++;
-+ }
-+ ipp_attribute_t* array[len];
-+
-+ for (filtertmpattr = ipp->attrs; filtertmpattr != NULL; filtertmpattr = filtertmpattr->next) {
-+ array[j++] = filtertmpattr;
-+ }
-+
-+ for (j=0; j<len; j++) {
-+ filtertmpattr = array[j];
-+ // if the current attribute is a printer_name, find it in the list
-+ if ((filtertmpattr->value_tag == IPP_TAG_NAME) &&
-+ (strcasecmp(filtertmpattr->name, "printer-name") == 0)) {
-+ printer_name_found = 1;
-+
-+ // compare the current printer with the values in the list
-+ for(i = 0; i < printer_list_size; i++) {
-+ if (printer_list_array[i] && filtertmpattr->values[0].string.text &&
-+ (strcasecmp(filtertmpattr->values[0].string.text, printer_list_array[i]) == 0)) {
-+ found = 1;
-+ }
-+ }
-+ }
-+
-+ // last attribute of a printer (separator) or last attribute
-+ if (filtertmpattr->value_tag == IPP_TAG_ZERO || filtertmpattr->next == NULL) {
-+ if(found == 0 && printer_name_found == 1) { // not found so we remove it
-+ // First printer
-+ if(last_null == 0) {
-+ ipp->attrs = filtertmpattr->next;
-+ } else {
-+ // Printer in the middle
-+ (array[last_null])->next = filtertmpattr->next;
-+ }
-+ } else {
-+ // the last known good printer
-+ last_null = j;
-+ }
-+ printer_name_found = 0;
-+ found = 0;
-+ }
-+ }
-+
-+ // remove the last IPP_TAG_ZERO if the last element in the list
-+ for (filtertmpattr = ipp->attrs; filtertmpattr != NULL; filtertmpattr = filtertmpattr->next){
-+ if (filtertmpattr->value_tag == IPP_TAG_ZERO && filtertmpattr->next == NULL){
-+ filtertmpattr2->next = NULL;
-+ }
-+ filtertmpattr2 = filtertmpattr;
-+ }
-+ return 0;
-+}
-+
-
- /*
- * 'ippNewRequest()' - Allocate a new IPP request message.
-@@ -2986,6 +3100,8 @@ ippReadIO(void *src, /* I - Data source */
- */
-
- DEBUG_puts("2ippReadIO: IPP_TAG_END.");
-+ if(getenv("PRINTER_LIST"))
-+ ippFilterPrinters(ipp);
-
- ipp->state = IPP_STATE_DATA;
- break;
diff --git a/debian/patches/reactivate_recommended_driver.patch b/debian/patches/reactivate_recommended_driver.patch
index 27f7a8e36..b12ae773f 100644
--- a/debian/patches/reactivate_recommended_driver.patch
+++ b/debian/patches/reactivate_recommended_driver.patch
@@ -1,4 +1,4 @@
-From 99c734fb95d2a32f71e44c33be2dd4e63ae245e0 Mon Sep 17 00:00:00 2001
+From e75eb5a97703b71e07e8003a7e6174795a2ebb54 Mon Sep 17 00:00:00 2001
From: Till Kampetter <till.kampetter@gmail.com>
Date: Tue, 9 Aug 2016 18:11:36 +0200
Subject: CUPS removes the "(recommended)" comments of the NickNames of
diff --git a/debian/patches/read-embedded-options-from-incoming-postscript-and-add-to-ipp-attrs.patch b/debian/patches/read-embedded-options-from-incoming-postscript-and-add-to-ipp-attrs.patch
deleted file mode 100644
index 349288d55..000000000
--- a/debian/patches/read-embedded-options-from-incoming-postscript-and-add-to-ipp-attrs.patch
+++ /dev/null
@@ -1,122 +0,0 @@
-From 4007eaf02cadc017d14f5ce1d5bd66c27524b670 Mon Sep 17 00:00:00 2001
-From: Till Kamppeter <till.kamppeter@gmail.com>
-Date: Tue, 9 Aug 2016 18:11:27 +0200
-Subject: Make CUPS reading all option settings in PostScript print
-
- jobs and add the option settings to the filter command line before
- starting the filter chain. This fixes the problem that in the PDF
- printing workflow (where incoming PostScript gets converted to PDF by
- pstopdf) option settings embedded in the incoming PostScript code do
- not get obeyed. Especially the options of jobs from Windows clients get
- ignored.
-Origin: vendor
-Bug: https://www.cups.org/str.php?L4344
-Last-Update: 2015-02-10
-
-Patch-Name: read-embedded-options-from-incoming-postscript-and-add-to-ipp-attrs.patch
----
- scheduler/ipp.c | 84 +++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 84 insertions(+)
-
-diff --git a/scheduler/ipp.c b/scheduler/ipp.c
-index c771f77f8..31e9e84e6 100644
---- a/scheduler/ipp.c
-+++ b/scheduler/ipp.c
-@@ -8703,6 +8703,11 @@ read_job_ticket(cupsd_client_t *con) /* I - Client connection */
- ipp_attribute_t *attr, /* Current attribute */
- *attr2, /* Job attribute */
- *prev2; /* Previous job attribute */
-+ int foundfirstpage; /* Did we find the first page already
-+ in the PostScript input? */
-+ int num_copies; /* Number of copies according to
-+ PostScript command in input file */
-+ char *s, *t, buffer[10];
-
-
- /*
-@@ -8763,6 +8768,85 @@ read_job_ticket(cupsd_client_t *con) /* I - Client connection */
- num_options = cupsParseOptions(line + 15, num_options, &options);
- }
-
-+ /*
-+ * Read option settings embedded in the file...
-+ */
-+
-+ foundfirstpage = 0;
-+
-+ while (cupsFileGets(fp, line, sizeof(line)))
-+ {
-+ /*
-+ * Stop at the second page, we read also the settings of the first PageSetup
-+ * to work around a bug in OpenOffice.org. This app puts options intended
-+ * for the whole document into the page setup of the first page
-+ */
-+
-+ if (!strncmp(line, "%%Page:", 7))
-+ {
-+ if (foundfirstpage == 1)
-+ break;
-+ foundfirstpage = 1;
-+ }
-+
-+ /*
-+ * Add the embedded option settings to the option array...
-+ */
-+
-+ s = NULL;
-+ if (!strncmp(line, "%%BeginFeature:", 15))
-+ s = line + 15;
-+ else if (!strncmp(line, "%%IncludeFeature:", 17))
-+ s = line + 17;
-+ else if (!strncmp(line, "%%BeginNonPPDFeature:", 21))
-+ s = line + 21;
-+
-+ if (s && (t = strstr(s, "NumCopies")) != NULL)
-+ {
-+ t += 9;
-+ while ((*t == ' ') || (*t == '\t')) t++;
-+ if (sscanf(t, "%9d", &num_copies) == 1)
-+ {
-+ sprintf(buffer, "%d", num_copies);
-+ num_options = cupsAddOption("copies", buffer, num_options, &options);
-+ }
-+ }
-+ else if (s)
-+ {
-+ while ((*s == ' ') || (*s == '\t')) s++;
-+ if (*s == '*') s++;
-+ t = s;
-+ while (*t && (*t != ' ') && (*t != '\t')) t++;
-+ if ((*t == ' ') || (*t == '\t')) *t = '=';
-+ num_options = cupsParseOptions(s, num_options, &options);
-+ }
-+
-+ /*
-+ * Read out "/#copies XXX def" and "/NumCopies XXX def" expressions from
-+ * PostScript input. Some apps insert these expressions to set the
-+ * number of copies.
-+ */
-+
-+ s = NULL;
-+ if ((s = strstr(line, "/#copies")) != NULL)
-+ s += 8;
-+ else if ((s = strstr(line, "/NumCopies")) != NULL)
-+ s += 10;
-+ if (s)
-+ {
-+ while ((*s == ' ') || (*s == '\t')) s++;
-+ if (sscanf(s, "%9d %as ", &num_copies, &t) == 2)
-+ {
-+ if (!strncmp(t, "def", 3))
-+ {
-+ sprintf(buffer, "%d", num_copies);
-+ num_options = cupsAddOption("copies", buffer, num_options, &options);
-+ }
-+ free(t);
-+ }
-+ }
-+ }
-+
- /*
- * Done with the file; see if we have any options...
- */
diff --git a/debian/patches/removecvstag.patch b/debian/patches/removecvstag.patch
index fb326d3d2..5b43ab46e 100644
--- a/debian/patches/removecvstag.patch
+++ b/debian/patches/removecvstag.patch
@@ -1,4 +1,4 @@
-From dede6c2b5e127788e77078dc57226b4c355987f0 Mon Sep 17 00:00:00 2001
+From 35c12456988bb8e4fdad824cd9c6dd8f88b7283e Mon Sep 17 00:00:00 2001
From: Kenshi Muto <kmuto@debian.org>
Date: Tue, 9 Aug 2016 18:11:33 +0200
Subject: Do not write VCS tags into installed conffiles
diff --git a/debian/patches/rename-systemd-units.patch b/debian/patches/rename-systemd-units.patch
index 389d2757e..a92cf56ca 100644
--- a/debian/patches/rename-systemd-units.patch
+++ b/debian/patches/rename-systemd-units.patch
@@ -1,4 +1,4 @@
-From 557269cc7a1c62fdfe9023cae894b22152f76ce6 Mon Sep 17 00:00:00 2001
+From a30d2cf58c4fb0bcfd600bcef00d15f3584d07aa Mon Sep 17 00:00:00 2001
From: Didier Raboud <odyx@debian.org>
Date: Tue, 9 Aug 2016 18:11:34 +0200
Subject: Rename the systemd service file from org.cups.cups.* to cups.*
diff --git a/debian/patches/series b/debian/patches/series
index 12a04d297..ec684eccb 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -15,10 +15,8 @@ tests-use-ipv4-lo-address.patch
tests-make-lpstat-call-reproducible.patch
tests-no-pdftourf.patch
move-cupsd-conf-default-to-share.patch
-read-embedded-options-from-incoming-postscript-and-add-to-ipp-attrs.patch
-cups-deviced-allow-device-ids-with-newline.patch
airprint-support.patch
-0021-Let-snmp-backend-also-use-manufacturer-specific-MIBs.patch
+0019-Let-snmp-backend-also-use-manufacturer-specific-MIBs.patch
no-conffile-timestamp.patch
removecvstag.patch
rename-systemd-units.patch
@@ -27,12 +25,11 @@ reactivate_recommended_driver.patch
logfiles_adm_readable.patch
default_log_settings.patch
confdirperms.patch
-printer-filtering.patch
show-compile-command-lines.patch
log-debug-history-nearly-unlimited.patch
cupsd-set-default-for-SyncOnClose-to-Yes.patch
cups-set-default-error-policy-retry-job.patch
man-cups-lpd-drop-dangling-references.patch
debianize_cups-config.patch
-0037-Build-mantohtml-with-the-build-architecture-compiler.patch
+0034-Build-mantohtml-with-the-build-architecture-compiler.patch
manpage-translations.patch
diff --git a/debian/patches/show-compile-command-lines.patch b/debian/patches/show-compile-command-lines.patch
index 52336e480..52c76481a 100644
--- a/debian/patches/show-compile-command-lines.patch
+++ b/debian/patches/show-compile-command-lines.patch
@@ -1,4 +1,4 @@
-From eb899d2d5858f0a1edd85e503546f55c33fa6d34 Mon Sep 17 00:00:00 2001
+From 8c6890d53f8b6b00305305d66393fdddcc1515dd Mon Sep 17 00:00:00 2001
From: Till Kampetter <till.kampetter@gmail.com>
Date: Tue, 9 Aug 2016 18:11:43 +0200
Subject: Show compile command lines
diff --git a/scheduler/cups-deviced.c b/scheduler/cups-deviced.c
index e45f058a5..14478fd99 100644
--- a/scheduler/cups-deviced.c
+++ b/scheduler/cups-deviced.c
@@ -559,30 +559,15 @@ get_device(cupsd_backend_t *backend) /* I - Backend to read from */
if (*ptr == '\"')
{
- for (ptr ++, device_id = ptr; *ptr != '\"'; ptr ++)
+ for (ptr ++, device_id = ptr; *ptr && *ptr != '\"'; ptr ++)
{
if (*ptr == '\\' && ptr[1])
_cups_strcpy(ptr, ptr + 1);
- if (!*ptr)
- {
- fprintf(stderr, "WARNING: [cups-deviced] Possible newline in device ID \"%s\": %s\n",
- backend->name, line);
- *ptr = ' ';
- ptr ++;
- *ptr = 0;
- if (!cupsFileGets(backend->pipe, ptr, sizeof(line) - (ptr - temp)))
- {
- cupsFileClose(backend->pipe);
- backend->pipe = NULL;
- fprintf(stderr, "ERROR: [cups-deviced] Bad line from \"%s\": %s\n",
- backend->name, line);
- return (-1);
- }
- }
- if (!*ptr)
- goto error;
}
+ if (*ptr != '\"')
+ goto error;
+
for (*ptr++ = '\0'; isspace(*ptr & 255); *ptr++ = '\0');
/*
diff --git a/scheduler/ipp.c b/scheduler/ipp.c
index 31e9e84e6..c771f77f8 100644
--- a/scheduler/ipp.c
+++ b/scheduler/ipp.c
@@ -8703,11 +8703,6 @@ read_job_ticket(cupsd_client_t *con) /* I - Client connection */
ipp_attribute_t *attr, /* Current attribute */
*attr2, /* Job attribute */
*prev2; /* Previous job attribute */
- int foundfirstpage; /* Did we find the first page already
- in the PostScript input? */
- int num_copies; /* Number of copies according to
- PostScript command in input file */
- char *s, *t, buffer[10];
/*
@@ -8769,85 +8764,6 @@ read_job_ticket(cupsd_client_t *con) /* I - Client connection */
}
/*
- * Read option settings embedded in the file...
- */
-
- foundfirstpage = 0;
-
- while (cupsFileGets(fp, line, sizeof(line)))
- {
- /*
- * Stop at the second page, we read also the settings of the first PageSetup
- * to work around a bug in OpenOffice.org. This app puts options intended
- * for the whole document into the page setup of the first page
- */
-
- if (!strncmp(line, "%%Page:", 7))
- {
- if (foundfirstpage == 1)
- break;
- foundfirstpage = 1;
- }
-
- /*
- * Add the embedded option settings to the option array...
- */
-
- s = NULL;
- if (!strncmp(line, "%%BeginFeature:", 15))
- s = line + 15;
- else if (!strncmp(line, "%%IncludeFeature:", 17))
- s = line + 17;
- else if (!strncmp(line, "%%BeginNonPPDFeature:", 21))
- s = line + 21;
-
- if (s && (t = strstr(s, "NumCopies")) != NULL)
- {
- t += 9;
- while ((*t == ' ') || (*t == '\t')) t++;
- if (sscanf(t, "%9d", &num_copies) == 1)
- {
- sprintf(buffer, "%d", num_copies);
- num_options = cupsAddOption("copies", buffer, num_options, &options);
- }
- }
- else if (s)
- {
- while ((*s == ' ') || (*s == '\t')) s++;
- if (*s == '*') s++;
- t = s;
- while (*t && (*t != ' ') && (*t != '\t')) t++;
- if ((*t == ' ') || (*t == '\t')) *t = '=';
- num_options = cupsParseOptions(s, num_options, &options);
- }
-
- /*
- * Read out "/#copies XXX def" and "/NumCopies XXX def" expressions from
- * PostScript input. Some apps insert these expressions to set the
- * number of copies.
- */
-
- s = NULL;
- if ((s = strstr(line, "/#copies")) != NULL)
- s += 8;
- else if ((s = strstr(line, "/NumCopies")) != NULL)
- s += 10;
- if (s)
- {
- while ((*s == ' ') || (*s == '\t')) s++;
- if (sscanf(s, "%9d %as ", &num_copies, &t) == 2)
- {
- if (!strncmp(t, "def", 3))
- {
- sprintf(buffer, "%d", num_copies);
- num_options = cupsAddOption("copies", buffer, num_options, &options);
- }
- free(t);
- }
- }
- }
-
- /*
* Done with the file; see if we have any options...
*/
diff --git a/scheduler/job.c b/scheduler/job.c
index 56d818ba9..8e9e5ba55 100644
--- a/scheduler/job.c
+++ b/scheduler/job.c
@@ -2202,7 +2202,7 @@ cupsdSaveAllJobs(void)
strftime(temp, sizeof(temp) - 1, "%Y-%m-%d %H:%M", curdate);
cupsFilePuts(fp, "# Job cache file for " CUPS_SVERSION "\n");
- cupsFilePrintf(fp, "# Written by cupsd\n", temp);
+ cupsFilePrintf(fp, "# Written by cupsd\n");
cupsFilePrintf(fp, "NextJobId %d\n", NextJobId);
/*