From d6f92953b4e8bddafeae068fe5e9005dcf4b30f9 Mon Sep 17 00:00:00 2001 From: Michael Sweet Date: Tue, 9 Aug 2016 18:11:23 +0200 Subject: Revert pdftourf filter addition in tests "Update "make test" to include alternate filter." . This fixes the error lines counting in the test, and is unneeded as pdftourf is not shipped in Debian. Origin: upstream Patch-Name: tests-no-pdftourf.patch --- test/run-stp-tests.sh | 4 +--- test/test.convs | 1 - test/test.types | 2 -- 3 files changed, 1 insertion(+), 6 deletions(-) delete mode 100644 test/test.types diff --git a/test/run-stp-tests.sh b/test/run-stp-tests.sh index 050ab7ee9..470e0bf2e 100755 --- a/test/run-stp-tests.sh +++ b/test/run-stp-tests.sh @@ -276,7 +276,7 @@ case "$usedebugprintfs" in echo "Enabling debug printfs (level $usedebugprintfs); log files can be found in $BASE/log..." CUPS_DEBUG_LOG="$BASE/log/debug_printfs.%d"; export CUPS_DEBUG_LOG CUPS_DEBUG_LEVEL="$usedebugprintfs"; export CUPS_DEBUG_LEVEL - CUPS_DEBUG_FILTER='^(http|_http|ipp|_ipp|cups.*Request|cupsGetResponse|cupsSend|mime).*$'; export CUPS_DEBUG_FILTER + CUPS_DEBUG_FILTER='^(http|_http|ipp|_ipp|cups.*Request|cupsGetResponse|cupsSend).*$'; export CUPS_DEBUG_FILTER ;; *) @@ -451,14 +451,12 @@ EOF } ln -s $root/test/test.convs $BASE/share/mime -ln -s $root/test/test.types $BASE/share/mime if test `uname` = Darwin; then instfilter cgimagetopdf imagetopdf pdf instfilter cgpdftopdf pdftopdf passthru instfilter cgpdftops pdftops ps instfilter cgpdftoraster pdftoraster raster - instfilter cgpdftoraster pdftourf raster instfilter cgtexttopdf texttopdf pdf instfilter pstocupsraster pstoraster raster else diff --git a/test/test.convs b/test/test.convs index 77a9ce01e..57540aac4 100644 --- a/test/test.convs +++ b/test/test.convs @@ -2,7 +2,6 @@ application/pdf application/vnd.cups-pdf 100 pdftopdf application/pdf application/postscript 100 pdftops application/pdf application/vnd.cups-raster 100 pdftoraster -application/pdf image/urf 100 pdftourf application/postscript application/vnd.cups-raster 100 pstoraster image/jpeg application/pdf 100 imagetopdf text/plain application/pdf 100 texttopdf diff --git a/test/test.types b/test/test.types deleted file mode 100644 index 914081c7f..000000000 --- a/test/test.types +++ /dev/null @@ -1,2 +0,0 @@ -# Test file listing potential MIME media types that are not in the standard mime.types file -image/urf \ No newline at end of file -- cgit v1.2.3 From 039f30d74597b01c9ba1bbe90a52359ebdbad495 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Mon, 11 Jun 2018 09:37:55 -0400 Subject: Fix regressions in ippValidateAttribute (Issue #5322, Issue #5330) --- cups/ipp.c | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/cups/ipp.c b/cups/ipp.c index b33a3bc2e..57d962058 100644 --- a/cups/ipp.c +++ b/cups/ipp.c @@ -5097,16 +5097,19 @@ ippValidateAttribute( break; } - if (*ptr < ' ' || *ptr == 0x7f) - { - ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad control character (PWG 5100.14 section 8.3)."), attr->name, attr->values[i].string.text); - return (0); - } - else if (*ptr) - { - ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.2)."), attr->name, attr->values[i].string.text); - return (0); - } + if (*ptr) + { + if (*ptr < ' ' || *ptr == 0x7f) + { + ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad control character (PWG 5100.14 section 8.3)."), attr->name, attr->values[i].string.text); + return (0); + } + else + { + ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.2)."), attr->name, attr->values[i].string.text); + return (0); + } + } if ((ptr - attr->values[i].string.text) > (IPP_MAX_TEXT - 1)) { @@ -5159,16 +5162,19 @@ ippValidateAttribute( break; } - if (*ptr < ' ' || *ptr == 0x7f) - { - ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad control character (PWG 5100.14 section 8.1)."), attr->name, attr->values[i].string.text); - return (0); - } - else if (*ptr) + if (*ptr) { - ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.3)."), attr->name, attr->values[i].string.text); - return (0); - } + if (*ptr < ' ' || *ptr == 0x7f) + { + ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad control character (PWG 5100.14 section 8.1)."), attr->name, attr->values[i].string.text); + return (0); + } + else + { + ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.3)."), attr->name, attr->values[i].string.text); + return (0); + } + } if ((ptr - attr->values[i].string.text) > (IPP_MAX_NAME - 1)) { -- cgit v1.2.3 From 1f4f6676f85dd3b5722ac497c45d389bee78843f Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Tue, 9 Aug 2016 18:11:24 +0200 Subject: Move cupsd.conf.default from SERVERROOT to DATADIR Origin: vendor Bug: https://cups.org/str.php?L4342 Bug-Debian: http://bugs.debian.org/640124 Last-Update: 2015-02-10 Patch-Name: move-cupsd-conf-default-to-share.patch --- cgi-bin/admin.c | 6 +++++- conf/Makefile | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cgi-bin/admin.c b/cgi-bin/admin.c index 576fac0bc..eb64ede63 100644 --- a/cgi-bin/admin.c +++ b/cgi-bin/admin.c @@ -1921,6 +1921,7 @@ do_config_server(http_t *http) /* I - HTTP connection */ int ch; /* Character from file */ char filename[1024]; /* Filename */ const char *server_root; /* Location of config files */ + const char *data_dir; /* Location of data files */ /* @@ -2004,7 +2005,10 @@ do_config_server(http_t *http) /* I - HTTP connection */ * well... */ - strlcat(filename, ".default", sizeof(filename)); + if ((data_dir = getenv("CUPS_DATADIR")) == NULL) + data_dir = CUPS_DATADIR; + + snprintf(filename, sizeof(filename), "%s/cupsd.conf.default",data_dir); if (!stat(filename, &info) && info.st_size < (1024 * 1024) && (cupsd = cupsFileOpen(filename, "r")) != NULL) diff --git a/conf/Makefile b/conf/Makefile index e8f88ec88..4302ebac9 100644 --- a/conf/Makefile +++ b/conf/Makefile @@ -74,7 +74,7 @@ install-data: else \ $(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(SERVERROOT) ; \ fi ; \ - $(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(SERVERROOT)/$$file.default; \ + $(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(DATADIR)/$$file.default; \ done $(INSTALL_DIR) -m 755 $(DATADIR)/mime for file in $(REPLACE); do \ @@ -122,9 +122,10 @@ install-libs: # uninstall: - for file in $(KEEP) $(REPLACE) cupsd.conf.default; do \ + for file in $(KEEP) $(REPLACE); do \ $(RM) $(SERVERROOT)/$$file; \ done + $(RM) $(DATADIR)/cupsd.conf.default -$(RMDIR) $(SERVERROOT) for file in $(REPLACE); do \ $(RM) $(DATADIR)/mime/$$file; \ -- cgit v1.2.3 From c08f77e7b10b20b165b016630673fcc995c3af43 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Tue, 9 Aug 2016 18:11:25 +0200 Subject: Do not link libcups.so and libcupsimage.so against unnecessary libraries. This avoids unnecessary package dependencies for both libcups, as well as for packages using cups-config. Bug: https://www.cups.org/str.php?L4343 Bug-Debian: http://bugs.debian.org/438067 Last-Update: 2015-10-02 Patch-Name: drop_unnecessary_dependencies.patch --- Makedefs.in | 2 +- cups/Makefile | 4 ++-- filter/Makefile | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makedefs.in b/Makedefs.in index 4055b9334..7c43a2aca 100644 --- a/Makedefs.in +++ b/Makedefs.in @@ -152,7 +152,7 @@ DBUS_NOTIFIER = @DBUS_NOTIFIER@ DBUS_NOTIFIERLIBS = @DBUS_NOTIFIERLIBS@ DNSSD_BACKEND = @DNSSD_BACKEND@ DSOFLAGS = -L../cups @DSOFLAGS@ -DSOLIBS = @DSOLIBS@ $(COMMONLIBS) +DSOLIBS = @DSOLIBS@ DNSSDLIBS = @DNSSDLIBS@ IPPFIND_BIN = @IPPFIND_BIN@ IPPFIND_MAN = @IPPFIND_MAN@ diff --git a/cups/Makefile b/cups/Makefile index f292ff0b3..d36159f0a 100644 --- a/cups/Makefile +++ b/cups/Makefile @@ -313,7 +313,7 @@ uninstall: libcups.so.2: $(LIBOBJS) echo Linking $@... $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) \ - $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ) + $(SSLLIBS) $(DNSSDLIBS) -lpthread $(LIBZ) -lm $(RM) `basename $@ .2` $(LN) $@ `basename $@ .2` @@ -335,7 +335,7 @@ libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER) -compatibility_version 2.0.0 \ -exported_symbols_list t.exp \ $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \ - $(COMMONLIBS) $(LIBZ) + -lpthread $(LIBZ) -lm $(RM) libcups.dylib t.exp $(LN) $@ libcups.dylib diff --git a/filter/Makefile b/filter/Makefile index 02aab14d8..467373c3c 100644 --- a/filter/Makefile +++ b/filter/Makefile @@ -236,7 +236,7 @@ gziptoany: gziptoany.o ../Makedefs ../cups/$(LIBCUPS) libcupsimage.so.2 libcupsimage.sl.2: $(IMAGEOBJS) echo Linking $@... $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS) $(DSOLIBS) \ - -L../cups $(LINKCUPS) + -L../cups $(LINKCUPS) -lpthread $(RM) `basename $@ .2` $(LN) $@ `basename $@ .2` -- cgit v1.2.3 From 5ec26c435b0b91e926c932a3deeb257c2aa3be9a Mon Sep 17 00:00:00 2001 From: Till Kamppeter 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 d1c6a89fb..d1b9140d3 100644 --- a/scheduler/ipp.c +++ b/scheduler/ipp.c @@ -8721,6 +8721,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]; /* @@ -8781,6 +8786,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... */ -- cgit v1.2.3 From 7e4ec7fc8f76c1596f23e7767f6c458aebcda09d Mon Sep 17 00:00:00 2001 From: Till Kamppeter 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 9a1b8d3e1..3cc4eecd0 100644 --- a/scheduler/cups-deviced.c +++ b/scheduler/cups-deviced.c @@ -562,15 +562,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'); /* -- cgit v1.2.3 From bbc3507a260d29db3fc5601826f33c10f9dccd1e Mon Sep 17 00:00:00 2001 From: Till Kamppeter Date: Tue, 9 Aug 2016 18:11:29 +0200 Subject: Patch to support Apple AirPrint (printing from iPhone, iPad, iPod Touch to a CUPS server) Bug-Ubuntu: https://bugs.launchpad.net/bugs/711779 Bug-Ubuntu: https://bugs.launchpad.net/bugs/1054495 Bug-Debian: http://bugs.debian.org/700961 Bug: https://cups.org/str.php?L4341 Last-Update: 2015-02-10 Patch-Name: airprint-support.patch --- conf/mime.convs.in | 3 +++ conf/mime.types | 3 +++ scheduler/conf.c | 2 +- scheduler/dirsvc.c | 6 ++++++ scheduler/printers.c | 4 +++- 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/conf/mime.convs.in b/conf/mime.convs.in index bffd04f84..33ce812e3 100644 --- a/conf/mime.convs.in +++ b/conf/mime.convs.in @@ -47,6 +47,9 @@ application/postscript application/vnd.cups-postscript 66 pstops application/vnd.cups-raster image/pwg-raster 100 rastertopwg application/vnd.cups-raster image/urf 100 rastertopwg +# Needed for printing from iOS (AirPrint) clients +image/urf application/pdf 100 - + ######################################################################## # # Raw filter... diff --git a/conf/mime.types b/conf/mime.types index fa5371486..84cb0fffe 100644 --- a/conf/mime.types +++ b/conf/mime.types @@ -111,6 +111,9 @@ image/x-alias pix short(8,8) short(8,24) image/x-bitmap bmp string(0,BM) + !printable(2,14) image/x-icon ico +# Needed for printing from iOS (AirPrint) clients +image/urf urf string(0,UNIRAST<00>) + ######################################################################## # # Text files... diff --git a/scheduler/conf.c b/scheduler/conf.c index 9c1be7089..52f2a6d35 100644 --- a/scheduler/conf.c +++ b/scheduler/conf.c @@ -745,7 +745,7 @@ cupsdReadConfiguration(void) DefaultShared = CUPS_DEFAULT_DEFAULT_SHARED; #if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - cupsdSetString(&DNSSDSubTypes, "_cups,_print"); + cupsdSetString(&DNSSDSubTypes, "_cups,_print,_universal"); #endif /* HAVE_DNSSD || HAVE_AVAHI */ cupsdSetString(&LPDConfigFile, CUPS_DEFAULT_LPD_CONFIG_FILE); diff --git a/scheduler/dirsvc.c b/scheduler/dirsvc.c index 3dab90ca9..f21942af3 100644 --- a/scheduler/dirsvc.c +++ b/scheduler/dirsvc.c @@ -443,6 +443,12 @@ dnssdBuildTxtRecord( keyvalue[count ][0] = "pdl"; keyvalue[count++][1] = p->pdl ? p->pdl : "application/postscript"; + /* iOS 6 does not accept this printer as AirPrint printer if there is + no URF txt record or "URF=none", "DM3" is the minimum needed found + by try and error */ + keyvalue[count ][0] = "URF"; + keyvalue[count++][1] = "DM3"; + if (get_auth_info_required(p, air_str, sizeof(air_str))) { keyvalue[count ][0] = "air"; diff --git a/scheduler/printers.c b/scheduler/printers.c index a0ebcbd3e..b5fe9e031 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -3765,7 +3765,9 @@ add_printer_formats(cupsd_printer_t *p) /* I - Printer */ } else if (!_cups_strcasecmp(type->super, "image")) { - if (!_cups_strcasecmp(type->type, "jpeg")) + if (!_cups_strcasecmp(type->type, "urf")) + strlcat(pdl, "image/urf,", sizeof(pdl)); + else if (!_cups_strcasecmp(type->type, "jpeg")) strlcat(pdl, "image/jpeg,", sizeof(pdl)); else if (!_cups_strcasecmp(type->type, "png")) strlcat(pdl, "image/png,", sizeof(pdl)); -- cgit v1.2.3 From c12301c662bafd89fe50b70de6c5162a8b8113ef Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Tue, 9 Aug 2016 18:11:30 +0200 Subject: Let the "snmp" backend also use the manufacturer-specific MIBs of HP and Ricoh to obtain the device IDs of network-connected printers. This way we get more reliable information about make and model and in addition the supported page description languages, which allow to identify whether an optional PostScript add-on is installed or for an unsupported printer which generic PPD is the best choice (requested by Ricoh). Bug: https://www.cups.org/str.php?L3552 Last-Update: 2015-02-10 Patch-Name: cups-snmp-oids-device-id-hp-ricoh.patch --- backend/snmp.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/snmp.c b/backend/snmp.c index e66edc980..a13562680 100644 --- a/backend/snmp.c +++ b/backend/snmp.c @@ -159,6 +159,8 @@ static const int UriOID[] = { CUPS_OID_ppmPortServiceNameOrURI, 1, 1, -1 }; static const int LexmarkProductOID[] = { 1,3,6,1,4,1,641,2,1,2,1,2,1,-1 }; static const int LexmarkProductOID2[] = { 1,3,6,1,4,1,674,10898,100,2,1,2,1,2,1,-1 }; static const int LexmarkDeviceIdOID[] = { 1,3,6,1,4,1,641,2,1,2,1,3,1,-1 }; +static const int HPDeviceIdOID[] = { 1,3,6,1,4,1,11,2,3,9,1,1,7,0,-1 }; +static const int RicohDeviceIdOID[] = { 1,3,6,1,4,1,367,3,2,1,1,1,11,0,-1 }; static const int XeroxProductOID[] = { 1,3,6,1,4,1,128,2,1,3,1,2,0,-1 }; static cups_array_t *DeviceURIs = NULL; static int HostNameLookups = 0; @@ -974,9 +976,15 @@ read_snmp_response(int fd) /* I - SNMP socket file descriptor */ _cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1, packet.community, CUPS_ASN1_GET_REQUEST, DEVICE_ID, LexmarkDeviceIdOID); + _cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1, + packet.community, CUPS_ASN1_GET_REQUEST, + DEVICE_ID, RicohDeviceIdOID); _cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1, packet.community, CUPS_ASN1_GET_REQUEST, DEVICE_PRODUCT, XeroxProductOID); + _cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1, + packet.community, CUPS_ASN1_GET_REQUEST, + DEVICE_ID, HPDeviceIdOID); break; case DEVICE_DESCRIPTION : -- cgit v1.2.3 From b88322fe28a6cec1f13b625e40b43569bdeb7cd6 Mon Sep 17 00:00:00 2001 From: Joey Hess 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 Patch-Name: no-conffile-timestamp.patch --- scheduler/classes.c | 2 +- scheduler/job.c | 2 +- scheduler/printers.c | 2 +- scheduler/subscriptions.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scheduler/classes.c b/scheduler/classes.c index 57f9a8f44..74036fd46 100644 --- a/scheduler/classes.c +++ b/scheduler/classes.c @@ -685,7 +685,7 @@ cupsdSaveAllClasses(void) strftime(temp, sizeof(temp) - 1, "%Y-%m-%d %H:%M", curdate); cupsFilePuts(fp, "# Class configuration file for " CUPS_SVERSION "\n"); - cupsFilePrintf(fp, "# Written by cupsd on %s\n", temp); + cupsFilePrintf(fp, "# Written by cupsd\n"); cupsFilePuts(fp, "# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING\n"); /* diff --git a/scheduler/job.c b/scheduler/job.c index 5a0cee9cb..67eb4507b 100644 --- a/scheduler/job.c +++ b/scheduler/job.c @@ -2203,7 +2203,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 on %s\n", temp); + cupsFilePrintf(fp, "# Written by cupsd\n", temp); cupsFilePrintf(fp, "NextJobId %d\n", NextJobId); /* diff --git a/scheduler/printers.c b/scheduler/printers.c index b5fe9e031..46ec0e836 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -1458,7 +1458,7 @@ cupsdSaveAllPrinters(void) strftime(temp, sizeof(temp) - 1, "%Y-%m-%d %H:%M", curdate); cupsFilePuts(fp, "# Printer configuration file for " CUPS_SVERSION "\n"); - cupsFilePrintf(fp, "# Written by cupsd on %s\n", temp); + cupsFilePrintf(fp, "# Written by cupsd\n"); cupsFilePuts(fp, "# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING\n"); /* diff --git a/scheduler/subscriptions.c b/scheduler/subscriptions.c index b2abf14ee..bf36ced4e 100644 --- a/scheduler/subscriptions.c +++ b/scheduler/subscriptions.c @@ -1085,7 +1085,7 @@ cupsdSaveAllSubscriptions(void) strftime(temp, sizeof(temp) - 1, "%Y-%m-%d %H:%M", curdate); cupsFilePuts(fp, "# Subscription configuration file for " CUPS_SVERSION "\n"); - cupsFilePrintf(fp, "# Written by cupsd on %s\n", temp); + cupsFilePrintf(fp, "# Written by cupsd\n"); cupsFilePrintf(fp, "NextSubscriptionId %d\n", NextSubscriptionId); -- cgit v1.2.3 From 9da2c1b91d2bfffd9ee2f1511fcf64533c8764f6 Mon Sep 17 00:00:00 2001 From: Kenshi Muto Date: Tue, 9 Aug 2016 18:11:33 +0200 Subject: Do not write VCS tags into installed conffiles Bug: http://www.cups.org/str.php?L2369 Origin: vendor Author: Didier Raboud Last-Update: 2014-01-16 Patch-Name: removecvstag.patch --- conf/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conf/Makefile b/conf/Makefile index 4302ebac9..36ab37301 100644 --- a/conf/Makefile +++ b/conf/Makefile @@ -73,8 +73,12 @@ install-data: $(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(SERVERROOT)/$$file.N ; \ else \ $(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(SERVERROOT) ; \ + grep -v "\$$Id[:\$$]" $(SERVERROOT)/$$file > $(SERVERROOT)/$$file.n ; \ + mv $(SERVERROOT)/$$file.n $(SERVERROOT)/$$file ; \ fi ; \ $(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(DATADIR)/$$file.default; \ + grep -v "\$$Id[:\$$]" $(DATADIR)/$$file.default > $(DATADIR)/$$file.default.n ; \ + mv $(DATADIR)/$$file.default.n $(DATADIR)/$$file.default ; \ done $(INSTALL_DIR) -m 755 $(DATADIR)/mime for file in $(REPLACE); do \ -- cgit v1.2.3 From 4fbb56d0592ec5a202fdaf3c2f656349dbf074c3 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Tue, 9 Aug 2016 18:11:34 +0200 Subject: Rename the systemd service file from org.cups.cups.* to cups.* Patch-Name: rename-systemd-units.patch --- scheduler/org.cups.cups-lpd.socket | 2 +- scheduler/org.cups.cupsd.path.in | 2 +- scheduler/org.cups.cupsd.service.in | 2 +- scheduler/org.cups.cupsd.socket.in | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scheduler/org.cups.cups-lpd.socket b/scheduler/org.cups.cups-lpd.socket index ed23f9dfd..eb8445905 100644 --- a/scheduler/org.cups.cups-lpd.socket +++ b/scheduler/org.cups.cups-lpd.socket @@ -1,6 +1,6 @@ [Unit] Description=CUPS LPD Server Socket -PartOf=org.cups.cups-lpd.service +PartOf=cups-lpd.service [Socket] ListenStream=515 diff --git a/scheduler/org.cups.cupsd.path.in b/scheduler/org.cups.cupsd.path.in index 0f1cc46f2..7c8509fa6 100644 --- a/scheduler/org.cups.cupsd.path.in +++ b/scheduler/org.cups.cupsd.path.in @@ -1,6 +1,6 @@ [Unit] Description=CUPS Scheduler -PartOf=org.cups.cupsd.service +PartOf=cups.service [Path] PathExists=@CUPS_CACHEDIR@/org.cups.cupsd diff --git a/scheduler/org.cups.cupsd.service.in b/scheduler/org.cups.cupsd.service.in index f2afa1124..3c273612a 100644 --- a/scheduler/org.cups.cupsd.service.in +++ b/scheduler/org.cups.cupsd.service.in @@ -8,5 +8,5 @@ Type=simple Restart=on-failure [Install] -Also=org.cups.cupsd.socket org.cups.cupsd.path +Also=cups.socket cups.path WantedBy=printer.target diff --git a/scheduler/org.cups.cupsd.socket.in b/scheduler/org.cups.cupsd.socket.in index 613b977a6..3c37d7213 100644 --- a/scheduler/org.cups.cupsd.socket.in +++ b/scheduler/org.cups.cupsd.socket.in @@ -1,6 +1,6 @@ [Unit] Description=CUPS Scheduler -PartOf=org.cups.cupsd.service +PartOf=cups.service [Socket] ListenStream=@CUPS_DEFAULT_DOMAINSOCKET@ -- cgit v1.2.3 From d0c73e2c646a4bcc8f7f3ce7955aa68060b72aa9 Mon Sep 17 00:00:00 2001 From: Till Kampetter Date: Tue, 9 Aug 2016 18:11:35 +0200 Subject: Do not use host names for broadcasting print queues and managing print queues broadcasted from other servers by default. Many networks do not have valid host names for all machines. Bug-Ubuntu: https://bugs.launchpad.net/bugs/449586 Patch-Name: do-not-broadcast-with-hostnames.patch --- scheduler/conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/conf.c b/scheduler/conf.c index 52f2a6d35..03fc8ecd5 100644 --- a/scheduler/conf.c +++ b/scheduler/conf.c @@ -898,7 +898,7 @@ cupsdReadConfiguration(void) cupsdAddAlias(ServerAlias, temp); cupsdLogMessage(CUPSD_LOG_DEBUG, "Added auto ServerAlias %s", temp); - if (HostNameLookups || RemotePort) + if (HostNameLookups) { struct hostent *host; /* Host entry to get FQDN */ -- cgit v1.2.3 From 8e2c33e5580c44a92201c452f1d4a823cf57b694 Mon Sep 17 00:00:00 2001 From: Till Kampetter Date: Tue, 9 Aug 2016 18:11:36 +0200 Subject: CUPS removes the "(recommended)" comments of the NickNames of Foomatic PPDs when listing available PPDs. This patch removes this removal action. Last-Update: 2015-02-10 Patch-Name: reactivate_recommended_driver.patch --- scheduler/cups-driverd.cxx | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/scheduler/cups-driverd.cxx b/scheduler/cups-driverd.cxx index 45e6e6557..3e9757146 100644 --- a/scheduler/cups-driverd.cxx +++ b/scheduler/cups-driverd.cxx @@ -246,7 +246,6 @@ add_ppd(const char *filename, /* I - PPD filename */ const char *scheme) /* I - PPD scheme */ { ppd_info_t *ppd; /* PPD */ - char *recommended; /* Foomatic driver string */ /* @@ -284,15 +283,6 @@ add_ppd(const char *filename, /* I - PPD filename */ strlcpy(ppd->record.device_id, device_id, sizeof(ppd->record.device_id)); strlcpy(ppd->record.scheme, scheme, sizeof(ppd->record.scheme)); - /* - * Strip confusing (and often wrong) "recommended" suffix added by - * Foomatic drivers... - */ - - if ((recommended = strstr(ppd->record.make_and_model, - " (recommended)")) != NULL) - *recommended = '\0'; - /* * Add the PPD to the PPD arrays... */ -- cgit v1.2.3 From 7f79135753e153d40f07e3cc1f95c1f7d1899e4c Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Tue, 9 Aug 2016 18:11:38 +0200 Subject: Make log files readable to group "adm", if present. Bug-Ubuntu: https://launchpad.net/bugs/345953 Last-Update: 2015-02-10 Patch-Name: logfiles_adm_readable.patch --- scheduler/log.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scheduler/log.c b/scheduler/log.c index 5dbb0ba7e..abc1dd865 100644 --- a/scheduler/log.c +++ b/scheduler/log.c @@ -24,6 +24,7 @@ # include #endif /* HAVE_ASL_H */ #include +#include /* @@ -113,6 +114,7 @@ cupsdCheckLogFile(cups_file_t **lf, /* IO - Log file */ filename[1024], /* Formatted log filename */ *ptr; /* Pointer into filename */ const char *logptr; /* Pointer into log filename */ + struct group *loggrp; /* Group entry of log filename */ /* @@ -132,6 +134,11 @@ cupsdCheckLogFile(cups_file_t **lf, /* IO - Log file */ return (1); } + /* + * Use adm group if possible, fall back to Group + */ + loggrp = getgrnam("adm"); + /* * Format the filename as needed... */ @@ -244,7 +251,7 @@ cupsdCheckLogFile(cups_file_t **lf, /* IO - Log file */ * Change ownership and permissions of non-device logs... */ - fchown(cupsFileNumber(*lf), RunUser, Group); + fchown(cupsFileNumber(*lf), RunUser, loggrp ? loggrp->gr_gid : Group); fchmod(cupsFileNumber(*lf), LogFilePerm); } } @@ -287,7 +294,7 @@ cupsdCheckLogFile(cups_file_t **lf, /* IO - Log file */ * Change ownership and permissions of non-device logs... */ - fchown(cupsFileNumber(*lf), RunUser, Group); + fchown(cupsFileNumber(*lf), RunUser, loggrp ? loggrp->gr_gid : Group); fchmod(cupsFileNumber(*lf), LogFilePerm); } -- cgit v1.2.3 From b30fef90d7bb5fe6f8737a264a22a7f2384adb11 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Tue, 9 Aug 2016 18:11:40 +0200 Subject: Deactivate CUPS' own log rotating as the system already provides a more sophisticated log rotating Last-Update: 2015-02-10 Patch-Name: default_log_settings.patch --- conf/cupsd.conf.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conf/cupsd.conf.in b/conf/cupsd.conf.in index ab37ca68c..78189e535 100644 --- a/conf/cupsd.conf.in +++ b/conf/cupsd.conf.in @@ -8,6 +8,10 @@ LogLevel @CUPS_LOG_LEVEL@ @CUPS_PAGE_LOG_FORMAT@ +# Deactivate CUPS' internal logrotating, as we provide a better one, especially +# LogLevel debug2 gets usable now +MaxLogSize 0 + # Only listen for connections from the local machine. Listen localhost:@DEFAULT_IPP_PORT@ @CUPS_LISTEN_DOMAINSOCKET@ -- cgit v1.2.3 From 7f7dd34709995b93cb1e2f2d7ef385475f83043e Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Tue, 9 Aug 2016 18:11:41 +0200 Subject: Do not mess with the permissions of cupsd.conf. Last-Update: 2015-02-10 Patch-Name: confdirperms.patch --- scheduler/conf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scheduler/conf.c b/scheduler/conf.c index 03fc8ecd5..86e37582b 100644 --- a/scheduler/conf.c +++ b/scheduler/conf.c @@ -1134,10 +1134,12 @@ cupsdReadConfiguration(void) Group, 1, 1) < 0 || cupsdCheckPermissions(ServerRoot, "ssl", 0700, RunUser, Group, 1, 0) < 0 || + /* Never alter permissions of central conffile cupsdCheckPermissions(ConfigurationFile, NULL, ConfigFilePerm, RunUser, Group, 0, 0) < 0 || cupsdCheckPermissions(CupsFilesFile, NULL, ConfigFilePerm, RunUser, Group, 0, 0) < 0 || + */ cupsdCheckPermissions(ServerRoot, "classes.conf", 0600, RunUser, Group, 0, 0) < 0 || cupsdCheckPermissions(ServerRoot, "printers.conf", 0600, RunUser, -- cgit v1.2.3 From 1d1724494b47d79f49729a26fa6df1bbb8ad593c Mon Sep 17 00:00:00 2001 From: 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 57d962058..17273eee3 100644 --- a/cups/ipp.c +++ b/cups/ipp.c @@ -2739,6 +2739,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; jvalue_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. @@ -3085,6 +3199,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; -- cgit v1.2.3 From 3029e559bb41890f0c9a7cc2efa73687772f39b9 Mon Sep 17 00:00:00 2001 From: Till Kampetter Date: Tue, 9 Aug 2016 18:11:43 +0200 Subject: Show compile command lines Patch-Name: show-compile-command-lines.patch --- Makedefs.in | 1 - 1 file changed, 1 deletion(-) diff --git a/Makedefs.in b/Makedefs.in index 7c43a2aca..94428658f 100644 --- a/Makedefs.in +++ b/Makedefs.in @@ -257,7 +257,6 @@ USBQUIRKS = @USBQUIRKS@ # Rules... # -.SILENT: .SUFFIXES: .1 .1.gz .1m .1m.gz .3 .3.gz .5 .5.gz .7 .7.gz .8 .8.gz .a .c .cxx .h .man .o .gz .c.o: -- cgit v1.2.3 From 7a74f6bea31a411f6b4abad35f65e0fa6b6d027d Mon Sep 17 00:00:00 2001 From: Till Kampetter Date: Tue, 9 Aug 2016 18:11:45 +0200 Subject: Make log debug history nearly unlimited Last-Update: 2015-02-10 Patch-Name: log-debug-history-nearly-unlimited.patch --- scheduler/conf.c | 2 +- scheduler/conf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scheduler/conf.c b/scheduler/conf.c index 86e37582b..b12bda1f6 100644 --- a/scheduler/conf.c +++ b/scheduler/conf.c @@ -721,7 +721,7 @@ cupsdReadConfiguration(void) KeepAlive = TRUE; KeepAliveTimeout = DEFAULT_KEEPALIVE; ListenBackLog = SOMAXCONN; - LogDebugHistory = 200; + LogDebugHistory = 99999; LogFilePerm = CUPS_DEFAULT_LOG_FILE_PERM; LogLevel = CUPSD_LOG_WARN; LogTimeFormat = CUPSD_TIME_STANDARD; diff --git a/scheduler/conf.h b/scheduler/conf.h index 873c370e6..e8322f506 100644 --- a/scheduler/conf.h +++ b/scheduler/conf.h @@ -164,7 +164,7 @@ VAR cupsd_accesslog_t AccessLogLevel VALUE(CUPSD_ACCESSLOG_ACTIONS); /* Access log level */ VAR int ClassifyOverride VALUE(0), /* Allow overrides? */ - LogDebugHistory VALUE(200), + LogDebugHistory VALUE(99999), /* Amount of automatic debug history */ FatalErrors VALUE(CUPSD_FATAL_CONFIG), /* Which errors are fatal? */ -- cgit v1.2.3 From 9059ef12c34a6e243ddae116f3cd14236ae73d84 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Tue, 9 Aug 2016 18:11:46 +0200 Subject: Set the default for SyncOnClose to Yes Last-Update: 2015-02-10 Patch-Name: cupsd-set-default-for-SyncOnClose-to-Yes.patch --- conf/cups-files.conf.in | 2 +- doc/help/man-cups-files.conf.html | 2 +- man/cups-files.conf.man.in | 2 +- scheduler/conf.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/conf/cups-files.conf.in b/conf/cups-files.conf.in index 4a78ba615..a3d088da5 100644 --- a/conf/cups-files.conf.in +++ b/conf/cups-files.conf.in @@ -7,7 +7,7 @@ #FatalErrors @CUPS_FATAL_ERRORS@ # Do we call fsync() after writing configuration or status files? -#SyncOnClose No +#SyncOnClose Yes # Default user and group for filters/backends/helper programs; this cannot be # any user or group that resolves to ID 0 for security reasons... diff --git a/doc/help/man-cups-files.conf.html b/doc/help/man-cups-files.conf.html index 6dd442ef4..90816b8f3 100644 --- a/doc/help/man-cups-files.conf.html +++ b/doc/help/man-cups-files.conf.html @@ -144,7 +144,7 @@ The default is "/var/run/cups" or "/etc/cups" depending on the platform.
Specifies whether the scheduler calls fsync(2) after writing configuration or state files. -The default is "No". +The default is "Yes".
SystemGroup group-name [ ... group-name ]
Specifies the group(s) to use for @SYSTEM group authentication. The default contains "admin", "lpadmin", "root", "sys", and/or "system". diff --git a/man/cups-files.conf.man.in b/man/cups-files.conf.man.in index 6ac4e72d3..ce4bc8c45 100644 --- a/man/cups-files.conf.man.in +++ b/man/cups-files.conf.man.in @@ -214,7 +214,7 @@ The default is "/var/run/cups" or "/etc/cups" depending on the platform. Specifies whether the scheduler calls .BR fsync (2) after writing configuration or state files. -The default is "No". +The default is "Yes". .\"#SystemGroup .TP 5 \fBSystemGroup \fIgroup-name \fR[ ... \fIgroup-name\fR ] diff --git a/scheduler/conf.c b/scheduler/conf.c index b12bda1f6..755243170 100644 --- a/scheduler/conf.c +++ b/scheduler/conf.c @@ -735,7 +735,7 @@ cupsdReadConfiguration(void) RootCertDuration = 300; Sandboxing = CUPSD_SANDBOXING_STRICT; StrictConformance = FALSE; - SyncOnClose = FALSE; + SyncOnClose = TRUE; Timeout = DEFAULT_TIMEOUT; WebInterface = CUPS_DEFAULT_WEBIF; -- cgit v1.2.3 From b279566faab9d507015d4b9f08eb81cc280dd861 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Tue, 9 Aug 2016 18:11:47 +0200 Subject: Set default job error policy to "retry-job", since it is less confusing and a better default on most machines. . Amend documentation accordingly. Author: Didier Raboud Origin: vendor Last-Update: 2016-07-03 Patch-Name: cups-set-default-error-policy-retry-job.patch --- doc/help/man-cupsd.conf.html | 4 ++-- man/cupsd.conf.man.in | 4 ++-- scheduler/conf.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/help/man-cupsd.conf.html b/doc/help/man-cupsd.conf.html index 943895387..6046e907b 100644 --- a/doc/help/man-cupsd.conf.html +++ b/doc/help/man-cupsd.conf.html @@ -91,9 +91,9 @@ The default value is "30".
ErrorPolicy retry-current-job
Specifies that a failed print job should be retried immediately unless otherwise specified for the printer.
ErrorPolicy retry-job -
Specifies that a failed print job should be retried at a later time unless otherwise specified for the printer. +
Specifies that a failed print job should be retried at a later time unless otherwise specified for the printer. The 'retry-job' error policy is the default.
ErrorPolicy stop-printer -
Specifies that a failed print job should stop the printer unless otherwise specified for the printer. The 'stop-printer' error policy is the default. +
Specifies that a failed print job should stop the printer unless otherwise specified for the printer.
FilterLimit limit
Specifies the maximum cost of filters that are run concurrently, which can be used to minimize disk, memory, and CPU resource problems. A limit of 0 disables filter limiting. diff --git a/man/cupsd.conf.man.in b/man/cupsd.conf.man.in index 6cec33969..df2b5bbd5 100644 --- a/man/cupsd.conf.man.in +++ b/man/cupsd.conf.man.in @@ -136,10 +136,10 @@ Specifies that a failed print job should be aborted (discarded) unless otherwise Specifies that a failed print job should be retried immediately unless otherwise specified for the printer. .TP 5 \fBErrorPolicy retry-job\fR -Specifies that a failed print job should be retried at a later time unless otherwise specified for the printer. +Specifies that a failed print job should be retried at a later time unless otherwise specified for the printer. The 'retry-job' error policy is the default. .TP 5 \fBErrorPolicy stop-printer\fR -Specifies that a failed print job should stop the printer unless otherwise specified for the printer. The 'stop-printer' error policy is the default. +Specifies that a failed print job should stop the printer unless otherwise specified for the printer. .\"#FilterLimit .TP 5 \fBFilterLimit \fIlimit\fR diff --git a/scheduler/conf.c b/scheduler/conf.c index 755243170..aae7443de 100644 --- a/scheduler/conf.c +++ b/scheduler/conf.c @@ -751,7 +751,7 @@ cupsdReadConfiguration(void) cupsdSetString(&LPDConfigFile, CUPS_DEFAULT_LPD_CONFIG_FILE); cupsdSetString(&SMBConfigFile, CUPS_DEFAULT_SMB_CONFIG_FILE); - cupsdSetString(&ErrorPolicy, "stop-printer"); + cupsdSetString(&ErrorPolicy, "retry-job"); JobHistory = DEFAULT_HISTORY; JobFiles = DEFAULT_FILES; @@ -1232,8 +1232,8 @@ cupsdReadConfiguration(void) strcmp(ErrorPolicy, "retry-job") && strcmp(ErrorPolicy, "stop-printer")) { - cupsdLogMessage(CUPSD_LOG_ALERT, "Invalid ErrorPolicy \"%s\", resetting to \"stop-printer\".", ErrorPolicy); - cupsdSetString(&ErrorPolicy, "stop-printer"); + cupsdLogMessage(CUPSD_LOG_ALERT, "Invalid ErrorPolicy \"%s\", resetting to \"retry-job\".", ErrorPolicy); + cupsdSetString(&ErrorPolicy, "retry-job"); } /* -- cgit v1.2.3 From 4f009c7df705466dd6a69c087c6b548d3bc9e25a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= Date: Tue, 9 Aug 2016 18:11:48 +0200 Subject: Drop dangling references from cups-lpd.man Bug-Debian: http://bugs.debian.org/570157 Last-Update: 2015-10-02 Patch-Name: man-cups-lpd-drop-dangling-references.patch --- man/cups-lpd.man.in | 2 -- 1 file changed, 2 deletions(-) diff --git a/man/cups-lpd.man.in b/man/cups-lpd.man.in index ceb4ef4f4..c550a0872 100644 --- a/man/cups-lpd.man.in +++ b/man/cups-lpd.man.in @@ -109,9 +109,7 @@ Simply enable the .B cups-lpd service using the corresponding control program. .SH SEE ALSO -.BR cups (1), .BR cupsd (8), -.BR inetconv (1m), .BR inetd (8), .BR launchd (8), .BR xinetd (8), -- cgit v1.2.3 From d09044aada6ea3155dad431083b280d97cca8c9d Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Tue, 9 Aug 2016 18:11:49 +0200 Subject: Use dpkg-architecture in cups-config to make it architecture-independant Also filter -L/usr/lib/(triplet) out of LDFLAGS. Also strip unnecessary libs from --libs. Also launch krb5-config at runtime to avoid getting usr/lib/(triplet) from krb5-config Bug-Debian: https://bugs.debian.org/741519 Bug-Debian: https://bugs.debian.org/727058 Bug-Debian: https://bugs.debian.org/730838 Bug-Debian: https://bugs.debian.org/751157 Last-Update: 2014-06-11 Patch-Name: debianize_cups-config.patch --- cups-config.in | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cups-config.in b/cups-config.in index f0951d0e1..f37f4dfd3 100755 --- a/cups-config.in +++ b/cups-config.in @@ -20,8 +20,8 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ bindir=@bindir@ includedir=@includedir@ -libdir=@libdir@ -imagelibdir=@libdir@ +libdir=${prefix}/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH) +imagelibdir=${prefix}/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH) datarootdir=@datadir@ datadir=@datadir@ sysconfdir=@sysconfdir@ @@ -33,7 +33,8 @@ INSTALLSTATIC=@INSTALLSTATIC@ # flags for C++ compiler: CFLAGS="" LDFLAGS="@EXPORT_LDFLAGS@" -LIBS="@LIBGSSAPI@ @EXPORT_SSLLIBS@ @LIBZ@ @LIBS@" +LIBGSSAPI=`[ ! -x /usr/bin/krb5-config ] || /usr/bin/krb5-config --libs` +LIBS="$LIBGSSAPI @EXPORT_SSLLIBS@ @LIBZ@ @LIBS@" # Check for local invocation... selfdir=`dirname $0` @@ -48,7 +49,7 @@ else CFLAGS="$CFLAGS -I$includedir" fi - if test $libdir != /usr/lib -a $libdir != /usr/lib32 -a $libdir != /usr/lib64; then + if test $libdir != /usr/lib -a $libdir != /usr/lib32 -a $libdir != /usr/lib64 -a $libdir != /usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH); then LDFLAGS="$LDFLAGS -L$libdir" fi fi @@ -103,7 +104,7 @@ while test $# -gt 0; do ;; --libs) if test $static = no; then - libs="@EXTLINKCUPS@ $LIBS"; + libs="@EXTLINKCUPS@"; if test $image = yes; then libs="@EXTLINKCUPSIMAGE@ $libs" fi -- cgit v1.2.3 From 2bb9209e789dfd41dfa8266ac0cb4854860d1322 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Tue, 9 Aug 2016 18:11:49 +0200 Subject: Build mantohtml with the build architecture compiler mantohtml is run during build. Thus it needs to be built with the build architecture compiler (or execution fails). The obvious part is switching to CC_FOR_BUILD. That also depends on it not requiring any other cups components. In particular, removing uses of strlcpy and replacing host architecture- specific includes is thus needed. Bug-Debian: https://bugs.debian.org/837936 --- Makedefs.in | 1 + configure.ac | 9 +++++++++ man/Makefile | 6 ++---- man/mantohtml.c | 15 ++++++++++----- 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/Makedefs.in b/Makedefs.in index 94428658f..2bf41df5d 100644 --- a/Makedefs.in +++ b/Makedefs.in @@ -25,6 +25,7 @@ CUPS_VERSION = @CUPS_VERSION@ AR = @AR@ AWK = @AWK@ CC = @LIBTOOL_CC@ @CC@ +CC_FOR_BUILD = @CC_FOR_BUILD@ CHMOD = @CHMOD@ CXX = @LIBTOOL_CXX@ @CXX@ DSO = @DSO@ diff --git a/configure.ac b/configure.ac index 438e56ca3..95e43c15a 100644 --- a/configure.ac +++ b/configure.ac @@ -22,6 +22,15 @@ sinclude(config-scripts/cups-common.m4) sinclude(config-scripts/cups-directories.m4) sinclude(config-scripts/cups-manpages.m4) +AC_MSG_CHECKING([for build system compiler]) +if test "$cross_compiling" = yes; then + CC_FOR_BUILD=${CC_FOR_BUILD-cc} +else + CC_FOR_BUILD=${CC} +fi +AC_MSG_RESULT(${CC_FOR_BUILD}) +AC_SUBST(CC_FOR_BUILD) + sinclude(config-scripts/cups-sharedlibs.m4) sinclude(config-scripts/cups-libtool.m4) sinclude(config-scripts/cups-compiler.m4) diff --git a/man/Makefile b/man/Makefile index 4b10dffc5..3c3270ade 100644 --- a/man/Makefile +++ b/man/Makefile @@ -226,7 +226,5 @@ html: $(MAN1) $(MAN5) $(MAN7) $(MAN8) mantohtml ./mantohtml `basename $$file .$(MAN8EXT)`.man >../doc/help/man-`basename $$file .$(MAN8EXT)`.html; \ done -mantohtml: mantohtml.o ../cups/$(LIBCUPSSTATIC) - $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ mantohtml.o \ - ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) \ - $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ) +mantohtml: mantohtml.c + $(CC_FOR_BUILD) -o $@ $< diff --git a/man/mantohtml.c b/man/mantohtml.c index bf7ba5fe8..80acf5512 100644 --- a/man/mantohtml.c +++ b/man/mantohtml.c @@ -15,8 +15,10 @@ * Include necessary headers. */ -#include -#include +#include +#include +#include +#include #include @@ -815,7 +817,8 @@ main(int argc, /* I - Number of command-line args */ * Anchor for HTML output... */ - strlcpy(anchor, line + 4, sizeof(anchor)); + strncpy(anchor, line + 4, sizeof(anchor) - 1); + anchor[sizeof(anchor) - 1] = '\0'; } else if (strncmp(line, ".\\\"", 3)) { @@ -944,7 +947,8 @@ html_alternate(const char *s, /* I - String */ manfile[1024], /* Man page filename */ manurl[1024]; /* Man page URL */ - strlcpy(name, s, sizeof(name)); + strncpy(name, s, sizeof(name) - 1); + name[sizeof(name) - 1] = '\0'; if ((size_t)(end - s) < sizeof(name)) name[end - s] = '\0'; @@ -1177,7 +1181,8 @@ html_fputs(const char *s, /* I - String */ if (end[-1] == ',' || end[-1] == '.' || end[-1] == ')') end --; - strlcpy(temp, s, sizeof(temp)); + strncpy(temp, s, sizeof(temp) - 1); + temp[sizeof(temp) - 1] = '\0'; if ((size_t)(end -s) < sizeof(temp)) temp[end - s] = '\0'; -- cgit v1.2.3 From c8f1653d737433faae13fa070f8b2a2ed30528e0 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Wed, 1 Nov 2017 15:45:50 -0400 Subject: The `lp` and `lpr` commands now provide better error messages when the default printer cannot be found (Issue #5096) - berkeley/lpr.c: Use cupsLastErrorMessage() for not-found errors. - cups/dest.c: Set the last error message in cupsGetNamedDest(). - systemv/lp.c: Use cupsLastErrorMessage() for not-found errors. Bug-Debian: #870463 --- cups/dest.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/cups/dest.c b/cups/dest.c index 57a8dc95c..e91917ed2 100644 --- a/cups/dest.c +++ b/cups/dest.c @@ -1883,6 +1883,9 @@ cupsGetNamedDest(http_t *http, /* I - Connection to server or @code CUPS_HTT snprintf(filename, sizeof(filename), "%s/.cups/lpoptions", home); dest_name = cups_get_default(filename, defname, sizeof(defname), &instance); + + if (dest_name) + set_as_default = 2; } if (!dest_name) @@ -1893,6 +1896,9 @@ cupsGetNamedDest(http_t *http, /* I - Connection to server or @code CUPS_HTT snprintf(filename, sizeof(filename), "%s/lpoptions", cg->cups_serverroot); dest_name = cups_get_default(filename, defname, sizeof(defname), &instance); + + if (dest_name) + set_as_default = 3; } if (!dest_name) @@ -1901,7 +1907,8 @@ cupsGetNamedDest(http_t *http, /* I - Connection to server or @code CUPS_HTT * No locally-set default destination, ask the server... */ - op = IPP_OP_CUPS_GET_DEFAULT; + op = IPP_OP_CUPS_GET_DEFAULT; + set_as_default = 4; DEBUG_puts("1cupsGetNamedDest: Asking server for default printer..."); } @@ -1932,7 +1939,36 @@ cupsGetNamedDest(http_t *http, /* I - Connection to server or @code CUPS_HTT dest = data.dest; } else + { + switch (set_as_default) + { + default : + break; + + case 1 : /* Set from env vars */ + if (getenv("LPDEST")) + _cupsSetError(IPP_STATUS_ERROR_NOT_FOUND, _("LPDEST environment variable names default destination that does not exist."), 1); + else if (getenv("PRINTER")) + _cupsSetError(IPP_STATUS_ERROR_NOT_FOUND, _("PRINTER environment variable names default destination that does not exist."), 1); + else + _cupsSetError(IPP_STATUS_ERROR_NOT_FOUND, _("No default destination."), 1); + break; + + case 2 : /* Set from ~/.cups/lpoptions */ + _cupsSetError(IPP_STATUS_ERROR_NOT_FOUND, _("~/.cups/lpoptions file names default destination that does not exist."), 1); + break; + + case 3 : /* Set from /etc/cups/lpoptions */ + _cupsSetError(IPP_STATUS_ERROR_NOT_FOUND, _("/etc/cups/lpoptions file names default destination that does not exist."), 1); + break; + + case 4 : /* Set from server */ + _cupsSetError(IPP_STATUS_ERROR_NOT_FOUND, _("No default destination."), 1); + break; + } + return (NULL); + } } DEBUG_printf(("1cupsGetNamedDest: Got dest=%p", (void *)dest)); -- cgit v1.2.3 From d8ce1e7f130c773f37fd63f33cf85a8847d90177 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Tue, 9 Aug 2016 18:11:50 +0200 Subject: po4a infrastructure and translations for manpages. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Author: Nicolas François , Helge Kreutzmann Origin: vendor Bug-Debian: http://bugs.debian.org/478597 Patch-Name: manpage-translations.patch --- man/Makefile | 15 +++- man/Makefile.l10n | 246 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ man/de/Makefile | 7 ++ man/fr/Makefile | 7 ++ 4 files changed, 274 insertions(+), 1 deletion(-) create mode 100644 man/Makefile.l10n create mode 100644 man/de/Makefile create mode 100644 man/fr/Makefile diff --git a/man/Makefile b/man/Makefile index 3c3270ade..410c892c7 100644 --- a/man/Makefile +++ b/man/Makefile @@ -66,12 +66,18 @@ MAN8 = cupsaccept.$(MAN8EXT) \ lpmove.$(MAN8EXT) \ lpc.$(MAN8EXT) +LANGUAGES=de fr # # Make everything... # -all: $(MAN1) $(MAN5) $(MAN7) $(MAN8) +all: $(MAN1) $(MAN5) $(MAN7) $(MAN8) translations + +translations: + # Update the translations and build the translated material + po4a --previous ../debian/manpage-po4a/cups.cfg + for lang in $(LANGUAGES); do $(MAKE) -C $$lang; done # @@ -95,6 +101,11 @@ unittests: clean: $(RM) mantohtml mantohtml.o $(RM) $(MAN1) $(MAN5) $(MAN7) $(MAN8) + for lang in $(LANGUAGES); do $(MAKE) -C $$lang clean; done + # Make sure the PO files are updated and remove generated + # translations. + po4a --previous --rm-translations ../debian/manpage-po4a/cups.cfg + $(RM) ../debian/manpage-po4a/po/cups.pot # @@ -146,6 +157,7 @@ install-data: all $(RM) $(AMANDIR)/man$(MAN8DIR)/$$file.$(MAN8EXT); \ $(LN) cupsd-helper.$(MAN8EXT) $(AMANDIR)/man$(MAN8DIR)/$$file.$(MAN8EXT); \ done + for lang in $(LANGUAGES); do $(MAKE) -C $$lang install; done # @@ -194,6 +206,7 @@ uninstall: $(RM) $(AMANDIR)/man$(MAN8DIR)/reject.$(MAN8EXT) $(RM) $(AMANDIR)/man$(MAN8DIR)/cupsdisable.$(MAN8EXT) -$(RMDIR) $(AMANDIR)/man$(MAN8DIR) + for lang in $(LANGUAGES); do $(MAKE) -C $$lang uninstall; done # diff --git a/man/Makefile.l10n b/man/Makefile.l10n new file mode 100644 index 000000000..db18e023a --- /dev/null +++ b/man/Makefile.l10n @@ -0,0 +1,246 @@ +# +# Man page makefile for CUPS. +# +# Copyright 2007-2017 by Apple Inc. +# Copyright 1993-2006 by Easy Software Products. +# +# These coded instructions, statements, and computer programs are the +# property of Apple Inc. and are protected by Federal copyright +# law. Distribution and use rights are outlined in the file "LICENSE.txt" +# which should have been included with this file. If this file is +# missing or damaged, see the license at "http://www.cups.org/". +# + +include ../../Makedefs + + +# +# Man pages... +# + +MAN1 = cancel.$(MAN1EXT) \ + cups.$(MAN1EXT) \ + cups-config.$(MAN1EXT) \ + cupstestdsc.$(MAN1EXT) \ + cupstestppd.$(MAN1EXT) \ + $(IPPFIND_MAN) \ + ipptool.$(MAN1EXT) \ + lp.$(MAN1EXT) \ + lpoptions.$(MAN1EXT) \ + lpq.$(MAN1EXT) \ + lprm.$(MAN1EXT) \ + lpr.$(MAN1EXT) \ + lpstat.$(MAN1EXT) \ + ppdc.$(MAN1EXT) \ + ppdhtml.$(MAN1EXT) \ + ppdi.$(MAN1EXT) \ + ppdmerge.$(MAN1EXT) \ + ppdpo.$(MAN1EXT) +MAN5 = classes.conf.$(MAN5EXT) \ + client.conf.$(MAN5EXT) \ + cups-files.conf.$(MAN5EXT) \ + cups-snmp.conf.$(MAN5EXT) \ + cupsd.conf.$(MAN5EXT) \ + cupsd-logs.$(MAN5EXT) \ + ipptoolfile.$(MAN5EXT) \ + mailto.conf.$(MAN5EXT) \ + mime.convs.$(MAN5EXT) \ + mime.types.$(MAN5EXT) \ + ppdcfile.$(MAN5EXT) \ + printers.conf.$(MAN5EXT) \ + subscriptions.conf.$(MAN5EXT) +MAN7 = backend.$(MAN7EXT) \ + filter.$(MAN7EXT) \ + notifier.$(MAN7EXT) +MAN8 = cupsaccept.$(MAN8EXT) \ + cupsaddsmb.$(MAN8EXT) \ + cupsctl.$(MAN8EXT) \ + cupsfilter.$(MAN8EXT) \ + cups-lpd.$(MAN8EXT) \ + cups-snmp.$(MAN8EXT) \ + cupsd.$(MAN8EXT) \ + cupsd-helper.$(MAN8EXT) \ + cupsenable.$(MAN8EXT) \ + lpadmin.$(MAN8EXT) \ + lpinfo.$(MAN8EXT) \ + lpmove.$(MAN8EXT) \ + lpc.$(MAN8EXT) + +# +# Make everything... +# + +all: manpages.gz html + +# Prepare all the existing manpages, and compress them. +# But do not fail if a manpage was not generated. +manpages.gz: manpages.gz-stamp +manpages.gz-stamp: + for file in $(MAN1) $(MAN5) $(MAN7) $(MAN8); do \ + $(MAKE) $$file || true; \ + done + touch $@ + +# +# Clean all config and object files... +# + +clean: + $(RM) mantohtml mantohtml.o + $(RM) $(MAN1) $(MAN5) $(MAN7) $(MAN8) + for file in $(MAN1); do \ + $(RM) ../../doc/help/man-`basename $$file .$(MAN1EXT)`.$(LANGUAGE).html; \ + done + for file in $(MAN5); do \ + $(RM) ../../doc/help/man-`basename $$file .$(MAN5EXT)`.$(LANGUAGE).html; \ + done + for file in $(MAN7); do \ + $(RM) ../../doc/help/man-`basename $$file .$(MAN7EXT)`.$(LANGUAGE).html; \ + done + for file in $(MAN8); do \ + $(RM) ../../doc/help/man-`basename $$file .$(MAN8EXT)`.$(LANGUAGE).html; \ + done + for file in *.man.in; do \ + $(RM) `basename $$file .in`; \ + done + $(RM) manpages.gz-stamp + + +# +# Dummy depend target... +# + +depend: + + +# +# Install all targets... +# + +MANDIR := $(MANDIR)/$(LANGUAGE) +AMANDIR := $(AMANDIR)/$(LANGUAGE) + +install: all install-data install-headers install-libs install-exec + + +# +# Install data files... +# + +install-data: all + $(INSTALL_DIR) -m 755 $(MANDIR)/man1 + for file in $(wildcard $(MAN1)); do \ + echo Installing $$file in $(MANDIR)/man1...; \ + $(INSTALL_MAN) $$file $(MANDIR)/man1; \ + done + $(INSTALL_DIR) -m 755 $(MANDIR)/man5 + for file in $(wildcard $(MAN5)); do \ + echo Installing $$file in $(MANDIR)/man5...; \ + $(INSTALL_MAN) $$file $(MANDIR)/man5; \ + done + $(INSTALL_DIR) -m 755 $(MANDIR)/man7 + for file in $(wildcard $(MAN7)); do \ + echo Installing $$file in $(MANDIR)/man7...; \ + $(INSTALL_MAN) $$file $(MANDIR)/man7; \ + done + $(INSTALL_DIR) -m 755 $(AMANDIR)/man$(MAN8DIR) + for file in $(wildcard $(MAN8)); do \ + echo Installing $$file in $(AMANDIR)/man$(MAN8DIR)...; \ + $(INSTALL_MAN) $$file $(AMANDIR)/man$(MAN8DIR); \ + done + for file in accept cupsreject reject; do \ + $(RM) $(AMANDIR)/man$(MAN8DIR)/$$file.$(MAN8EXT); \ + $(LN) cupsaccept.$(MAN8EXT) $(AMANDIR)/man$(MAN8DIR)/$$file.$(MAN8EXT); \ + done + $(RM) $(AMANDIR)/man$(MAN8DIR)/cupsdisable.$(MAN8EXT) + $(LN) cupsenable.$(MAN8EXT) $(AMANDIR)/man$(MAN8DIR)/cupsdisable.$(MAN8EXT) + for file in cups-deviced cups-driverd cups-exec; do \ + $(RM) $(AMANDIR)/man$(MAN8DIR)/$$file.$(MAN8EXT); \ + $(LN) cupsd-helper.$(MAN8EXT) $(AMANDIR)/man$(MAN8DIR)/$$file.$(MAN8EXT); \ + done + + +# +# Install programs... +# + +install-exec: + + +# +# Install headers... +# + +install-headers: + + +# +# Install libraries... +# + +install-libs: + + +# +# Uninstall files... +# + +uninstall: + for file in $(MAN1); do \ + $(RM) $(MANDIR)/man1/$$file; \ + done + -$(RMDIR) $(MANDIR)/man1 + for file in $(MAN5); do \ + $(RM) $(MANDIR)/man5/$$file; \ + done + -$(RMDIR) $(MANDIR)/man5 + for file in $(MAN7); do \ + $(RM) $(MANDIR)/man7/$$file; \ + done + -$(RMDIR) $(MANDIR)/man7 + for file in $(MAN8); do \ + $(RM) $(AMANDIR)/man$(MAN8DIR)/$$file; \ + done + $(RM) $(AMANDIR)/man$(MAN8DIR)/accept.$(MAN8EXT) + $(RM) $(AMANDIR)/man$(MAN8DIR)/cupsreject.$(MAN8EXT) + $(RM) $(AMANDIR)/man$(MAN8DIR)/reject.$(MAN8EXT) + $(RM) $(AMANDIR)/man$(MAN8DIR)/cupsdisable.$(MAN8EXT) + -$(RMDIR) $(AMANDIR)/man$(MAN8DIR) + + +# +# Make html versions of man pages... +# + +MANTOHTML = ../mantohtml +html: manpages.gz $(MANTOHTML) + echo Converting man pages to HTML... + for file in $(wildcard $(MAN1)); do \ + echo " $$file..."; \ + $(MANTOHTML) `basename $$file .$(MAN1EXT)`.man >../../doc/help/man-`basename $$file .$(MAN1EXT)`.$(LANGUAGE).html; \ + done + for file in $(wildcard $(MAN5)); do \ + echo " $$file..."; \ + $(MANTOHTML) `basename $$file .$(MAN5EXT)`.man >../../doc/help/man-`basename $$file .$(MAN5EXT)`.$(LANGUAGE).html; \ + done + for file in $(wildcard $(MAN7)); do \ + echo " $$file..."; \ + $(MANTOHTML) `basename $$file .$(MAN7EXT)`.man >../../doc/help/man-`basename $$file .$(MAN7EXT)`.$(LANGUAGE).html; \ + done + for file in $(wildcard $(MAN8)); do \ + echo " $$file..."; \ + $(MANTOHTML) `basename $$file .$(MAN8EXT)`.man >../../doc/help/man-`basename $$file .$(MAN8EXT)`.$(LANGUAGE).html; \ + done + +$(MANTOHTML): $(MANTOHTML).c + $(CC_FOR_BUILD) -o $@ $< + +.SUFFIXES: .man.in .man +# Keep the generated .man because they are needed for the html rule +.PRECIOUS: %.man + +.man.in.man: + sed -e 's:@CUPS_DATADIR@:$(DATADIR):' \ + -e 's:@CUPS_SERVERROOT@:$(SERVERROOT):' \ + -e 's:@CUPS_SERVERBIN@:$(SERVERBIN):' $< > $@ + diff --git a/man/de/Makefile b/man/de/Makefile new file mode 100644 index 000000000..7c237840e --- /dev/null +++ b/man/de/Makefile @@ -0,0 +1,7 @@ +# +# Man page makefile for the Common UNIX Printing System (CUPS). +# + +LANGUAGE=de + +include ../Makefile.l10n diff --git a/man/fr/Makefile b/man/fr/Makefile new file mode 100644 index 000000000..6a50e9348 --- /dev/null +++ b/man/fr/Makefile @@ -0,0 +1,7 @@ +# +# Man page makefile for the Common UNIX Printing System (CUPS). +# + +LANGUAGE=fr + +include ../Makefile.l10n -- cgit v1.2.3 From 857d7094cec9daa47a1d44916bc4f33d6661d620 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Mon, 11 Jun 2018 19:33:52 +0200 Subject: Renumber first 2.2.8 upload as 2.2.8-1 --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index b43bcd4c8..2a87e047b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -cups (2.2.8-2) unstable; urgency=medium +cups (2.2.8-1) unstable; urgency=medium * New upstream 2.2.8 release - The scheduler allowed environment variables to be specified in the -- cgit v1.2.3 From b139236793a4cf46dad759073f46c40347d15472 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Mon, 11 Jun 2018 19:34:03 +0200 Subject: cups 2.2.8-3 Debian release --- debian/changelog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index 2a87e047b..e999f810c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +cups (2.2.8-3) unstable; urgency=medium + + * Renumber first 2.2.8 upload as 2.2.8-1; skip -2. + * Drop the "Generalize the input validation of some kinds of attributes." + revert in favour of "Fix regressions in ippValidateAttribute" from upstream + + -- Didier Raboud Mon, 11 Jun 2018 19:34:03 +0200 + cups (2.2.8-1) unstable; urgency=medium * New upstream 2.2.8 release -- cgit v1.2.3 From e00746f433f043017a63a3f4378a719d778814e5 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Mon, 18 Jun 2018 16:39:30 -0400 Subject: Fix A4 crash in Epson 24-pin driver Upstream-Bug: #5323 Debian-Bug: #901860 --- filter/rastertoepson.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/filter/rastertoepson.c b/filter/rastertoepson.c index 4efe6692b..3de491f92 100644 --- a/filter/rastertoepson.c +++ b/filter/rastertoepson.c @@ -1,7 +1,7 @@ /* * EPSON ESC/P and ESC/P2 filter for CUPS. * - * Copyright 2007-2015 by Apple Inc. + * Copyright 2007-2018 by Apple Inc. * Copyright 1993-2007 by Easy Software Products. * * These coded instructions, statements, and computer programs are the @@ -307,7 +307,7 @@ StartPage( if (DotBytes) { - if ((LineBuffers[0] = calloc((size_t)DotBytes, header->cupsWidth * (size_t)(Shingling + 1))) == NULL) + if ((LineBuffers[0] = calloc((size_t)DotBytes, (header->cupsWidth + 7) * (size_t)(Shingling + 1))) == NULL) { fputs("ERROR: Unable to allocate memory\n", stderr); exit(1); -- cgit v1.2.3 From f9a6fa8dca9dfe891b934f263392ae6557476c57 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Tue, 3 Jul 2018 07:18:20 +0200 Subject: cups 2.2.8-4 Debian release --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index e999f810c..c9005beaf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +cups (2.2.8-4) unstable; urgency=medium + + * Backport upstream patches: + - Fix A4 crash in Epson 24-pin driver (Closes: #901860) + + -- Didier Raboud Tue, 03 Jul 2018 07:18:20 +0200 + cups (2.2.8-3) unstable; urgency=medium * Renumber first 2.2.8 upload as 2.2.8-1; skip -2. -- cgit v1.2.3 From a8213d508abbac5cf60bfaee0a7acfc44a81f6cf Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Mon, 11 Jun 2018 09:37:34 -0400 Subject: Fix regressions in ippValidateAttribute (Issue #5322, Issue #5330) --- cups/ipp.c | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/cups/ipp.c b/cups/ipp.c index 714c2e522..d10e90508 100644 --- a/cups/ipp.c +++ b/cups/ipp.c @@ -5029,16 +5029,19 @@ ippValidateAttribute( break; } - if (*ptr < ' ' || *ptr == 0x7f) - { - ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad control character (PWG 5100.14 section 8.3)."), attr->name, attr->values[i].string.text); - return (0); - } - else if (*ptr) - { - ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.2)."), attr->name, attr->values[i].string.text); - return (0); - } + if (*ptr) + { + if (*ptr < ' ' || *ptr == 0x7f) + { + ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad control character (PWG 5100.14 section 8.3)."), attr->name, attr->values[i].string.text); + return (0); + } + else + { + ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.2)."), attr->name, attr->values[i].string.text); + return (0); + } + } if ((ptr - attr->values[i].string.text) > (IPP_MAX_TEXT - 1)) { @@ -5087,16 +5090,19 @@ ippValidateAttribute( break; } - if (*ptr < ' ' || *ptr == 0x7f) - { - ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad control character (PWG 5100.14 section 8.1)."), attr->name, attr->values[i].string.text); - return (0); - } - else if (*ptr) + if (*ptr) { - ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.3)."), attr->name, attr->values[i].string.text); - return (0); - } + if (*ptr < ' ' || *ptr == 0x7f) + { + ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad control character (PWG 5100.14 section 8.1)."), attr->name, attr->values[i].string.text); + return (0); + } + else + { + ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.3)."), attr->name, attr->values[i].string.text); + return (0); + } + } if ((ptr - attr->values[i].string.text) > (IPP_MAX_NAME - 1)) { -- cgit v1.2.3 From 73293216626345eb8652a7c7f9874230921653ff Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Tue, 9 Aug 2016 18:11:24 +0200 Subject: Move cupsd.conf.default from SERVERROOT to DATADIR Origin: vendor Bug: https://cups.org/str.php?L4342 Bug-Debian: http://bugs.debian.org/640124 Last-Update: 2015-02-10 Patch-Name: move-cupsd-conf-default-to-share.patch --- cgi-bin/admin.c | 6 +++++- conf/Makefile | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cgi-bin/admin.c b/cgi-bin/admin.c index f788083fb..0ba791b48 100644 --- a/cgi-bin/admin.c +++ b/cgi-bin/admin.c @@ -1630,6 +1630,7 @@ do_config_server(http_t *http) /* I - HTTP connection */ int ch; /* Character from file */ char filename[1024]; /* Filename */ const char *server_root; /* Location of config files */ + const char *data_dir; /* Location of data files */ /* @@ -1713,7 +1714,10 @@ do_config_server(http_t *http) /* I - HTTP connection */ * well... */ - strlcat(filename, ".default", sizeof(filename)); + if ((data_dir = getenv("CUPS_DATADIR")) == NULL) + data_dir = CUPS_DATADIR; + + snprintf(filename, sizeof(filename), "%s/cupsd.conf.default",data_dir); if (!stat(filename, &info) && info.st_size < (1024 * 1024) && (cupsd = cupsFileOpen(filename, "r")) != NULL) diff --git a/conf/Makefile b/conf/Makefile index e249e6069..42a123f75 100644 --- a/conf/Makefile +++ b/conf/Makefile @@ -70,7 +70,7 @@ install-data: else \ $(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(SERVERROOT) ; \ fi ; \ - $(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(SERVERROOT)/$$file.default; \ + $(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(DATADIR)/$$file.default; \ done $(INSTALL_DIR) -m 755 $(DATADIR)/mime for file in $(REPLACE); do \ @@ -118,9 +118,10 @@ install-libs: # uninstall: - for file in $(KEEP) $(REPLACE) cupsd.conf.default; do \ + for file in $(KEEP) $(REPLACE); do \ $(RM) $(SERVERROOT)/$$file; \ done + $(RM) $(DATADIR)/cupsd.conf.default -$(RMDIR) $(SERVERROOT) for file in $(REPLACE); do \ $(RM) $(DATADIR)/mime/$$file; \ -- cgit v1.2.3 From ebe345fddd26c6f15950ea6b29f920f36bc757d3 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Tue, 9 Aug 2016 18:11:25 +0200 Subject: Don't link libcups.so and libcupsimage.so against unnecessary libraries. This avoids unnecessary package dependencies for both libcups, as well as for packages using cups-config. Bug: https://www.cups.org/str.php?L4343 Bug-Debian: http://bugs.debian.org/438067 Last-Update: 2015-10-02 Patch-Name: drop_unnecessary_dependencies.patch --- Makedefs.in | 2 +- cups/Makefile | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makedefs.in b/Makedefs.in index da2ba9e9e..8ec53dc66 100644 --- a/Makedefs.in +++ b/Makedefs.in @@ -148,7 +148,7 @@ DBUS_NOTIFIER = @DBUS_NOTIFIER@ DBUS_NOTIFIERLIBS = @DBUS_NOTIFIERLIBS@ DNSSD_BACKEND = @DNSSD_BACKEND@ DSOFLAGS = -L../cups @DSOFLAGS@ -DSOLIBS = @DSOLIBS@ $(COMMONLIBS) +DSOLIBS = @DSOLIBS@ DNSSDLIBS = @DNSSDLIBS@ IPPFIND_BIN = @IPPFIND_BIN@ IPPFIND_MAN = @IPPFIND_MAN@ diff --git a/cups/Makefile b/cups/Makefile index ecb008f24..b051ccfa8 100644 --- a/cups/Makefile +++ b/cups/Makefile @@ -338,7 +338,7 @@ uninstall: libcups.so.2: $(LIBOBJS) echo Linking $@... $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) \ - $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ) + $(SSLLIBS) $(DNSSDLIBS) -lpthread $(LIBZ) -lm $(RM) `basename $@ .2` $(LN) $@ `basename $@ .2` @@ -360,7 +360,7 @@ libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER) -compatibility_version 2.0.0 \ -exported_symbols_list t.exp \ $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \ - $(COMMONLIBS) $(LIBZ) + -lpthread $(LIBZ) -lm $(RM) libcups.dylib t.exp $(LN) $@ libcups.dylib @@ -411,7 +411,7 @@ libcups2.def: $(LIBOBJS) $(IMAGEOBJS) Makefile libcupsimage.so.2: $(IMAGEOBJS) libcups.so.2 echo Linking $@... $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS) $(DSOLIBS) \ - -L../cups $(LINKCUPS) + -L../cups $(LINKCUPS) -lpthread $(RM) `basename $@ .2` $(LN) $@ `basename $@ .2` -- cgit v1.2.3 From 70bb73524bdea2c8642dae6205f3012cc0c7f713 Mon Sep 17 00:00:00 2001 From: Till Kamppeter 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 89058d285..dee031776 100644 --- a/scheduler/ipp.c +++ b/scheduler/ipp.c @@ -8711,6 +8711,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]; /* @@ -8771,6 +8776,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... */ -- cgit v1.2.3 From 0b676eee5f638ba9beefb21ecaf1e2f05491e7fb Mon Sep 17 00:00:00 2001 From: Till Kamppeter 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 0d3ee0b89..5fcc5b1cd 100644 --- a/scheduler/cups-deviced.c +++ b/scheduler/cups-deviced.c @@ -558,15 +558,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'); /* -- cgit v1.2.3 From 991d9fdce71710a1ce4041addd954a1d5f1cb443 Mon Sep 17 00:00:00 2001 From: Till Kamppeter Date: Tue, 9 Aug 2016 18:11:29 +0200 Subject: Patch to support Apple AirPrint (printing from iPhone, iPad, iPod Touch to a CUPS server) Bug-Ubuntu: https://bugs.launchpad.net/bugs/711779 Bug-Ubuntu: https://bugs.launchpad.net/bugs/1054495 Bug-Debian: http://bugs.debian.org/700961 Bug: https://cups.org/str.php?L4341 Last-Update: 2015-02-10 Patch-Name: airprint-support.patch --- conf/mime.convs.in | 3 +++ conf/mime.types | 3 +++ scheduler/conf.c | 2 +- scheduler/dirsvc.c | 6 ++++++ scheduler/printers.c | 4 +++- 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/conf/mime.convs.in b/conf/mime.convs.in index 57b459d73..e042e0129 100644 --- a/conf/mime.convs.in +++ b/conf/mime.convs.in @@ -44,6 +44,9 @@ application/postscript application/vnd.cups-postscript 66 pstops application/vnd.cups-raster image/pwg-raster 100 rastertopwg application/vnd.cups-raster image/urf 100 rastertopwg +# Needed for printing from iOS (AirPrint) clients +image/urf application/pdf 100 - + ######################################################################## # # Raw filter... diff --git a/conf/mime.types b/conf/mime.types index fcd6b6eff..ebb05257e 100644 --- a/conf/mime.types +++ b/conf/mime.types @@ -108,6 +108,9 @@ image/x-alias pix short(8,8) short(8,24) image/x-bitmap bmp string(0,BM) + !printable(2,14) image/x-icon ico +# Needed for printing from iOS (AirPrint) clients +image/urf urf string(0,UNIRAST<00>) + ######################################################################## # # Text files... diff --git a/scheduler/conf.c b/scheduler/conf.c index b51c6060c..27f7b14a8 100644 --- a/scheduler/conf.c +++ b/scheduler/conf.c @@ -745,7 +745,7 @@ cupsdReadConfiguration(void) DefaultShared = CUPS_DEFAULT_DEFAULT_SHARED; #if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) - cupsdSetString(&DNSSDSubTypes, "_cups,_print"); + cupsdSetString(&DNSSDSubTypes, "_cups,_print,_universal"); cupsdClearString(&DNSSDHostName); #endif /* HAVE_DNSSD || HAVE_AVAHI */ diff --git a/scheduler/dirsvc.c b/scheduler/dirsvc.c index ddd3701e0..fb2a30526 100644 --- a/scheduler/dirsvc.c +++ b/scheduler/dirsvc.c @@ -440,6 +440,12 @@ dnssdBuildTxtRecord( keyvalue[count ][0] = "pdl"; keyvalue[count++][1] = p->pdl ? p->pdl : "application/postscript"; + /* iOS 6 does not accept this printer as AirPrint printer if there is + no URF txt record or "URF=none", "DM3" is the minimum needed found + by try and error */ + keyvalue[count ][0] = "URF"; + keyvalue[count++][1] = "DM3"; + if (get_auth_info_required(p, air_str, sizeof(air_str))) { keyvalue[count ][0] = "air"; diff --git a/scheduler/printers.c b/scheduler/printers.c index 62e4ec195..98bd14776 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -3785,7 +3785,9 @@ add_printer_formats(cupsd_printer_t *p) /* I - Printer */ } else if (!_cups_strcasecmp(type->super, "image")) { - if (!_cups_strcasecmp(type->type, "jpeg")) + if (!_cups_strcasecmp(type->type, "urf")) + strlcat(pdl, "image/urf,", sizeof(pdl)); + else if (!_cups_strcasecmp(type->type, "jpeg")) strlcat(pdl, "image/jpeg,", sizeof(pdl)); else if (!_cups_strcasecmp(type->type, "png")) strlcat(pdl, "image/png,", sizeof(pdl)); -- cgit v1.2.3 From d90908bc36e7ae2b719a3c3a2ce0cd2af8ff348d Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Tue, 9 Aug 2016 18:11:30 +0200 Subject: Let the "snmp" backend also use manufacturer-specific MIBs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … of HP and Ricoh to obtain the device IDs of network-connected printers. This way we get more reliable information about make and model and in addition the supported page description languages, which allow one to identify whether an optional PostScript add-on is installed or for an unsupported printer which generic PPD is the best choice (requested by Ricoh). Bug: https://www.cups.org/str.php?L3552 Last-Update: 2015-02-10 Patch-Name: cups-snmp-oids-device-id-hp-ricoh.patch --- backend/snmp.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/snmp.c b/backend/snmp.c index 66ac884c6..9572822a8 100644 --- a/backend/snmp.c +++ b/backend/snmp.c @@ -154,6 +154,8 @@ static const int UriOID[] = { CUPS_OID_ppmPortServiceNameOrURI, 1, 1, -1 }; static const int LexmarkProductOID[] = { 1,3,6,1,4,1,641,2,1,2,1,2,1,-1 }; static const int LexmarkProductOID2[] = { 1,3,6,1,4,1,674,10898,100,2,1,2,1,2,1,-1 }; static const int LexmarkDeviceIdOID[] = { 1,3,6,1,4,1,641,2,1,2,1,3,1,-1 }; +static const int HPDeviceIdOID[] = { 1,3,6,1,4,1,11,2,3,9,1,1,7,0,-1 }; +static const int RicohDeviceIdOID[] = { 1,3,6,1,4,1,367,3,2,1,1,1,11,0,-1 }; static const int XeroxProductOID[] = { 1,3,6,1,4,1,128,2,1,3,1,2,0,-1 }; static cups_array_t *DeviceURIs = NULL; static int HostNameLookups = 0; @@ -969,9 +971,15 @@ read_snmp_response(int fd) /* I - SNMP socket file descriptor */ _cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1, packet.community, CUPS_ASN1_GET_REQUEST, DEVICE_ID, LexmarkDeviceIdOID); + _cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1, + packet.community, CUPS_ASN1_GET_REQUEST, + DEVICE_ID, RicohDeviceIdOID); _cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1, packet.community, CUPS_ASN1_GET_REQUEST, DEVICE_PRODUCT, XeroxProductOID); + _cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1, + packet.community, CUPS_ASN1_GET_REQUEST, + DEVICE_ID, HPDeviceIdOID); break; case DEVICE_DESCRIPTION : -- cgit v1.2.3 From be52c3f6b1bd706f1644a4400a37b3d187e4da8c Mon Sep 17 00:00:00 2001 From: Joey Hess 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 Patch-Name: no-conffile-timestamp.patch --- scheduler/classes.c | 2 +- scheduler/job.c | 2 +- scheduler/printers.c | 2 +- scheduler/subscriptions.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scheduler/classes.c b/scheduler/classes.c index 776e79a91..ec6357ffe 100644 --- a/scheduler/classes.c +++ b/scheduler/classes.c @@ -688,7 +688,7 @@ cupsdSaveAllClasses(void) strftime(temp, sizeof(temp) - 1, "%Y-%m-%d %H:%M", curdate); cupsFilePuts(fp, "# Class configuration file for " CUPS_SVERSION "\n"); - cupsFilePrintf(fp, "# Written by cupsd on %s\n", temp); + cupsFilePrintf(fp, "# Written by cupsd\n"); cupsFilePuts(fp, "# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING\n"); /* diff --git a/scheduler/job.c b/scheduler/job.c index 09cf34d29..bd02cd79c 100644 --- a/scheduler/job.c +++ b/scheduler/job.c @@ -2201,7 +2201,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 on %s\n", temp); + cupsFilePrintf(fp, "# Written by cupsd\n", temp); cupsFilePrintf(fp, "NextJobId %d\n", NextJobId); /* diff --git a/scheduler/printers.c b/scheduler/printers.c index 98bd14776..16f71085b 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -1471,7 +1471,7 @@ cupsdSaveAllPrinters(void) strftime(temp, sizeof(temp) - 1, "%Y-%m-%d %H:%M", curdate); cupsFilePuts(fp, "# Printer configuration file for " CUPS_SVERSION "\n"); - cupsFilePrintf(fp, "# Written by cupsd on %s\n", temp); + cupsFilePrintf(fp, "# Written by cupsd\n"); cupsFilePuts(fp, "# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING\n"); cupsFilePrintf(fp, "NextPrinterId %d\n", NextPrinterId); diff --git a/scheduler/subscriptions.c b/scheduler/subscriptions.c index 36bf29ceb..401e6c8c0 100644 --- a/scheduler/subscriptions.c +++ b/scheduler/subscriptions.c @@ -1081,7 +1081,7 @@ cupsdSaveAllSubscriptions(void) strftime(temp, sizeof(temp) - 1, "%Y-%m-%d %H:%M", curdate); cupsFilePuts(fp, "# Subscription configuration file for " CUPS_SVERSION "\n"); - cupsFilePrintf(fp, "# Written by cupsd on %s\n", temp); + cupsFilePrintf(fp, "# Written by cupsd\n"); cupsFilePrintf(fp, "NextSubscriptionId %d\n", NextSubscriptionId); -- cgit v1.2.3 From 400e93f4505e0cf4a30a61af07915cf57aa4460c Mon Sep 17 00:00:00 2001 From: Kenshi Muto Date: Tue, 9 Aug 2016 18:11:33 +0200 Subject: Do not write VCS tags into installed conffiles Bug: http://www.cups.org/str.php?L2369 Origin: vendor Author: Didier Raboud Last-Update: 2014-01-16 Patch-Name: removecvstag.patch --- conf/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conf/Makefile b/conf/Makefile index 42a123f75..db0060d75 100644 --- a/conf/Makefile +++ b/conf/Makefile @@ -69,8 +69,12 @@ install-data: $(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(SERVERROOT)/$$file.N ; \ else \ $(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(SERVERROOT) ; \ + grep -v "\$$Id[:\$$]" $(SERVERROOT)/$$file > $(SERVERROOT)/$$file.n ; \ + mv $(SERVERROOT)/$$file.n $(SERVERROOT)/$$file ; \ fi ; \ $(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(DATADIR)/$$file.default; \ + grep -v "\$$Id[:\$$]" $(DATADIR)/$$file.default > $(DATADIR)/$$file.default.n ; \ + mv $(DATADIR)/$$file.default.n $(DATADIR)/$$file.default ; \ done $(INSTALL_DIR) -m 755 $(DATADIR)/mime for file in $(REPLACE); do \ -- cgit v1.2.3 From b6c0a4cd3215f4f06ad73d67a22c2784daafed79 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Tue, 9 Aug 2016 18:11:34 +0200 Subject: Rename the systemd service file from org.cups.cups.* to cups.* Patch-Name: rename-systemd-units.patch --- scheduler/org.cups.cups-lpd.socket | 2 +- scheduler/org.cups.cupsd.path.in | 2 +- scheduler/org.cups.cupsd.service.in | 2 +- scheduler/org.cups.cupsd.socket.in | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scheduler/org.cups.cups-lpd.socket b/scheduler/org.cups.cups-lpd.socket index ed23f9dfd..eb8445905 100644 --- a/scheduler/org.cups.cups-lpd.socket +++ b/scheduler/org.cups.cups-lpd.socket @@ -1,6 +1,6 @@ [Unit] Description=CUPS LPD Server Socket -PartOf=org.cups.cups-lpd.service +PartOf=cups-lpd.service [Socket] ListenStream=515 diff --git a/scheduler/org.cups.cupsd.path.in b/scheduler/org.cups.cupsd.path.in index 0f1cc46f2..7c8509fa6 100644 --- a/scheduler/org.cups.cupsd.path.in +++ b/scheduler/org.cups.cupsd.path.in @@ -1,6 +1,6 @@ [Unit] Description=CUPS Scheduler -PartOf=org.cups.cupsd.service +PartOf=cups.service [Path] PathExists=@CUPS_CACHEDIR@/org.cups.cupsd diff --git a/scheduler/org.cups.cupsd.service.in b/scheduler/org.cups.cupsd.service.in index f2afa1124..3c273612a 100644 --- a/scheduler/org.cups.cupsd.service.in +++ b/scheduler/org.cups.cupsd.service.in @@ -8,5 +8,5 @@ Type=simple Restart=on-failure [Install] -Also=org.cups.cupsd.socket org.cups.cupsd.path +Also=cups.socket cups.path WantedBy=printer.target diff --git a/scheduler/org.cups.cupsd.socket.in b/scheduler/org.cups.cupsd.socket.in index 613b977a6..3c37d7213 100644 --- a/scheduler/org.cups.cupsd.socket.in +++ b/scheduler/org.cups.cupsd.socket.in @@ -1,6 +1,6 @@ [Unit] Description=CUPS Scheduler -PartOf=org.cups.cupsd.service +PartOf=cups.service [Socket] ListenStream=@CUPS_DEFAULT_DOMAINSOCKET@ -- cgit v1.2.3 From 2b091ed9e7506a5a65c2aa6d7f9939e4d5c5e888 Mon Sep 17 00:00:00 2001 From: Till Kampetter Date: Tue, 9 Aug 2016 18:11:35 +0200 Subject: Do not use host names for broadcasting print queues and managing print queues broadcasted from other servers by default. Many networks do not have valid host names for all machines. Bug-Ubuntu: https://bugs.launchpad.net/bugs/449586 Patch-Name: do-not-broadcast-with-hostnames.patch --- scheduler/conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/conf.c b/scheduler/conf.c index 27f7b14a8..8227a476b 100644 --- a/scheduler/conf.c +++ b/scheduler/conf.c @@ -899,7 +899,7 @@ cupsdReadConfiguration(void) cupsdAddAlias(ServerAlias, temp); cupsdLogMessage(CUPSD_LOG_DEBUG, "Added auto ServerAlias %s", temp); - if (HostNameLookups || RemotePort) + if (HostNameLookups) { struct hostent *host; /* Host entry to get FQDN */ -- cgit v1.2.3 From 83646f529a156c0cdae89a5aa3f4ca093e6817a1 Mon Sep 17 00:00:00 2001 From: Till Kampetter Date: Tue, 9 Aug 2016 18:11:36 +0200 Subject: CUPS removes the "(recommended)" comments of the NickNames of Foomatic PPDs when listing available PPDs. This patch removes this removal action. Last-Update: 2015-02-10 Patch-Name: reactivate_recommended_driver.patch --- scheduler/cups-driverd.cxx | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/scheduler/cups-driverd.cxx b/scheduler/cups-driverd.cxx index 657eee0a0..f9a142fb9 100644 --- a/scheduler/cups-driverd.cxx +++ b/scheduler/cups-driverd.cxx @@ -242,7 +242,6 @@ add_ppd(const char *filename, /* I - PPD filename */ const char *scheme) /* I - PPD scheme */ { ppd_info_t *ppd; /* PPD */ - char *recommended; /* Foomatic driver string */ /* @@ -280,15 +279,6 @@ add_ppd(const char *filename, /* I - PPD filename */ strlcpy(ppd->record.device_id, device_id, sizeof(ppd->record.device_id)); strlcpy(ppd->record.scheme, scheme, sizeof(ppd->record.scheme)); - /* - * Strip confusing (and often wrong) "recommended" suffix added by - * Foomatic drivers... - */ - - if ((recommended = strstr(ppd->record.make_and_model, - " (recommended)")) != NULL) - *recommended = '\0'; - /* * Add the PPD to the PPD arrays... */ -- cgit v1.2.3 From 531aeeb37ca12fec86817e289c874a842ba0ca8f Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Tue, 9 Aug 2016 18:11:38 +0200 Subject: Make log files readable to group "adm", if present. Bug-Ubuntu: https://launchpad.net/bugs/345953 Last-Update: 2015-02-10 Patch-Name: logfiles_adm_readable.patch --- scheduler/log.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scheduler/log.c b/scheduler/log.c index 74790dc35..46a5efacd 100644 --- a/scheduler/log.c +++ b/scheduler/log.c @@ -20,6 +20,7 @@ # include #endif /* HAVE_ASL_H */ #include +#include /* @@ -109,6 +110,7 @@ cupsdCheckLogFile(cups_file_t **lf, /* IO - Log file */ filename[1024], /* Formatted log filename */ *ptr; /* Pointer into filename */ const char *logptr; /* Pointer into log filename */ + struct group *loggrp; /* Group entry of log filename */ /* @@ -128,6 +130,11 @@ cupsdCheckLogFile(cups_file_t **lf, /* IO - Log file */ return (1); } + /* + * Use adm group if possible, fall back to Group + */ + loggrp = getgrnam("adm"); + /* * Format the filename as needed... */ @@ -240,7 +247,7 @@ cupsdCheckLogFile(cups_file_t **lf, /* IO - Log file */ * Change ownership and permissions of non-device logs... */ - fchown(cupsFileNumber(*lf), RunUser, Group); + fchown(cupsFileNumber(*lf), RunUser, loggrp ? loggrp->gr_gid : Group); fchmod(cupsFileNumber(*lf), LogFilePerm); } } @@ -283,7 +290,7 @@ cupsdCheckLogFile(cups_file_t **lf, /* IO - Log file */ * Change ownership and permissions of non-device logs... */ - fchown(cupsFileNumber(*lf), RunUser, Group); + fchown(cupsFileNumber(*lf), RunUser, loggrp ? loggrp->gr_gid : Group); fchmod(cupsFileNumber(*lf), LogFilePerm); } -- cgit v1.2.3 From 2637117feb3981677108dfc2a71fc743abff44f4 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Tue, 9 Aug 2016 18:11:40 +0200 Subject: Deactivate CUPS' own log rotating as the system already provides a more sophisticated log rotating Last-Update: 2015-02-10 Patch-Name: default_log_settings.patch --- conf/cupsd.conf.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conf/cupsd.conf.in b/conf/cupsd.conf.in index ab37ca68c..78189e535 100644 --- a/conf/cupsd.conf.in +++ b/conf/cupsd.conf.in @@ -8,6 +8,10 @@ LogLevel @CUPS_LOG_LEVEL@ @CUPS_PAGE_LOG_FORMAT@ +# Deactivate CUPS' internal logrotating, as we provide a better one, especially +# LogLevel debug2 gets usable now +MaxLogSize 0 + # Only listen for connections from the local machine. Listen localhost:@DEFAULT_IPP_PORT@ @CUPS_LISTEN_DOMAINSOCKET@ -- cgit v1.2.3 From 047ab6b7edad5ffb07d7a6866fb4baab4fec8a10 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Tue, 9 Aug 2016 18:11:41 +0200 Subject: Do not mess with the permissions of cupsd.conf. Last-Update: 2015-02-10 Patch-Name: confdirperms.patch --- scheduler/conf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scheduler/conf.c b/scheduler/conf.c index 8227a476b..046daa379 100644 --- a/scheduler/conf.c +++ b/scheduler/conf.c @@ -1135,10 +1135,12 @@ cupsdReadConfiguration(void) Group, 1, 1) < 0 || cupsdCheckPermissions(ServerRoot, "ssl", 0700, RunUser, Group, 1, 0) < 0 || + /* Never alter permissions of central conffile cupsdCheckPermissions(ConfigurationFile, NULL, ConfigFilePerm, RunUser, Group, 0, 0) < 0 || cupsdCheckPermissions(CupsFilesFile, NULL, ConfigFilePerm, RunUser, Group, 0, 0) < 0 || + */ cupsdCheckPermissions(ServerRoot, "classes.conf", 0600, RunUser, Group, 0, 0) < 0 || cupsdCheckPermissions(ServerRoot, "printers.conf", 0600, RunUser, -- cgit v1.2.3 From 976bbff65a8651e3c2532204d2b92f6cf6b1baa7 Mon Sep 17 00:00:00 2001 From: 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 d10e90508..3779e1007 100644 --- a/cups/ipp.c +++ b/cups/ipp.c @@ -2734,6 +2734,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; jvalue_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. @@ -3080,6 +3194,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; -- cgit v1.2.3 From 4679af5391515710f71ee478d605a160cff029aa Mon Sep 17 00:00:00 2001 From: Till Kampetter Date: Tue, 9 Aug 2016 18:11:43 +0200 Subject: Show compile command lines Patch-Name: show-compile-command-lines.patch --- Makedefs.in | 1 - 1 file changed, 1 deletion(-) diff --git a/Makedefs.in b/Makedefs.in index 8ec53dc66..bf633c758 100644 --- a/Makedefs.in +++ b/Makedefs.in @@ -253,7 +253,6 @@ USBQUIRKS = @USBQUIRKS@ # Rules... # -.SILENT: .SUFFIXES: .1 .1.gz .1m .1m.gz .3 .3.gz .5 .5.gz .7 .7.gz .8 .8.gz .a .c .cxx .h .man .o .gz .c.o: -- cgit v1.2.3 From 84739bc12af8148a1fa59c1f8032283dc046755c Mon Sep 17 00:00:00 2001 From: Till Kampetter Date: Tue, 9 Aug 2016 18:11:45 +0200 Subject: Make log debug history nearly unlimited Last-Update: 2015-02-10 Patch-Name: log-debug-history-nearly-unlimited.patch --- scheduler/conf.c | 2 +- scheduler/conf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scheduler/conf.c b/scheduler/conf.c index 046daa379..4921d8ca4 100644 --- a/scheduler/conf.c +++ b/scheduler/conf.c @@ -721,7 +721,7 @@ cupsdReadConfiguration(void) KeepAlive = TRUE; KeepAliveTimeout = DEFAULT_KEEPALIVE; ListenBackLog = SOMAXCONN; - LogDebugHistory = 200; + LogDebugHistory = 99999; LogFilePerm = CUPS_DEFAULT_LOG_FILE_PERM; LogLevel = CUPSD_LOG_WARN; LogTimeFormat = CUPSD_TIME_STANDARD; diff --git a/scheduler/conf.h b/scheduler/conf.h index 3a5fe105d..b2289c6a6 100644 --- a/scheduler/conf.h +++ b/scheduler/conf.h @@ -160,7 +160,7 @@ VAR cupsd_accesslog_t AccessLogLevel VALUE(CUPSD_ACCESSLOG_ACTIONS); /* Access log level */ VAR int ClassifyOverride VALUE(0), /* Allow overrides? */ - LogDebugHistory VALUE(200), + LogDebugHistory VALUE(99999), /* Amount of automatic debug history */ FatalErrors VALUE(CUPSD_FATAL_CONFIG), /* Which errors are fatal? */ -- cgit v1.2.3 From fec323def9de1c4547fb3eadac739eba5195fe1b Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Tue, 9 Aug 2016 18:11:46 +0200 Subject: Set the default for SyncOnClose to Yes Last-Update: 2015-02-10 Patch-Name: cupsd-set-default-for-SyncOnClose-to-Yes.patch --- conf/cups-files.conf.in | 2 +- doc/help/man-cups-files.conf.html | 2 +- man/cups-files.conf.man.in | 2 +- scheduler/conf.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/conf/cups-files.conf.in b/conf/cups-files.conf.in index 4a78ba615..a3d088da5 100644 --- a/conf/cups-files.conf.in +++ b/conf/cups-files.conf.in @@ -7,7 +7,7 @@ #FatalErrors @CUPS_FATAL_ERRORS@ # Do we call fsync() after writing configuration or status files? -#SyncOnClose No +#SyncOnClose Yes # Default user and group for filters/backends/helper programs; this cannot be # any user or group that resolves to ID 0 for security reasons... diff --git a/doc/help/man-cups-files.conf.html b/doc/help/man-cups-files.conf.html index 131c33f01..ebf103cca 100644 --- a/doc/help/man-cups-files.conf.html +++ b/doc/help/man-cups-files.conf.html @@ -144,7 +144,7 @@ The default is "/var/run/cups" or "/etc/cups" depending on the platform.
Specifies whether the scheduler calls fsync(2) after writing configuration or state files. -The default is "No". +The default is "Yes".
SystemGroup group-name [ ... group-name ]
Specifies the group(s) to use for @SYSTEM group authentication. The default contains "admin", "lpadmin", "root", "sys", and/or "system". diff --git a/man/cups-files.conf.man.in b/man/cups-files.conf.man.in index ec4805dde..68a64a022 100644 --- a/man/cups-files.conf.man.in +++ b/man/cups-files.conf.man.in @@ -210,7 +210,7 @@ The default is "/var/run/cups" or "/etc/cups" depending on the platform. Specifies whether the scheduler calls .BR fsync (2) after writing configuration or state files. -The default is "No". +The default is "Yes". .\"#SystemGroup .TP 5 \fBSystemGroup \fIgroup-name \fR[ ... \fIgroup-name\fR ] diff --git a/scheduler/conf.c b/scheduler/conf.c index 4921d8ca4..dc025d3cd 100644 --- a/scheduler/conf.c +++ b/scheduler/conf.c @@ -735,7 +735,7 @@ cupsdReadConfiguration(void) RootCertDuration = 300; Sandboxing = CUPSD_SANDBOXING_STRICT; StrictConformance = FALSE; - SyncOnClose = FALSE; + SyncOnClose = TRUE; Timeout = DEFAULT_TIMEOUT; WebInterface = CUPS_DEFAULT_WEBIF; -- cgit v1.2.3 From 41f16ae1d5df7faeafe0842399dbba0b26438878 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Tue, 9 Aug 2016 18:11:47 +0200 Subject: Set default job error policy to "retry-job", since it is less confusing and a better default on most machines. . Amend documentation accordingly. Author: Didier Raboud Origin: vendor Last-Update: 2016-07-03 Patch-Name: cups-set-default-error-policy-retry-job.patch --- doc/help/man-cupsd.conf.html | 4 ++-- man/cupsd.conf.man.in | 4 ++-- scheduler/conf.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/help/man-cupsd.conf.html b/doc/help/man-cupsd.conf.html index 0fff92d2e..0bf33d0db 100644 --- a/doc/help/man-cupsd.conf.html +++ b/doc/help/man-cupsd.conf.html @@ -98,9 +98,9 @@ The default is typically the server's ".local" hostname.
ErrorPolicy retry-current-job
Specifies that a failed print job should be retried immediately unless otherwise specified for the printer.
ErrorPolicy retry-job -
Specifies that a failed print job should be retried at a later time unless otherwise specified for the printer. +
Specifies that a failed print job should be retried at a later time unless otherwise specified for the printer. The 'retry-job' error policy is the default.
ErrorPolicy stop-printer -
Specifies that a failed print job should stop the printer unless otherwise specified for the printer. The 'stop-printer' error policy is the default. +
Specifies that a failed print job should stop the printer unless otherwise specified for the printer.
FilterLimit limit
Specifies the maximum cost of filters that are run concurrently, which can be used to minimize disk, memory, and CPU resource problems. A limit of 0 disables filter limiting. diff --git a/man/cupsd.conf.man.in b/man/cupsd.conf.man.in index 56597bfeb..3a98efb57 100644 --- a/man/cupsd.conf.man.in +++ b/man/cupsd.conf.man.in @@ -143,10 +143,10 @@ Specifies that a failed print job should be aborted (discarded) unless otherwise Specifies that a failed print job should be retried immediately unless otherwise specified for the printer. .TP 5 \fBErrorPolicy retry-job\fR -Specifies that a failed print job should be retried at a later time unless otherwise specified for the printer. +Specifies that a failed print job should be retried at a later time unless otherwise specified for the printer. The 'retry-job' error policy is the default. .TP 5 \fBErrorPolicy stop-printer\fR -Specifies that a failed print job should stop the printer unless otherwise specified for the printer. The 'stop-printer' error policy is the default. +Specifies that a failed print job should stop the printer unless otherwise specified for the printer. .\"#FilterLimit .TP 5 \fBFilterLimit \fIlimit\fR diff --git a/scheduler/conf.c b/scheduler/conf.c index dc025d3cd..68de64f83 100644 --- a/scheduler/conf.c +++ b/scheduler/conf.c @@ -752,7 +752,7 @@ cupsdReadConfiguration(void) cupsdSetString(&LPDConfigFile, CUPS_DEFAULT_LPD_CONFIG_FILE); cupsdSetString(&SMBConfigFile, CUPS_DEFAULT_SMB_CONFIG_FILE); - cupsdSetString(&ErrorPolicy, "stop-printer"); + cupsdSetString(&ErrorPolicy, "retry-job"); JobHistory = DEFAULT_HISTORY; JobFiles = DEFAULT_FILES; @@ -1233,8 +1233,8 @@ cupsdReadConfiguration(void) strcmp(ErrorPolicy, "retry-job") && strcmp(ErrorPolicy, "stop-printer")) { - cupsdLogMessage(CUPSD_LOG_ALERT, "Invalid ErrorPolicy \"%s\", resetting to \"stop-printer\".", ErrorPolicy); - cupsdSetString(&ErrorPolicy, "stop-printer"); + cupsdLogMessage(CUPSD_LOG_ALERT, "Invalid ErrorPolicy \"%s\", resetting to \"retry-job\".", ErrorPolicy); + cupsdSetString(&ErrorPolicy, "retry-job"); } /* -- cgit v1.2.3 From 77c99ee48e04f6f2ad4e405754a9a2cec707c723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= Date: Tue, 9 Aug 2016 18:11:48 +0200 Subject: Drop dangling references from cups-lpd.man Bug-Debian: http://bugs.debian.org/570157 Last-Update: 2015-10-02 Patch-Name: man-cups-lpd-drop-dangling-references.patch --- man/cups-lpd.man.in | 2 -- 1 file changed, 2 deletions(-) diff --git a/man/cups-lpd.man.in b/man/cups-lpd.man.in index 0696b8451..34d693007 100644 --- a/man/cups-lpd.man.in +++ b/man/cups-lpd.man.in @@ -105,9 +105,7 @@ Simply enable the .B cups-lpd service using the corresponding control program. .SH SEE ALSO -.BR cups (1), .BR cupsd (8), -.BR inetconv (1m), .BR inetd (8), .BR launchd (8), .BR xinetd (8), -- cgit v1.2.3 From 2a8216a2811d0259758c5e1ecc7494563cd692aa Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Tue, 9 Aug 2016 18:11:49 +0200 Subject: Use dpkg-architecture in cups-config to make it architecture-independant Also filter -L/usr/lib/(triplet) out of LDFLAGS. Also strip unnecessary libs from --libs. Also launch krb5-config at runtime to avoid getting usr/lib/(triplet) from krb5-config Bug-Debian: https://bugs.debian.org/741519 Bug-Debian: https://bugs.debian.org/727058 Bug-Debian: https://bugs.debian.org/730838 Bug-Debian: https://bugs.debian.org/751157 Last-Update: 2014-06-11 Patch-Name: debianize_cups-config.patch --- cups-config.in | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cups-config.in b/cups-config.in index a73a70fcb..048554ad5 100755 --- a/cups-config.in +++ b/cups-config.in @@ -17,8 +17,8 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ bindir=@bindir@ includedir=@includedir@ -libdir=@libdir@ -imagelibdir=@libdir@ +libdir=${prefix}/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH) +imagelibdir=${prefix}/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH) datarootdir=@datadir@ datadir=@datadir@ sysconfdir=@sysconfdir@ @@ -30,7 +30,8 @@ INSTALLSTATIC=@INSTALLSTATIC@ # flags for C++ compiler: CFLAGS="" LDFLAGS="@EXPORT_LDFLAGS@" -LIBS="@LIBGSSAPI@ @EXPORT_SSLLIBS@ @LIBZ@ @LIBS@" +LIBGSSAPI=`[ ! -x /usr/bin/krb5-config ] || /usr/bin/krb5-config --libs` +LIBS="$LIBGSSAPI @EXPORT_SSLLIBS@ @LIBZ@ @LIBS@" # Check for local invocation... selfdir=`dirname $0` @@ -45,7 +46,7 @@ else CFLAGS="$CFLAGS -I$includedir" fi - if test $libdir != /usr/lib -a $libdir != /usr/lib32 -a $libdir != /usr/lib64; then + if test $libdir != /usr/lib -a $libdir != /usr/lib32 -a $libdir != /usr/lib64 -a $libdir != /usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH); then LDFLAGS="$LDFLAGS -L$libdir" fi fi @@ -100,7 +101,7 @@ while test $# -gt 0; do ;; --libs) if test $static = no; then - libs="@EXTLINKCUPS@ $LIBS"; + libs="@EXTLINKCUPS@"; if test $image = yes; then libs="@EXTLINKCUPSIMAGE@ $libs" fi -- cgit v1.2.3 From aa521f867562a81806d74194c88ec5d12aa67bd3 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Tue, 9 Aug 2016 18:11:49 +0200 Subject: Build mantohtml with the build architecture compiler mantohtml is run during build. Thus it needs to be built with the build architecture compiler (or execution fails). The obvious part is switching to CC_FOR_BUILD. That also depends on it not requiring any other cups components. In particular, removing uses of strlcpy and replacing host architecture- specific includes is thus needed. Bug-Debian: https://bugs.debian.org/837936 --- Makedefs.in | 1 + configure.ac | 9 +++++++++ man/Makefile | 6 ++---- man/mantohtml.c | 15 ++++++++++----- 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/Makedefs.in b/Makedefs.in index bf633c758..dccef53f2 100644 --- a/Makedefs.in +++ b/Makedefs.in @@ -21,6 +21,7 @@ CUPS_VERSION = @CUPS_VERSION@ AR = @AR@ AWK = @AWK@ CC = @LIBTOOL_CC@ @CC@ +CC_FOR_BUILD = @CC_FOR_BUILD@ CHMOD = @CHMOD@ CXX = @LIBTOOL_CXX@ @CXX@ DSO = @DSO@ diff --git a/configure.ac b/configure.ac index d3423e7e1..21ad326a8 100644 --- a/configure.ac +++ b/configure.ac @@ -19,6 +19,15 @@ sinclude(config-scripts/cups-common.m4) sinclude(config-scripts/cups-directories.m4) sinclude(config-scripts/cups-manpages.m4) +AC_MSG_CHECKING([for build system compiler]) +if test "$cross_compiling" = yes; then + CC_FOR_BUILD=${CC_FOR_BUILD-cc} +else + CC_FOR_BUILD=${CC} +fi +AC_MSG_RESULT(${CC_FOR_BUILD}) +AC_SUBST(CC_FOR_BUILD) + sinclude(config-scripts/cups-sharedlibs.m4) sinclude(config-scripts/cups-libtool.m4) sinclude(config-scripts/cups-compiler.m4) diff --git a/man/Makefile b/man/Makefile index 6911cbab0..d2c3932c3 100644 --- a/man/Makefile +++ b/man/Makefile @@ -222,7 +222,5 @@ html: $(MAN1) $(MAN5) $(MAN7) $(MAN8) mantohtml ./mantohtml `basename $$file .$(MAN8EXT)`.man >../doc/help/man-`basename $$file .$(MAN8EXT)`.html; \ done -mantohtml: mantohtml.o ../cups/$(LIBCUPSSTATIC) - $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ mantohtml.o \ - ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) \ - $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ) +mantohtml: mantohtml.c + $(CC_FOR_BUILD) -o $@ $< diff --git a/man/mantohtml.c b/man/mantohtml.c index 2a9353a9f..6223f17d2 100644 --- a/man/mantohtml.c +++ b/man/mantohtml.c @@ -11,8 +11,10 @@ * Include necessary headers. */ -#include -#include +#include +#include +#include +#include #include @@ -811,7 +813,8 @@ main(int argc, /* I - Number of command-line args */ * Anchor for HTML output... */ - strlcpy(anchor, line + 4, sizeof(anchor)); + strncpy(anchor, line + 4, sizeof(anchor) - 1); + anchor[sizeof(anchor) - 1] = '\0'; } else if (strncmp(line, ".\\\"", 3)) { @@ -940,7 +943,8 @@ html_alternate(const char *s, /* I - String */ manfile[1024], /* Man page filename */ manurl[1024]; /* Man page URL */ - strlcpy(name, s, sizeof(name)); + strncpy(name, s, sizeof(name) - 1); + name[sizeof(name) - 1] = '\0'; if ((size_t)(end - s) < sizeof(name)) name[end - s] = '\0'; @@ -1173,7 +1177,8 @@ html_fputs(const char *s, /* I - String */ if (end[-1] == ',' || end[-1] == '.' || end[-1] == ')') end --; - strlcpy(temp, s, sizeof(temp)); + strncpy(temp, s, sizeof(temp) - 1); + temp[sizeof(temp) - 1] = '\0'; if ((size_t)(end -s) < sizeof(temp)) temp[end - s] = '\0'; -- cgit v1.2.3 From 5b2e16576b1565d7265cfae4c22b307f25489058 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Tue, 9 Aug 2016 18:11:50 +0200 Subject: po4a infrastructure and translations for manpages. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Author: Nicolas François , Helge Kreutzmann Origin: vendor Bug-Debian: http://bugs.debian.org/478597 Patch-Name: manpage-translations.patch --- man/Makefile | 15 +++- man/Makefile.l10n | 246 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ man/de/Makefile | 7 ++ man/fr/Makefile | 7 ++ 4 files changed, 274 insertions(+), 1 deletion(-) create mode 100644 man/Makefile.l10n create mode 100644 man/de/Makefile create mode 100644 man/fr/Makefile diff --git a/man/Makefile b/man/Makefile index d2c3932c3..98fe135cc 100644 --- a/man/Makefile +++ b/man/Makefile @@ -62,12 +62,18 @@ MAN8 = cupsaccept.$(MAN8EXT) \ lpmove.$(MAN8EXT) \ lpc.$(MAN8EXT) +LANGUAGES=de fr # # Make everything... # -all: $(MAN1) $(MAN5) $(MAN7) $(MAN8) +all: $(MAN1) $(MAN5) $(MAN7) $(MAN8) translations + +translations: + # Update the translations and build the translated material + po4a --previous ../debian/manpage-po4a/cups.cfg + for lang in $(LANGUAGES); do $(MAKE) -C $$lang; done # @@ -91,6 +97,11 @@ unittests: clean: $(RM) mantohtml mantohtml.o $(RM) $(MAN1) $(MAN5) $(MAN7) $(MAN8) + for lang in $(LANGUAGES); do $(MAKE) -C $$lang clean; done + # Make sure the PO files are updated and remove generated + # translations. + po4a --previous --rm-translations ../debian/manpage-po4a/cups.cfg + $(RM) ../debian/manpage-po4a/po/cups.pot # @@ -142,6 +153,7 @@ install-data: all $(RM) $(AMANDIR)/man$(MAN8DIR)/$$file.$(MAN8EXT); \ $(LN) cupsd-helper.$(MAN8EXT) $(AMANDIR)/man$(MAN8DIR)/$$file.$(MAN8EXT); \ done + for lang in $(LANGUAGES); do $(MAKE) -C $$lang install; done # @@ -190,6 +202,7 @@ uninstall: $(RM) $(AMANDIR)/man$(MAN8DIR)/reject.$(MAN8EXT) $(RM) $(AMANDIR)/man$(MAN8DIR)/cupsdisable.$(MAN8EXT) -$(RMDIR) $(AMANDIR)/man$(MAN8DIR) + for lang in $(LANGUAGES); do $(MAKE) -C $$lang uninstall; done # diff --git a/man/Makefile.l10n b/man/Makefile.l10n new file mode 100644 index 000000000..db18e023a --- /dev/null +++ b/man/Makefile.l10n @@ -0,0 +1,246 @@ +# +# Man page makefile for CUPS. +# +# Copyright 2007-2017 by Apple Inc. +# Copyright 1993-2006 by Easy Software Products. +# +# These coded instructions, statements, and computer programs are the +# property of Apple Inc. and are protected by Federal copyright +# law. Distribution and use rights are outlined in the file "LICENSE.txt" +# which should have been included with this file. If this file is +# missing or damaged, see the license at "http://www.cups.org/". +# + +include ../../Makedefs + + +# +# Man pages... +# + +MAN1 = cancel.$(MAN1EXT) \ + cups.$(MAN1EXT) \ + cups-config.$(MAN1EXT) \ + cupstestdsc.$(MAN1EXT) \ + cupstestppd.$(MAN1EXT) \ + $(IPPFIND_MAN) \ + ipptool.$(MAN1EXT) \ + lp.$(MAN1EXT) \ + lpoptions.$(MAN1EXT) \ + lpq.$(MAN1EXT) \ + lprm.$(MAN1EXT) \ + lpr.$(MAN1EXT) \ + lpstat.$(MAN1EXT) \ + ppdc.$(MAN1EXT) \ + ppdhtml.$(MAN1EXT) \ + ppdi.$(MAN1EXT) \ + ppdmerge.$(MAN1EXT) \ + ppdpo.$(MAN1EXT) +MAN5 = classes.conf.$(MAN5EXT) \ + client.conf.$(MAN5EXT) \ + cups-files.conf.$(MAN5EXT) \ + cups-snmp.conf.$(MAN5EXT) \ + cupsd.conf.$(MAN5EXT) \ + cupsd-logs.$(MAN5EXT) \ + ipptoolfile.$(MAN5EXT) \ + mailto.conf.$(MAN5EXT) \ + mime.convs.$(MAN5EXT) \ + mime.types.$(MAN5EXT) \ + ppdcfile.$(MAN5EXT) \ + printers.conf.$(MAN5EXT) \ + subscriptions.conf.$(MAN5EXT) +MAN7 = backend.$(MAN7EXT) \ + filter.$(MAN7EXT) \ + notifier.$(MAN7EXT) +MAN8 = cupsaccept.$(MAN8EXT) \ + cupsaddsmb.$(MAN8EXT) \ + cupsctl.$(MAN8EXT) \ + cupsfilter.$(MAN8EXT) \ + cups-lpd.$(MAN8EXT) \ + cups-snmp.$(MAN8EXT) \ + cupsd.$(MAN8EXT) \ + cupsd-helper.$(MAN8EXT) \ + cupsenable.$(MAN8EXT) \ + lpadmin.$(MAN8EXT) \ + lpinfo.$(MAN8EXT) \ + lpmove.$(MAN8EXT) \ + lpc.$(MAN8EXT) + +# +# Make everything... +# + +all: manpages.gz html + +# Prepare all the existing manpages, and compress them. +# But do not fail if a manpage was not generated. +manpages.gz: manpages.gz-stamp +manpages.gz-stamp: + for file in $(MAN1) $(MAN5) $(MAN7) $(MAN8); do \ + $(MAKE) $$file || true; \ + done + touch $@ + +# +# Clean all config and object files... +# + +clean: + $(RM) mantohtml mantohtml.o + $(RM) $(MAN1) $(MAN5) $(MAN7) $(MAN8) + for file in $(MAN1); do \ + $(RM) ../../doc/help/man-`basename $$file .$(MAN1EXT)`.$(LANGUAGE).html; \ + done + for file in $(MAN5); do \ + $(RM) ../../doc/help/man-`basename $$file .$(MAN5EXT)`.$(LANGUAGE).html; \ + done + for file in $(MAN7); do \ + $(RM) ../../doc/help/man-`basename $$file .$(MAN7EXT)`.$(LANGUAGE).html; \ + done + for file in $(MAN8); do \ + $(RM) ../../doc/help/man-`basename $$file .$(MAN8EXT)`.$(LANGUAGE).html; \ + done + for file in *.man.in; do \ + $(RM) `basename $$file .in`; \ + done + $(RM) manpages.gz-stamp + + +# +# Dummy depend target... +# + +depend: + + +# +# Install all targets... +# + +MANDIR := $(MANDIR)/$(LANGUAGE) +AMANDIR := $(AMANDIR)/$(LANGUAGE) + +install: all install-data install-headers install-libs install-exec + + +# +# Install data files... +# + +install-data: all + $(INSTALL_DIR) -m 755 $(MANDIR)/man1 + for file in $(wildcard $(MAN1)); do \ + echo Installing $$file in $(MANDIR)/man1...; \ + $(INSTALL_MAN) $$file $(MANDIR)/man1; \ + done + $(INSTALL_DIR) -m 755 $(MANDIR)/man5 + for file in $(wildcard $(MAN5)); do \ + echo Installing $$file in $(MANDIR)/man5...; \ + $(INSTALL_MAN) $$file $(MANDIR)/man5; \ + done + $(INSTALL_DIR) -m 755 $(MANDIR)/man7 + for file in $(wildcard $(MAN7)); do \ + echo Installing $$file in $(MANDIR)/man7...; \ + $(INSTALL_MAN) $$file $(MANDIR)/man7; \ + done + $(INSTALL_DIR) -m 755 $(AMANDIR)/man$(MAN8DIR) + for file in $(wildcard $(MAN8)); do \ + echo Installing $$file in $(AMANDIR)/man$(MAN8DIR)...; \ + $(INSTALL_MAN) $$file $(AMANDIR)/man$(MAN8DIR); \ + done + for file in accept cupsreject reject; do \ + $(RM) $(AMANDIR)/man$(MAN8DIR)/$$file.$(MAN8EXT); \ + $(LN) cupsaccept.$(MAN8EXT) $(AMANDIR)/man$(MAN8DIR)/$$file.$(MAN8EXT); \ + done + $(RM) $(AMANDIR)/man$(MAN8DIR)/cupsdisable.$(MAN8EXT) + $(LN) cupsenable.$(MAN8EXT) $(AMANDIR)/man$(MAN8DIR)/cupsdisable.$(MAN8EXT) + for file in cups-deviced cups-driverd cups-exec; do \ + $(RM) $(AMANDIR)/man$(MAN8DIR)/$$file.$(MAN8EXT); \ + $(LN) cupsd-helper.$(MAN8EXT) $(AMANDIR)/man$(MAN8DIR)/$$file.$(MAN8EXT); \ + done + + +# +# Install programs... +# + +install-exec: + + +# +# Install headers... +# + +install-headers: + + +# +# Install libraries... +# + +install-libs: + + +# +# Uninstall files... +# + +uninstall: + for file in $(MAN1); do \ + $(RM) $(MANDIR)/man1/$$file; \ + done + -$(RMDIR) $(MANDIR)/man1 + for file in $(MAN5); do \ + $(RM) $(MANDIR)/man5/$$file; \ + done + -$(RMDIR) $(MANDIR)/man5 + for file in $(MAN7); do \ + $(RM) $(MANDIR)/man7/$$file; \ + done + -$(RMDIR) $(MANDIR)/man7 + for file in $(MAN8); do \ + $(RM) $(AMANDIR)/man$(MAN8DIR)/$$file; \ + done + $(RM) $(AMANDIR)/man$(MAN8DIR)/accept.$(MAN8EXT) + $(RM) $(AMANDIR)/man$(MAN8DIR)/cupsreject.$(MAN8EXT) + $(RM) $(AMANDIR)/man$(MAN8DIR)/reject.$(MAN8EXT) + $(RM) $(AMANDIR)/man$(MAN8DIR)/cupsdisable.$(MAN8EXT) + -$(RMDIR) $(AMANDIR)/man$(MAN8DIR) + + +# +# Make html versions of man pages... +# + +MANTOHTML = ../mantohtml +html: manpages.gz $(MANTOHTML) + echo Converting man pages to HTML... + for file in $(wildcard $(MAN1)); do \ + echo " $$file..."; \ + $(MANTOHTML) `basename $$file .$(MAN1EXT)`.man >../../doc/help/man-`basename $$file .$(MAN1EXT)`.$(LANGUAGE).html; \ + done + for file in $(wildcard $(MAN5)); do \ + echo " $$file..."; \ + $(MANTOHTML) `basename $$file .$(MAN5EXT)`.man >../../doc/help/man-`basename $$file .$(MAN5EXT)`.$(LANGUAGE).html; \ + done + for file in $(wildcard $(MAN7)); do \ + echo " $$file..."; \ + $(MANTOHTML) `basename $$file .$(MAN7EXT)`.man >../../doc/help/man-`basename $$file .$(MAN7EXT)`.$(LANGUAGE).html; \ + done + for file in $(wildcard $(MAN8)); do \ + echo " $$file..."; \ + $(MANTOHTML) `basename $$file .$(MAN8EXT)`.man >../../doc/help/man-`basename $$file .$(MAN8EXT)`.$(LANGUAGE).html; \ + done + +$(MANTOHTML): $(MANTOHTML).c + $(CC_FOR_BUILD) -o $@ $< + +.SUFFIXES: .man.in .man +# Keep the generated .man because they are needed for the html rule +.PRECIOUS: %.man + +.man.in.man: + sed -e 's:@CUPS_DATADIR@:$(DATADIR):' \ + -e 's:@CUPS_SERVERROOT@:$(SERVERROOT):' \ + -e 's:@CUPS_SERVERBIN@:$(SERVERBIN):' $< > $@ + diff --git a/man/de/Makefile b/man/de/Makefile new file mode 100644 index 000000000..7c237840e --- /dev/null +++ b/man/de/Makefile @@ -0,0 +1,7 @@ +# +# Man page makefile for the Common UNIX Printing System (CUPS). +# + +LANGUAGE=de + +include ../Makefile.l10n diff --git a/man/fr/Makefile b/man/fr/Makefile new file mode 100644 index 000000000..6a50e9348 --- /dev/null +++ b/man/fr/Makefile @@ -0,0 +1,7 @@ +# +# Man page makefile for the Common UNIX Printing System (CUPS). +# + +LANGUAGE=fr + +include ../Makefile.l10n -- cgit v1.2.3 From 42476b30f7654a1222f990c977125625598219eb Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Tue, 10 Jul 2018 15:29:10 +0200 Subject: Fix AppArmor cupsd sandbox bypass due to use of hard links Bug-CVE: CVE-2018-6553 Closes: #903605 Gbp-Dch: Full --- debian/local/apparmor-profile | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/local/apparmor-profile b/debian/local/apparmor-profile index 053d1c1ff..460455ed5 100644 --- a/debian/local/apparmor-profile +++ b/debian/local/apparmor-profile @@ -87,6 +87,7 @@ /usr/lib/cups/backend/http ixr, /usr/lib/cups/backend/ipp ixr, /usr/lib/cups/backend/lpd ixr, + /usr/lib/cups/backend/mdns ixr, /usr/lib/cups/backend/parallel ixr, /usr/lib/cups/backend/serial ixr, /usr/lib/cups/backend/snmp ixr, -- cgit v1.2.3 From 0d8b77ce3a3c320c0f9c3a01bf731bdf5c3fb3fd Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Mon, 18 Jun 2018 16:39:30 -0400 Subject: Fix A4 crash in Epson 24-pin driver Upstream-Bug: #5323 Debian-Bug: #901860 --- filter/rastertoepson.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/filter/rastertoepson.c b/filter/rastertoepson.c index 73e8d0600..2b14af8f6 100644 --- a/filter/rastertoepson.c +++ b/filter/rastertoepson.c @@ -1,7 +1,7 @@ /* * EPSON ESC/P and ESC/P2 filter for CUPS. * - * Copyright 2007-2015 by Apple Inc. + * Copyright 2007-2018 by Apple Inc. * Copyright 1993-2007 by Easy Software Products. * * Licensed under Apache License v2.0. See the file "LICENSE" for more information. @@ -301,7 +301,7 @@ StartPage( if (DotBytes) { - if ((LineBuffers[0] = calloc((size_t)DotBytes, header->cupsWidth * (size_t)(Shingling + 1))) == NULL) + if ((LineBuffers[0] = calloc((size_t)DotBytes, (header->cupsWidth + 7) * (size_t)(Shingling + 1))) == NULL) { fputs("ERROR: Unable to allocate memory\n", stderr); exit(1); -- cgit v1.2.3 From a5048903135d42817f8288b72038445f4c6eca9f Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Thu, 12 Jul 2018 18:48:48 +0200 Subject: cups 2.2.8-5 Debian release --- debian/changelog | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/debian/changelog b/debian/changelog index c9005beaf..51533feca 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,17 @@ +cups (2.2.8-5) unstable; urgency=high + + * CVE-2018-6553: Fix AppArmor cupsd sandbox bypass due to use of hard links + (Closes: #903605) + * All these were fixed in 2.2.8: + - CVE-2018-4180 Local Privilege Escalation to Root in dnssd Backend + (CUPS_SERVERBIN) + - CVE-2018-4181 Limited Local File Reads as Root via cupsd.conf Include + Directive + - CVE-2018-4182 cups-exec Sandbox Bypass Due to Insecure Error Handling + - CVE-2018-4183 cups-exec Sandbox Bypass Due to Profile Misconfiguration + + -- Didier Raboud Thu, 12 Jul 2018 18:48:48 +0200 + cups (2.2.8-4) unstable; urgency=medium * Backport upstream patches: -- cgit v1.2.3