diff --git a/backport-CVE-2020-10001.patch b/backport-CVE-2020-10001.patch deleted file mode 100644 index 21f82d7cd461330694218bfff6642042d26ed90b..0000000000000000000000000000000000000000 --- a/backport-CVE-2020-10001.patch +++ /dev/null @@ -1,52 +0,0 @@ -From efbea1742bd30f842fbbfb87a473e5c84f4162f9 Mon Sep 17 00:00:00 2001 -From: Michael R Sweet -Date: Mon, 1 Feb 2021 15:02:32 -0500 -Subject: [PATCH] Fix a buffer (read) overflow in ippReadIO (CVE-2020-10001) - ---- - cups/ipp.c | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/cups/ipp.c b/cups/ipp.c -index 3d52934..84b8da6 100644 ---- a/cups/ipp.c -+++ b/cups/ipp.c -@@ -2866,7 +2866,8 @@ ippReadIO(void *src, /* I - Data source */ - unsigned char *buffer, /* Data buffer */ - string[IPP_MAX_TEXT], - /* Small string buffer */ -- *bufptr; /* Pointer into buffer */ -+ *bufptr, /* Pointer into buffer */ -+ *bufend; /* End of buffer */ - ipp_attribute_t *attr; /* Current attribute */ - ipp_tag_t tag; /* Current tag */ - ipp_tag_t value_tag; /* Current value tag */ -@@ -3441,6 +3442,7 @@ ippReadIO(void *src, /* I - Data source */ - } - - bufptr = buffer; -+ bufend = buffer + n; - - /* - * text-with-language and name-with-language are composite -@@ -3454,7 +3456,7 @@ ippReadIO(void *src, /* I - Data source */ - - n = (bufptr[0] << 8) | bufptr[1]; - -- if ((bufptr + 2 + n) >= (buffer + IPP_BUF_SIZE) || n >= (int)sizeof(string)) -+ if ((bufptr + 2 + n + 2) > bufend || n >= (int)sizeof(string)) - { - _cupsSetError(IPP_STATUS_ERROR_INTERNAL, - _("IPP language length overflows value."), 1); -@@ -3481,7 +3483,7 @@ ippReadIO(void *src, /* I - Data source */ - bufptr += 2 + n; - n = (bufptr[0] << 8) | bufptr[1]; - -- if ((bufptr + 2 + n) >= (buffer + IPP_BUF_SIZE)) -+ if ((bufptr + 2 + n) > bufend) - { - _cupsSetError(IPP_STATUS_ERROR_INTERNAL, - _("IPP string length overflows value."), 1); --- -2.27.0 - diff --git a/backport-Retry-Validate-Job-once-if-needed-Issue-132.patch b/backport-Retry-Validate-Job-once-if-needed-Issue-132.patch new file mode 100644 index 0000000000000000000000000000000000000000..a677090cd91cfeebf2365003b560feb9fcace977 --- /dev/null +++ b/backport-Retry-Validate-Job-once-if-needed-Issue-132.patch @@ -0,0 +1,43 @@ +From 6e6999b1f74457b7fd6057a31f1d3606de19a05b Mon Sep 17 00:00:00 2001 +From: Michael R Sweet +Date: Fri, 9 Apr 2021 10:20:04 -0400 +Subject: [PATCH] Retry Validate-Job once, if needed (Issue #132) + +--- + CHANGES.md | 1 + + backend/ipp.c | 14 +++++++++++++- + 2 files changed, 14 insertions(+), 1 deletion(-) + +diff --git a/backend/ipp.c b/backend/ipp.c +index 63353a66d..020ab7fd4 100644 +--- a/backend/ipp.c ++++ b/backend/ipp.c +@@ -256,6 +257,7 @@ main(int argc, /* I - Number of command-line args */ + get_job_attrs = 0, /* Does printer support Get-Job-Attributes? */ + send_document = 0, /* Does printer support Send-Document? */ + validate_job = 0, /* Does printer support Validate-Job? */ ++ validate_retried = 0, /* Was Validate-Job request retried? */ + copies, /* Number of copies for job */ + copies_remaining; /* Number of copies remaining */ + const char *content_type, /* CONTENT_TYPE environment variable */ +@@ -1559,7 +1561,17 @@ main(int argc, /* I - Number of command-line args */ + ipp_status == IPP_STATUS_ERROR_BAD_REQUEST) + break; + else if (job_auth == NULL && ipp_status > IPP_STATUS_ERROR_BAD_REQUEST) ++ { ++ if (!validate_retried) ++ { ++ // Retry Validate-Job operation once, to work around known printer bug... ++ validate_retried = 1; ++ sleep(10); ++ continue; ++ } ++ + goto cleanup; ++ } + } + + /* +-- +2.26.3 + diff --git a/backport-backend-usb-libusb.c-Use-60s-timeout-for-reading-at-.patch b/backport-backend-usb-libusb.c-Use-60s-timeout-for-reading-at-.patch new file mode 100644 index 0000000000000000000000000000000000000000..71ccba9793c77ee8e2fe77989ce52cba08f5b965 --- /dev/null +++ b/backport-backend-usb-libusb.c-Use-60s-timeout-for-reading-at-.patch @@ -0,0 +1,28 @@ +From c37d71b1a31d26a4790166e2508822b18934a5c0 Mon Sep 17 00:00:00 2001 +From: Zdenek Dohnal +Date: Tue, 13 Apr 2021 15:44:14 +0200 +Subject: [PATCH] backend/usb-libusb.c: Use 60s timeout for reading at + backchannel + +Some older models malfunction if timeout is too short. +--- + CHANGES.md | 1 + + backend/usb-libusb.c | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/backend/usb-libusb.c b/backend/usb-libusb.c +index d6b0eb423..fbb0d9d89 100644 +--- a/backend/usb-libusb.c ++++ b/backend/usb-libusb.c +@@ -1704,7 +1704,7 @@ static void *read_thread(void *reference) + readstatus = libusb_bulk_transfer(g.printer->handle, + g.printer->read_endp, + readbuffer, rbytes, +- &rbytes, 250); ++ &rbytes, 60000); + if (readstatus == LIBUSB_SUCCESS && rbytes > 0) + { + fprintf(stderr, "DEBUG: Read %d bytes of back-channel data...\n", (int)rbytes); +-- +2.26.3 + diff --git a/backport-cgi-bin-ipp-var.c-Use-guest-user-for-Move-Job-when-n.patch b/backport-cgi-bin-ipp-var.c-Use-guest-user-for-Move-Job-when-n.patch new file mode 100644 index 0000000000000000000000000000000000000000..d2c07163431cfe83fbe7cc908fb774057a62ccb6 --- /dev/null +++ b/backport-cgi-bin-ipp-var.c-Use-guest-user-for-Move-Job-when-n.patch @@ -0,0 +1,16 @@ +diff --git a/cgi-bin/ipp-var.c b/cgi-bin/ipp-var.c +index 92f1501..7edc058 100644 +--- a/cgi-bin/ipp-var.c ++++ b/cgi-bin/ipp-var.c +@@ -275,10 +275,7 @@ cgiMoveJobs(http_t *http, /* I - Connection to server */ + */ + + if ((user = getenv("REMOTE_USER")) == NULL) +- { +- puts("Status: 401\n"); +- exit(0); +- } ++ user = "guest"; + + /* + * See if the user has already selected a new destination... diff --git a/backport-cups-md5passwd.c-Stub-out-httpMD5-functions.patch b/backport-cups-md5passwd.c-Stub-out-httpMD5-functions.patch new file mode 100644 index 0000000000000000000000000000000000000000..0acd3a5571592492debf2a1a30c9e9223b5a7dd9 --- /dev/null +++ b/backport-cups-md5passwd.c-Stub-out-httpMD5-functions.patch @@ -0,0 +1,120 @@ +From 3e217bff90829cf7d53ceacb553a7abaad3cb4db Mon Sep 17 00:00:00 2001 +From: Zdenek Dohnal +Date: Thu, 26 Aug 2021 15:45:40 +0200 +Subject: [PATCH] cups/md5passwd.c: Stub out httpMD5* functions + +--- + CHANGES.md | 1 + + cups/md5passwd.c | 60 +++++++++++++++++++----------------------------- + 2 files changed, 25 insertions(+), 36 deletions(-) + +diff --git a/cups/md5passwd.c b/cups/md5passwd.c +index 9af5de23c..5c9a64e06 100644 +--- a/cups/md5passwd.c ++++ b/cups/md5passwd.c +@@ -19,6 +19,9 @@ + /* + * 'httpMD5()' - Compute the MD5 sum of the username:group:password. + * ++ * The function was used for HTTP Digest authentication. Since CUPS 2.4.0 ++ * it produces an empty string. Please use @link cupsDoAuthentication@ instead. ++ * + * @deprecated@ + */ + +@@ -28,22 +31,13 @@ httpMD5(const char *username, /* I - User name */ + const char *passwd, /* I - Password string */ + char md5[33]) /* O - MD5 string */ + { +- unsigned char sum[16]; /* Sum data */ +- char line[256]; /* Line to sum */ +- +- +- /* +- * Compute the MD5 sum of the user name, group name, and password. +- */ ++ (void)username; ++ (void)realm; ++ (void)passwd; + +- snprintf(line, sizeof(line), "%s:%s:%s", username, realm, passwd); +- cupsHashData("md5", (unsigned char *)line, strlen(line), sum, sizeof(sum)); ++ md5[0] = '\0'; + +- /* +- * Return the sum... +- */ +- +- return ((char *)cupsHashString(sum, sizeof(sum), md5, 33)); ++ return (NULL); + } + + +@@ -52,6 +46,9 @@ httpMD5(const char *username, /* I - User name */ + * with the server-supplied nonce value, method, and + * request-uri. + * ++ * The function was used for HTTP Digest authentication. Since CUPS 2.4.0 ++ * it produces an empty string. Please use @link cupsDoAuthentication@ instead. ++ * + * @deprecated@ + */ + +@@ -61,35 +58,22 @@ httpMD5Final(const char *nonce, /* I - Server nonce value */ + const char *resource, /* I - Resource path */ + char md5[33]) /* IO - MD5 sum */ + { +- unsigned char sum[16]; /* Sum data */ +- char line[1024]; /* Line of data */ +- char a2[33]; /* Hash of method and resource */ +- ++ (void)nonce; ++ (void)method; ++ (void)resource; + +- /* +- * First compute the MD5 sum of the method and resource... +- */ ++ md5[0] = '\0'; + +- snprintf(line, sizeof(line), "%s:%s", method, resource); +- cupsHashData("md5", (unsigned char *)line, strlen(line), sum, sizeof(sum)); +- cupsHashString(sum, sizeof(sum), a2, sizeof(a2)); +- +- /* +- * Then combine A1 (MD5 of username, realm, and password) with the nonce +- * and A2 (method + resource) values to get the final MD5 sum for the +- * request... +- */ +- +- snprintf(line, sizeof(line), "%s:%s:%s", md5, nonce, a2); +- cupsHashData("md5", (unsigned char *)line, strlen(line), sum, sizeof(sum)); +- +- return ((char *)cupsHashString(sum, sizeof(sum), md5, 33)); ++ return (NULL); + } + + + /* + * 'httpMD5String()' - Convert an MD5 sum to a character string. + * ++ * The function was used for HTTP Digest authentication. Since CUPS 2.4.0 ++ * it produces an empty string. Please use @link cupsDoAuthentication@ instead. ++ * + * @deprecated@ + */ + +@@ -98,5 +82,9 @@ httpMD5String(const unsigned char *sum, /* I - MD5 sum data */ + char md5[33]) + /* O - MD5 sum in hex */ + { +- return ((char *)cupsHashString(sum, 16, md5, 33)); ++ (void)sum; ++ ++ md5[0] = '\0'; ++ ++ return (NULL); + } +-- +2.31.1 + diff --git a/backport-cups.service.in-Add-SYSTEMD_WANTED_BY-variable.patch b/backport-cups.service.in-Add-SYSTEMD_WANTED_BY-variable.patch new file mode 100644 index 0000000000000000000000000000000000000000..8282477eb4a4806c8abc7fd1d4f7072eefef80c6 --- /dev/null +++ b/backport-cups.service.in-Add-SYSTEMD_WANTED_BY-variable.patch @@ -0,0 +1,33 @@ +diff --git a/config-scripts/cups-defaults.m4 b/config-scripts/cups-defaults.m4 +index 9e05bd4..505d272 100644 +--- a/config-scripts/cups-defaults.m4 ++++ b/config-scripts/cups-defaults.m4 +@@ -8,6 +8,9 @@ dnl Licensed under Apache License v2.0. See the file "LICENSE" for more + dnl information. + dnl + ++dnl Set a default systemd WantedBy directive ++SYSTEMD_WANTED_BY="printers.target" ++ + dnl Default languages... + LANGUAGES="`ls -1 locale/cups_*.po 2>/dev/null | sed -e '1,$s/locale\/cups_//' -e '1,$s/\.po//' | tr '\n' ' '`" + +@@ -461,3 +464,8 @@ esac + + AC_SUBST(CUPS_WEBIF) + AC_DEFINE_UNQUOTED(CUPS_DEFAULT_WEBIF, $CUPS_DEFAULT_WEBIF) ++ ++AS_IF([test $CUPS_WEBIF = Yes || test $CUPS_BROWSING = Yes], [ ++ SYSTEMD_WANTED_BY="$SYSTEMD_WANTED_BY multi-user.target"], [ ++ ]) ++AC_SUBST([SYSTEMD_WANTED_BY]) +diff --git a/scheduler/cups.service.in b/scheduler/cups.service.in +index baff51b..f0d7e2f 100644 +--- a/scheduler/cups.service.in ++++ b/scheduler/cups.service.in +@@ -11,4 +11,4 @@ Restart=on-failure + + [Install] + Also=cups.socket cups.path +-WantedBy=printer.target ++WantedBy=@SYSTEMD_WANTED_BY@ diff --git a/backport-scheduler-job.c-use-gziptoany-for-raw-files-not-just.patch b/backport-scheduler-job.c-use-gziptoany-for-raw-files-not-just.patch new file mode 100644 index 0000000000000000000000000000000000000000..025361f71afd0f736b075027f8d24ae44a2389a1 --- /dev/null +++ b/backport-scheduler-job.c-use-gziptoany-for-raw-files-not-just.patch @@ -0,0 +1,38 @@ +From 08e9b6e1f8497a8159d6bd7cd6dc96ae79a2e704 Mon Sep 17 00:00:00 2001 +From: Bryan Mason +Date: Thu, 15 Jul 2021 16:26:27 -0700 +Subject: [PATCH] scheduler/job.c: use gziptoany for raw files (not just raw + printers) + +--- + scheduler/job.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/scheduler/job.c b/scheduler/job.c +index d8c2efcc6..b448acda5 100644 +--- a/scheduler/job.c ++++ b/scheduler/job.c +@@ -501,6 +501,7 @@ cupsdContinueJob(cupsd_job_t *job) /* I - Job */ + int backroot; /* Run backend as root? */ + int pid; /* Process ID of new filter process */ + int banner_page; /* 1 if banner page, 0 otherwise */ ++ int raw_file; /* 1 if file type is vnd.cups-raw */ + int filterfds[2][2] = { { -1, -1 }, { -1, -1 } }; + /* Pipes used between filters */ + int envc; /* Number of environment variables */ +@@ -746,8 +747,11 @@ cupsdContinueJob(cupsd_job_t *job) /* I - Job */ + * Add decompression/raw filter as needed... + */ + ++ raw_file = !strcmp(job->filetypes[job->current_file]->super, "application") && ++ !strcmp(job->filetypes[job->current_file]->type, "vnd.cups-raw"); ++ + if ((job->compressions[job->current_file] && (!job->printer->remote || job->num_files == 1)) || +- (!job->printer->remote && job->printer->raw && job->num_files > 1)) ++ (!job->printer->remote && (job->printer->raw || raw_file) && job->num_files > 1)) + { + /* + * Add gziptoany filter to the front of the list... +-- +2.31.1 + diff --git a/v2.3.3.tar.gz b/cups-2.3.3op2-source.tar.gz similarity index 51% rename from v2.3.3.tar.gz rename to cups-2.3.3op2-source.tar.gz index b6687b8e4c82343769e0503e014d6798ef22f83b..20c392c0b9cb176632e3ca48e42fb4c1d86af00d 100644 Binary files a/v2.3.3.tar.gz and b/cups-2.3.3op2-source.tar.gz differ diff --git a/cups-autostart-when-enabled.patch b/cups-autostart-when-enabled.patch deleted file mode 100644 index ea6a2c3d370888d42d68ede4625bba210fd5feb4..0000000000000000000000000000000000000000 --- a/cups-autostart-when-enabled.patch +++ /dev/null @@ -1,10 +0,0 @@ -diff --git a/scheduler/org.cups.cupsd.service.in b/scheduler/org.cups.cupsd.service.in -index bf308a5..add238b 100644 ---- a/scheduler/org.cups.cupsd.service.in -+++ b/scheduler/org.cups.cupsd.service.in -@@ -10,4 +10,4 @@ Restart=on-failure - - [Install] - Also=cups.socket cups.path --WantedBy=printer.target -+WantedBy=printer.target multi-user.target diff --git a/cups-cleanfiles.patch b/cups-cleanfiles.patch new file mode 100644 index 0000000000000000000000000000000000000000..05437f3ad3b840f73c693d2a8e2b0c50f30fb3a8 --- /dev/null +++ b/cups-cleanfiles.patch @@ -0,0 +1,16 @@ +diff --git a/scheduler/main.c b/scheduler/main.c +index e1fa357..53ca94a 100644 +--- a/scheduler/main.c ++++ b/scheduler/main.c +@@ -1760,6 +1760,11 @@ select_timeout(int fds) /* I - Number of descriptors returned */ + /* + * Check for any job activity... + */ ++ if (JobHistoryUpdate && timeout > JobHistoryUpdate) ++ { ++ timeout = JobHistoryUpdate; ++ why = "update job history"; ++ } + + for (job = (cupsd_job_t *)cupsArrayFirst(ActiveJobs); + job; diff --git a/cups-deprecate-drivers.patch b/cups-deprecate-drivers.patch new file mode 100644 index 0000000000000000000000000000000000000000..f0fb42001d58b3229c8eeccc2ddae197a88a71e1 --- /dev/null +++ b/cups-deprecate-drivers.patch @@ -0,0 +1,164 @@ +diff --git a/cgi-bin/admin.c b/cgi-bin/admin.c +index 02b9d9d..669cb65 100644 +--- a/cgi-bin/admin.c ++++ b/cgi-bin/admin.c +@@ -619,6 +619,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */ + *oldinfo; /* Old printer information */ + const cgi_file_t *file; /* Uploaded file, if any */ + const char *var; /* CGI variable */ ++ char *ppd_name = NULL; /* Pointer to PPD name */ + char uri[HTTP_MAX_URI], /* Device or printer URI */ + *uriptr, /* Pointer into URI */ + evefile[1024] = ""; /* IPP Everywhere PPD file */ +@@ -1124,12 +1125,12 @@ do_am_printer(http_t *http, /* I - HTTP connection */ + + if (!file) + { +- var = cgiGetVariable("PPD_NAME"); +- if (!strcmp(var, "everywhere")) ++ ppd_name = cgiGetVariable("PPD_NAME"); ++ if (!strcmp(ppd_name, "everywhere")) + get_printer_ppd(cgiGetVariable("DEVICE_URI"), evefile, sizeof(evefile)); +- else if (strcmp(var, "__no_change__")) ++ else if (strcmp(ppd_name, "__no_change__")) + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "ppd-name", +- NULL, var); ++ NULL, ppd_name); + } + + ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_TEXT, "printer-location", +@@ -1219,7 +1220,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */ + + cgiCopyTemplateLang("printer-modified.tmpl"); + } +- else ++ else if (ppd_name && (strcmp(ppd_name, "everywhere") == 0 || strstr(ppd_name, "driverless"))) + { + /* + * Set the printer options... +@@ -1229,6 +1230,16 @@ do_am_printer(http_t *http, /* I - HTTP connection */ + do_set_options(http, 0); + return; + } ++ else ++ { ++ /* ++ * If we don't have an everywhere model, show printer-added ++ * template with warning about drivers going away... ++ */ ++ ++ cgiStartHTML(title); ++ cgiCopyTemplateLang("printer-added.tmpl"); ++ } + + cgiEndHTML(); + } +diff --git a/scheduler/printers.c b/scheduler/printers.c +index 3bfe4a8..248bdba 100644 +--- a/scheduler/printers.c ++++ b/scheduler/printers.c +@@ -950,6 +950,8 @@ cupsdLoadAllPrinters(void) + *value, /* Pointer to value */ + *valueptr; /* Pointer into value */ + cupsd_printer_t *p; /* Current printer */ ++ int found_raw = 0; /* Flag whether raw queue is installed */ ++ int found_driver = 0; /* Flag whether queue with classic driver is installed */ + + + /* +@@ -1025,6 +1027,30 @@ cupsdLoadAllPrinters(void) + + cupsdSetPrinterAttrs(p); + ++ if ((p->device_uri && strncmp(p->device_uri, "ipp:", 4) && strncmp(p->device_uri, "ipps:", 5) && strncmp(p->device_uri, "implicitclass:", 14)) || ++ !p->make_model || ++ (p->make_model && strstr(p->make_model, "IPP Everywhere") == NULL && strstr(p->make_model, "driverless") == NULL)) ++ { ++ /* ++ * Warn users about printer drivers and raw queues will be deprecated. ++ * It will warn users in the following scenarios: ++ * - the queue doesn't use ipp, ipps or implicitclass backend, which means ++ * it doesn't communicate via IPP and is raw or uses a driver for sure ++ * - the queue doesn't have make_model - it is raw ++ * - the queue uses a correct backend, but the model is not IPP Everywhere/driverless ++ */ ++ if (!p->make_model) ++ { ++ cupsdLogMessage(CUPSD_LOG_DEBUG, "Queue %s is a raw queue, which is deprecated.", p->name); ++ found_raw = 1; ++ } ++ else ++ { ++ cupsdLogMessage(CUPSD_LOG_DEBUG, "Queue %s uses a printer driver, which is deprecated.", p->name); ++ found_driver = 1; ++ } ++ } ++ + if (strncmp(p->device_uri, "file:", 5) && p->state != IPP_PRINTER_STOPPED) + { + /* +@@ -1415,6 +1441,12 @@ cupsdLoadAllPrinters(void) + } + } + ++ if (found_raw) ++ cupsdLogMessage(CUPSD_LOG_WARN, "Raw queues are deprecated and will stop working in a future version of CUPS. See https://github.com/OpenPrinting/cups/issues/103"); ++ ++ if (found_driver) ++ cupsdLogMessage(CUPSD_LOG_WARN, "Printer drivers are deprecated and will stop working in a future version of CUPS. See https://github.com/OpenPrinting/cups/issues/103"); ++ + cupsFileClose(fp); + } + +diff --git a/templates/choose-model.tmpl b/templates/choose-model.tmpl +index e916cf8..9c9b71f 100644 +--- a/templates/choose-model.tmpl ++++ b/templates/choose-model.tmpl +@@ -39,7 +39,7 @@ + + + +diff --git a/templates/printer-added.tmpl b/templates/printer-added.tmpl +index 0ccf6d3..9ebc835 100644 +--- a/templates/printer-added.tmpl ++++ b/templates/printer-added.tmpl +@@ -1,4 +1,15 @@ +-

Add Printer

++

Add Printer {printer_name}

+ +

Printer {printer_name} has been added + successfully. ++ ++

++Note:Printer drivers and raw queues are deprecated and will stop working in a future version of CUPS. ++
++ ++
++ ++ ++ ++ ++
+diff --git a/test/run-stp-tests.sh b/test/run-stp-tests.sh +index 4498a8c..8776874 100755 +--- a/test/run-stp-tests.sh ++++ b/test/run-stp-tests.sh +@@ -1049,10 +1049,10 @@ fi + + # Warning log messages + count=`$GREP '^W ' $BASE/log/error_log | $GREP -v CreateProfile | $GREP -v 'libusb error' | $GREP -v ColorManager | $GREP -v 'Avahi client failed' | wc -l | awk '{print $1}'` +-if test $count != 8; then +- echo "FAIL: $count warning messages, expected 8." ++if test $count != 10; then ++ echo "FAIL: $count warning messages, expected 10." + $GREP '^W ' $BASE/log/error_log +- echo "

FAIL: $count warning messages, expected 8.

" >>$strfile ++ echo "

FAIL: $count warning messages, expected 10.

" >>$strfile + echo "
" >>$strfile
+ 	$GREP '^W ' $BASE/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/>$strfile
+ 	echo "    
" >>$strfile diff --git a/cups-eggcups.patch b/cups-eggcups.patch deleted file mode 100644 index b49638eb3a3ead00a90be48e63b756b0a0f84a36..0000000000000000000000000000000000000000 --- a/cups-eggcups.patch +++ /dev/null @@ -1,130 +0,0 @@ -diff -up cups-2.3.0/backend/ipp.c.eggcups cups-2.3.0/backend/ipp.c ---- cups-2.3.0/backend/ipp.c.eggcups 2019-08-23 17:19:38.000000000 +0200 -+++ cups-2.3.0/backend/ipp.c 2019-10-07 12:14:25.385111933 +0200 -@@ -143,6 +143,70 @@ static char tmpfilename[1024] = ""; - static char mandatory_attrs[1024] = ""; - /* cupsMandatory value */ - -+#if HAVE_DBUS -+#include -+ -+static DBusConnection *dbus_connection = NULL; -+ -+static int -+init_dbus (void) -+{ -+ DBusConnection *connection; -+ DBusError error; -+ -+ if (dbus_connection && -+ !dbus_connection_get_is_connected (dbus_connection)) { -+ dbus_connection_unref (dbus_connection); -+ dbus_connection = NULL; -+ } -+ -+ dbus_error_init (&error); -+ connection = dbus_bus_get (getuid () ? DBUS_BUS_SESSION : DBUS_BUS_SYSTEM, &error); -+ if (connection == NULL) { -+ dbus_error_free (&error); -+ return -1; -+ } -+ -+ dbus_connection = connection; -+ return 0; -+} -+ -+int -+dbus_broadcast_queued_remote (const char *printer_uri, -+ ipp_status_t status, -+ unsigned int local_job_id, -+ unsigned int remote_job_id, -+ const char *username, -+ const char *printer_name) -+{ -+ DBusMessage *message; -+ DBusMessageIter iter; -+ const char *errstr; -+ -+ if (!dbus_connection || !dbus_connection_get_is_connected (dbus_connection)) { -+ if (init_dbus () || !dbus_connection) -+ return -1; -+ } -+ -+ errstr = ippErrorString (status); -+ message = dbus_message_new_signal ("/com/redhat/PrinterSpooler", -+ "com.redhat.PrinterSpooler", -+ "JobQueuedRemote"); -+ dbus_message_iter_init_append (message, &iter); -+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &printer_uri); -+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &errstr); -+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_UINT32, &local_job_id); -+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_UINT32, &remote_job_id); -+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &username); -+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &printer_name); -+ -+ dbus_connection_send (dbus_connection, message, NULL); -+ dbus_connection_flush (dbus_connection); -+ dbus_message_unref (message); -+ -+ return 0; -+} -+#endif /* HAVE_DBUS */ - - /* - * Local functions... -@@ -1768,6 +1832,15 @@ main(int argc, /* I - Number of comm - fprintf(stderr, "DEBUG: Print job accepted - job ID %d.\n", job_id); - } - -+#if HAVE_DBUS -+ dbus_broadcast_queued_remote (argv[0], -+ ipp_status, -+ atoi (argv[1]), -+ job_id, -+ argv[2], -+ getenv ("PRINTER")); -+#endif /* HAVE_DBUS */ -+ - ippDelete(response); - - if (job_canceled) -diff -up cups-2.3.0/backend/Makefile.eggcups cups-2.3.0/backend/Makefile ---- cups-2.3.0/backend/Makefile.eggcups 2019-10-07 12:14:25.385111933 +0200 -+++ cups-2.3.0/backend/Makefile 2019-10-07 12:16:00.457569406 +0200 -@@ -257,7 +257,7 @@ dnssd: dnssd.o ../cups/$(LIBCUPS) libbac - - ipp: ipp.o ../cups/$(LIBCUPS) libbackend.a - echo Linking $@... -- $(LD_CC) $(ALL_LDFLAGS) -o ipp ipp.o libbackend.a $(LINKCUPS) -+ $(LD_CC) $(LDFLAGS) -o ipp ipp.o libbackend.a $(LINKCUPS) $(SERVERLIBS) - $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@ - $(RM) http https ipps - for file in $(IPPALIASES); do \ -diff -up cups-2.3.0/scheduler/subscriptions.c.eggcups cups-2.3.0/scheduler/subscriptions.c ---- cups-2.3.0/scheduler/subscriptions.c.eggcups 2019-08-23 17:19:38.000000000 +0200 -+++ cups-2.3.0/scheduler/subscriptions.c 2019-10-07 12:18:21.736478684 +0200 -@@ -1257,13 +1257,13 @@ cupsd_send_dbus(cupsd_eventmask_t event, - what = "PrinterAdded"; - else if (event & CUPSD_EVENT_PRINTER_DELETED) - what = "PrinterRemoved"; -- else if (event & CUPSD_EVENT_PRINTER_CHANGED) -- what = "QueueChanged"; - else if (event & CUPSD_EVENT_JOB_CREATED) - what = "JobQueuedLocal"; - else if ((event & CUPSD_EVENT_JOB_STATE) && job && - job->state_value == IPP_JOB_PROCESSING) - what = "JobStartedLocal"; -+ else if (event & (CUPSD_EVENT_PRINTER_CHANGED|CUPSD_EVENT_JOB_STATE_CHANGED|CUPSD_EVENT_PRINTER_STATE_CHANGED)) -+ what = "QueueChanged"; - else - return; - -@@ -1299,7 +1299,7 @@ cupsd_send_dbus(cupsd_eventmask_t event, - dbus_message_append_iter_init(message, &iter); - if (dest) - dbus_message_iter_append_string(&iter, dest->name); -- if (job) -+ if (job && strcmp (what, "QueueChanged") != 0) - { - dbus_message_iter_append_uint32(&iter, job->id); - dbus_message_iter_append_string(&iter, job->username); diff --git a/cups-etimedout.patch b/cups-etimedout.patch deleted file mode 100644 index 31defda0eb4d0f1803cc92446f398a570bde2113..0000000000000000000000000000000000000000 --- a/cups-etimedout.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/cups/http-addrlist.c b/cups/http-addrlist.c -index e4ffc3d..a989055 100644 ---- a/cups/http-addrlist.c -+++ b/cups/http-addrlist.c -@@ -240,7 +240,10 @@ httpAddrConnect2( - } - - if (!addrlist && nfds == 0) -+ { -+ errno = EHOSTDOWN; - break; -+ } - - /* - * See if we can connect to any of the addresses so far... -@@ -371,6 +374,9 @@ httpAddrConnect2( - remaining -= 250; - } - -+ if (remaining <= 0) -+ errno = ETIMEDOUT; -+ - while (nfds > 0) - { - nfds --; diff --git a/cups-filter-debug.patch b/cups-filter-debug.patch deleted file mode 100644 index 96c82dab9333fe1eae827eaf7ecd5df8a5f0aee2..0000000000000000000000000000000000000000 --- a/cups-filter-debug.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff -up cups-1.6b1/scheduler/job.c.filter-debug cups-1.6b1/scheduler/job.c ---- cups-1.6b1/scheduler/job.c.filter-debug 2012-05-25 16:06:01.000000000 +0200 -+++ cups-1.6b1/scheduler/job.c 2012-05-25 16:07:46.309259511 +0200 -@@ -625,10 +625,28 @@ cupsdContinueJob(cupsd_job_t *job) /* I - - if (!filters) - { -+ mime_filter_t *current; -+ - cupsdLogJob(job, CUPSD_LOG_ERROR, - "Unable to convert file %d to printable format.", - job->current_file); - -+ cupsdLogJob(job, CUPSD_LOG_ERROR, -+ "Required: %s/%s -> %s/%s", -+ job->filetypes[job->current_file]->super, -+ job->filetypes[job->current_file]->type, -+ job->printer->filetype->super, -+ job->printer->filetype->type); -+ -+ for (current = (mime_filter_t *)cupsArrayFirst(MimeDatabase->srcs); -+ current; -+ current = (mime_filter_t *)cupsArrayNext(MimeDatabase->srcs)) -+ cupsdLogJob(job, CUPSD_LOG_ERROR, -+ "Available: %s/%s -> %s/%s (%s)", -+ current->src->super, current->src->type, -+ current->dst->super, current->dst->type, -+ current->filter); -+ - abort_message = "Aborting job because it cannot be printed."; - abort_state = IPP_JOB_ABORTED; - diff --git a/cups-fstack-strong.patch b/cups-fstack-strong.patch new file mode 100644 index 0000000000000000000000000000000000000000..0cdbcd52430d1dcaf124a1bb61fc264faf49ded6 --- /dev/null +++ b/cups-fstack-strong.patch @@ -0,0 +1,49 @@ +diff --git a/config-scripts/cups-compiler.m4 b/config-scripts/cups-compiler.m4 +index 733b06c..bb770f0 100644 +--- a/config-scripts/cups-compiler.m4 ++++ b/config-scripts/cups-compiler.m4 +@@ -123,21 +123,35 @@ if test -n "$GCC"; then + OPTIM="-fPIC $OPTIM" + fi + +- # The -fstack-protector option is available with some versions of +- # GCC and adds "stack canaries" which detect when the return address +- # has been overwritten, preventing many types of exploit attacks. +- AC_MSG_CHECKING(whether compiler supports -fstack-protector) ++ # The -fstack-protector-strong and -fstack-protector options are available ++ # with some versions of# GCC and adds "stack canaries" which detect ++ # when the return address has been overwritten, preventing many types of exploit attacks. ++ # First check for -fstack-protector-strong, then for -fstack-protector... ++ AC_MSG_CHECKING([whether compiler supports -fstack-protector-strong]) + OLDCFLAGS="$CFLAGS" +- CFLAGS="$CFLAGS -fstack-protector" +- AC_TRY_LINK(,, ++ CFLAGS="$CFLAGS -fstack-protector-strong" ++ AC_TRY_LINK(,,[ + if test "x$LSB_BUILD" = xy; then + # Can't use stack-protector with LSB binaries... + OPTIM="$OPTIM -fno-stack-protector" + else +- OPTIM="$OPTIM -fstack-protector" ++ OPTIM="$OPTIM -fstack-protector-strong" + fi +- AC_MSG_RESULT(yes), +- AC_MSG_RESULT(no)) ++ AC_MSG_RESULT(yes) ++ ], [ ++ AC_MSG_CHECKING([whether compiler supports -fstack-protector]) ++ CFLAGS="$OLDCFLAGS -fstack-protector" ++ AC_LINK_IFELSE([AC_LANG_PROGRAM()], [ ++ AS_IF([test "x$LSB_BUILD" = xy], [ ++ # Can't use stack-protector with LSB binaries... ++ OPTIM="$OPTIM -fno-stack-protector" ++ ], [ ++ OPTIM="$OPTIM -fstack-protector" ++ ]) ++ ], [ ++ AC_MSG_RESULT([no]) ++ ]) ++ ]) + CFLAGS="$OLDCFLAGS" + + if test "x$LSB_BUILD" != xy; then diff --git a/cups-hp-deviceid-oid.patch b/cups-hp-deviceid-oid.patch deleted file mode 100644 index da5136a812950352c950e04228d71dd96ce0b72e..0000000000000000000000000000000000000000 --- a/cups-hp-deviceid-oid.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -up cups-1.5b1/backend/snmp.c.hp-deviceid-oid cups-1.5b1/backend/snmp.c ---- cups-1.5b1/backend/snmp.c.hp-deviceid-oid 2011-05-20 05:49:49.000000000 +0200 -+++ cups-1.5b1/backend/snmp.c 2011-05-24 17:24:48.000000000 +0200 -@@ -187,6 +187,7 @@ static const int UriOID[] = { CUPS_OID_p - 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 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; -@@ -1006,6 +1007,9 @@ read_snmp_response(int fd) /* I - SNMP - _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 : diff --git a/cups-ipptool-mdns-uri.patch b/cups-ipptool-mdns-uri.patch deleted file mode 100644 index 6919e96e4411c1a8d3dd8a869931a3397673cdbc..0000000000000000000000000000000000000000 --- a/cups-ipptool-mdns-uri.patch +++ /dev/null @@ -1,43 +0,0 @@ -diff --git a/cups/ipp-vars.c b/cups/ipp-vars.c -index 395b0eb..60aa991 100644 ---- a/cups/ipp-vars.c -+++ b/cups/ipp-vars.c -@@ -13,6 +13,7 @@ - */ - - #include -+#include - #include "ipp-private.h" - #include "string-private.h" - #include "debug-internal.h" -@@ -221,9 +222,29 @@ _ippVarsSet(_ipp_vars_t *v, /* I - IPP variables */ - if (!strcmp(name, "uri")) - { - char uri[1024]; /* New printer URI */ -+ char resolved[1024]; /* Resolved mDNS URI */ -+ char value_uri[1024]; /* URI from value */ - http_uri_status_t uri_status; /* URI status */ - -- if ((uri_status = httpSeparateURI(HTTP_URI_CODING_ALL, value, v->scheme, sizeof(v->scheme), v->username, sizeof(v->username), v->host, sizeof(v->host), &(v->port), v->resource, sizeof(v->resource))) < HTTP_URI_STATUS_OK) -+ snprintf(value_uri, sizeof(value_uri), "%s", value); -+ value_uri[1023] = '\0'; -+ -+ if (strstr(value_uri, "._tcp")) -+ { -+ /* -+ * Resolve URI... -+ */ -+ -+ if (!_httpResolveURI(value_uri, resolved, sizeof(resolved), _HTTP_RESOLVE_DEFAULT, NULL, NULL)) -+ { -+ return (0); -+ } -+ -+ snprintf(value_uri, sizeof(value_uri), "%s", resolved); -+ value_uri[1023] = '\0'; -+ } -+ -+ if ((uri_status = httpSeparateURI(HTTP_URI_CODING_ALL, value_uri, v->scheme, sizeof(v->scheme), v->username, sizeof(v->username), v->host, sizeof(v->host), &(v->port), v->resource, sizeof(v->resource))) < HTTP_URI_STATUS_OK) - return (0); - - if (v->username[0]) diff --git a/cups-logrotate.patch b/cups-logrotate.patch deleted file mode 100644 index 6b8eb8ce5495b6777080e87ec919c7580e12358d..0000000000000000000000000000000000000000 --- a/cups-logrotate.patch +++ /dev/null @@ -1,63 +0,0 @@ -diff -up cups-2.1b1/scheduler/log.c.logrotate cups-2.1b1/scheduler/log.c ---- cups-2.1b1/scheduler/log.c.logrotate 2015-06-04 20:00:31.000000000 +0200 -+++ cups-2.1b1/scheduler/log.c 2015-06-29 13:25:09.623350218 +0200 -@@ -26,6 +26,9 @@ - # include - #endif /* HAVE_ASL_H */ - #include -+#include -+#include -+#include - - - /* -@@ -135,12 +138,10 @@ cupsdCheckLogFile(cups_file_t **lf, /* I - } - - /* -- * Format the filename as needed... -+ * Format the filename... - */ - -- if (!*lf || -- (strncmp(logname, "/dev/", 5) && cupsFileTell(*lf) > MaxLogSize && -- MaxLogSize > 0)) -+ if (strncmp(logname, "/dev/", 5)) - { - /* - * Handle format strings... -@@ -254,6 +255,34 @@ cupsdCheckLogFile(cups_file_t **lf, /* I - /* - * Change ownership and permissions of non-device logs... - */ -+ -+ fchown(cupsFileNumber(*lf), RunUser, Group); -+ fchmod(cupsFileNumber(*lf), LogFilePerm); -+ } -+ } -+ -+ /* -+ * Has someone else (i.e. logrotate) already rotated the log for us? -+ */ -+ else if (strncmp(filename, "/dev/", 5)) -+ { -+ struct stat st; -+ if (stat(filename, &st) || st.st_size == 0) -+ { -+ /* File is either missing or has zero size. */ -+ -+ cupsFileClose(*lf); -+ if ((*lf = cupsFileOpen(filename, "a")) == NULL) -+ { -+ syslog(LOG_ERR, "Unable to open log file \"%s\" - %s", filename, -+ strerror(errno)); -+ -+ return (0); -+ } -+ -+ /* -+ * Change ownership and permissions of non-device logs... -+ */ - - fchown(cupsFileNumber(*lf), RunUser, Group); - fchmod(cupsFileNumber(*lf), LogFilePerm); diff --git a/cups-logs.patch b/cups-logs.patch new file mode 100644 index 0000000000000000000000000000000000000000..75b3e267937b6b6486a9a076da59e7ccdde5ddf1 --- /dev/null +++ b/cups-logs.patch @@ -0,0 +1,16 @@ +diff --git a/scheduler/log.c b/scheduler/log.c +index 17331ff02..41ddb4cb9 100644 +--- a/scheduler/log.c ++++ b/scheduler/log.c +@@ -569,11 +569,7 @@ cupsdLogJob(cupsd_job_t *job, /* I - Job */ + * Format and write the log message... + */ + +-#ifdef HAVE_SYSTEMD_SD_JOURNAL_H +- if (job && strcmp(ErrorLog, "syslog")) +-#else + if (job) +-#endif /* HAVE_SYSTEMD_SD_JOURNAL_H */ + snprintf(jobmsg, sizeof(jobmsg), "[Job %d] %s", job->id, message); + else + strlcpy(jobmsg, message, sizeof(jobmsg)); diff --git a/cups-manual-copies.patch b/cups-manual-copies.patch deleted file mode 100644 index 5d9c1af9c3ebbb00ba1de75c0129cad90689c7c8..0000000000000000000000000000000000000000 --- a/cups-manual-copies.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c -index 94a125a..79aab32 100644 ---- a/cups/ppd-cache.c -+++ b/cups/ppd-cache.c -@@ -3228,7 +3228,7 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */ - cupsFilePuts(fp, "*cupsFilter2: \"application/vnd.cups-pdf application/pdf 10 -\"\n"); - } - else -- cupsFilePuts(fp, "*cupsManualCopies: true\n"); -+ cupsFilePuts(fp, "*cupsManualCopies: True\n"); - if (is_apple) - cupsFilePuts(fp, "*cupsFilter2: \"image/urf image/urf 100 -\"\n"); - if (is_pwg) diff --git a/cups-nssuserlookup-target.patch b/cups-nssuserlookup-target.patch new file mode 100644 index 0000000000000000000000000000000000000000..35eff69fc68d6d5d30baf85af3c015b7e94b6ae5 --- /dev/null +++ b/cups-nssuserlookup-target.patch @@ -0,0 +1,13 @@ +diff --git a/scheduler/cups.service.in b/scheduler/cups.service.in +index a3fa0e8..baff51b 100644 +--- a/scheduler/cups.service.in ++++ b/scheduler/cups.service.in +@@ -1,7 +1,7 @@ + [Unit] + Description=CUPS Scheduler + Documentation=man:cupsd(8) +-After=network.target sssd.service ypbind.service nslcd.service ++After=network.target nss-user-lookup.target nslcd.service + Requires=cups.socket + + [Service] diff --git a/cups-ppdleak.patch b/cups-ppdleak.patch deleted file mode 100644 index 3354f76a2aa13129b7d090e3490366bed6e1d941..0000000000000000000000000000000000000000 --- a/cups-ppdleak.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/ppdc/ppdc-import.cxx b/ppdc/ppdc-import.cxx -index 04b587d..60d8834 100644 ---- a/ppdc/ppdc-import.cxx -+++ b/ppdc/ppdc-import.cxx -@@ -27,7 +27,7 @@ ppdcSource::import_ppd(const char *f) // I - Filename - char line[256], // Comment line - *ptr; // Pointer into line - int cost; // Cost for filter -- ppd_file_t *ppd; // PPD file data -+ ppd_file_t *ppd = NULL; // PPD file data - ppd_group_t *group; // PPD group - ppd_option_t *option; // PPD option - ppd_choice_t *choice; // PPD choice -@@ -323,5 +323,8 @@ ppdcSource::import_ppd(const char *f) // I - Filename - } - } - -+ if (ppd) -+ ppdClose(ppd); -+ - return (1); - } diff --git a/cups-prioritize-print-color-mode.patch b/cups-prioritize-print-color-mode.patch deleted file mode 100644 index feb71197df46102e74b9bbdd4721e4dbd1b6803a..0000000000000000000000000000000000000000 --- a/cups-prioritize-print-color-mode.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c -index 5965e38..94a125a 100644 ---- a/cups/ppd-cache.c -+++ b/cups/ppd-cache.c -@@ -3735,8 +3735,8 @@ _ppdCreateFromIPP(char *buffer, /* I - Filename buffer */ - */ - - if ((attr = ippFindAttribute(response, "urf-supported", IPP_TAG_KEYWORD)) == NULL) -- if ((attr = ippFindAttribute(response, "pwg-raster-document-type-supported", IPP_TAG_KEYWORD)) == NULL) -- if ((attr = ippFindAttribute(response, "print-color-mode-supported", IPP_TAG_KEYWORD)) == NULL) -+ if ((attr = ippFindAttribute(response, "print-color-mode-supported", IPP_TAG_KEYWORD)) == NULL) -+ if ((attr = ippFindAttribute(response, "pwg-raster-document-type-supported", IPP_TAG_KEYWORD)) == NULL) - attr = ippFindAttribute(response, "output-mode-supported", IPP_TAG_KEYWORD); - - if (attr) diff --git a/cups-rastertopwg-crash.patch b/cups-rastertopwg-crash.patch deleted file mode 100644 index 4c378b91e485bdeb7051895b2570052f67b277c2..0000000000000000000000000000000000000000 --- a/cups-rastertopwg-crash.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/filter/rastertopwg.c b/filter/rastertopwg.c -index 1e63e4e..b3a2e87 100644 ---- a/filter/rastertopwg.c -+++ b/filter/rastertopwg.c -@@ -260,7 +260,8 @@ main(int argc, /* I - Number of command-line args */ - } - - if (inheader.cupsPageSizeName[0] && -- (pwg_size = _ppdCacheGetSize(cache, inheader.cupsPageSizeName)) != NULL) -+ (pwg_size = _ppdCacheGetSize(cache, inheader.cupsPageSizeName)) != NULL && -+ pwg_size->map.pwg) - { - strlcpy(outheader.cupsPageSizeName, pwg_size->map.pwg, - sizeof(outheader.cupsPageSizeName)); diff --git a/cups-restart-job-hold-until.patch b/cups-restart-job-hold-until.patch new file mode 100644 index 0000000000000000000000000000000000000000..d2355180983fedd7c09b6778e55ce186f41fe1f9 --- /dev/null +++ b/cups-restart-job-hold-until.patch @@ -0,0 +1,20 @@ +diff --git a/scheduler/ipp.c b/scheduler/ipp.c +index e0dbc4a..5e9a985 100644 +--- a/scheduler/ipp.c ++++ b/scheduler/ipp.c +@@ -9891,11 +9891,10 @@ restart_job(cupsd_client_t *con, /* I - Client connection */ + cupsdLogJob(job, CUPSD_LOG_DEBUG, + "Restarted by \"%s\" with job-hold-until=%s.", + username, attr->values[0].string.text); +- cupsdSetJobHoldUntil(job, attr->values[0].string.text, 0); +- +- cupsdAddEvent(CUPSD_EVENT_JOB_CONFIG_CHANGED | CUPSD_EVENT_JOB_STATE, +- NULL, job, "Job restarted by user with job-hold-until=%s", +- attr->values[0].string.text); ++ cupsdSetJobHoldUntil(job, attr->values[0].string.text, 1); ++ cupsdSetJobState(job, IPP_JOB_HELD, CUPSD_JOB_DEFAULT, ++ "Job restarted by user with job-hold-until=%s", ++ attr->values[0].string.text); + } + else + { diff --git a/cups-ricoh-deviceid-oid.patch b/cups-ricoh-deviceid-oid.patch deleted file mode 100644 index c148f9539b4c2db143afabd4aff6540b5d5a4c43..0000000000000000000000000000000000000000 --- a/cups-ricoh-deviceid-oid.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -up cups-1.5b1/backend/snmp.c.ricoh-deviceid-oid cups-1.5b1/backend/snmp.c ---- cups-1.5b1/backend/snmp.c.ricoh-deviceid-oid 2011-05-24 17:29:48.000000000 +0200 -+++ cups-1.5b1/backend/snmp.c 2011-05-24 17:29:48.000000000 +0200 -@@ -188,6 +188,7 @@ static const int LexmarkProductOID[] = { - 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; -@@ -1005,6 +1006,9 @@ read_snmp_response(int fd) /* I - SNMP - 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, diff --git a/cups-synconclose.patch b/cups-synconclose.patch deleted file mode 100644 index 380be9421f49dabc4e432822242a530153d49d57..0000000000000000000000000000000000000000 --- a/cups-synconclose.patch +++ /dev/null @@ -1,48 +0,0 @@ -diff -up cups-2.2.12/conf/cups-files.conf.in.synconclose cups-2.2.12/conf/cups-files.conf.in ---- cups-2.2.12/conf/cups-files.conf.in.synconclose 2019-08-16 00:35:30.000000000 +0200 -+++ cups-2.2.12/conf/cups-files.conf.in 2019-08-19 09:58:14.646567949 +0200 -@@ -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 -up cups-2.2.12/doc/help/man-cups-files.conf.html.synconclose cups-2.2.12/doc/help/man-cups-files.conf.html ---- cups-2.2.12/doc/help/man-cups-files.conf.html.synconclose 2019-08-16 00:35:30.000000000 +0200 -+++ cups-2.2.12/doc/help/man-cups-files.conf.html 2019-08-19 09:58:14.646567949 +0200 -@@ -150,7 +150,7 @@ The default is "/var/run/cups" or "/etc/ -
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 -up cups-2.2.12/man/cups-files.conf.man.in.synconclose cups-2.2.12/man/cups-files.conf.man.in ---- cups-2.2.12/man/cups-files.conf.5.synconclose 2019-08-16 00:35:30.000000000 +0200 -+++ cups-2.2.12/man/cups-files.conf.5 2019-08-19 09:58:14.646567949 +0200 -@@ -214,7 +214,7 @@ The default is "/var/run/cups" or "/etc/ - 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 -up cups-2.2.12/scheduler/conf.c.synconclose cups-2.2.12/scheduler/conf.c ---- cups-2.2.12/scheduler/conf.c.synconclose 2019-08-19 09:58:14.647567941 +0200 -+++ cups-2.2.12/scheduler/conf.c 2019-08-19 09:59:36.066927455 +0200 -@@ -735,7 +735,7 @@ cupsdReadConfiguration(void) - RootCertDuration = 300; - Sandboxing = CUPSD_SANDBOXING_STRICT; - StrictConformance = FALSE; -- SyncOnClose = FALSE; -+ SyncOnClose = TRUE; - Timeout = 900; - WebInterface = CUPS_DEFAULT_WEBIF; - diff --git a/cups-systemd-socket.patch b/cups-systemd-socket.patch deleted file mode 100644 index 260ac29d7d5568e8c3608adf7d826f064494cca4..0000000000000000000000000000000000000000 --- a/cups-systemd-socket.patch +++ /dev/null @@ -1,74 +0,0 @@ -diff -up cups-2.2.12/scheduler/main.c.systemd-socket cups-2.2.12/scheduler/main.c ---- cups-2.2.12/scheduler/main.c.systemd-socket 2019-08-16 00:35:30.000000000 +0200 -+++ cups-2.2.12/scheduler/main.c 2019-08-19 09:31:09.703370325 +0200 -@@ -674,8 +674,16 @@ main(int argc, /* I - Number of comm - - #ifdef HAVE_ONDEMAND - if (OnDemand) -+ { - cupsdAddEvent(CUPSD_EVENT_SERVER_STARTED, NULL, NULL, "Scheduler started on demand."); -- else -+# ifdef HAVE_SYSTEMD -+ sd_notifyf(0, "READY=1\n" -+ "STATUS=Scheduler is running...\n" -+ "MAINPID=%lu", -+ (unsigned long) getpid()); -+# endif /* HAVE_SYSTEMD */ -+ } else -+ - #endif /* HAVE_ONDEMAND */ - if (fg) - cupsdAddEvent(CUPSD_EVENT_SERVER_STARTED, NULL, NULL, "Scheduler started in foreground."); -diff -up cups-2.2.12/scheduler/org.cups.cupsd.path.in.systemd-socket cups-2.2.12/scheduler/org.cups.cupsd.path.in ---- cups-2.2.12/scheduler/org.cups.cupsd.path.in.systemd-socket 2019-08-16 00:35:30.000000000 +0200 -+++ cups-2.2.12/scheduler/org.cups.cupsd.path.in 2019-08-19 09:31:09.703370325 +0200 -@@ -1,6 +1,6 @@ - [Unit] - Description=CUPS Scheduler --PartOf=org.cups.cupsd.service -+PartOf=cups.service - - [Path] - PathExists=@CUPS_CACHEDIR@/org.cups.cupsd -diff -up cups-2.2.12/scheduler/org.cups.cupsd.service.in.systemd-socket cups-2.2.12/scheduler/org.cups.cupsd.service.in ---- cups-2.2.12/scheduler/org.cups.cupsd.service.in.systemd-socket 2019-08-19 09:31:09.703370325 +0200 -+++ cups-2.2.12/scheduler/org.cups.cupsd.service.in 2019-08-19 09:54:58.890036404 +0200 -@@ -1,13 +1,13 @@ - [Unit] - Description=CUPS Scheduler - Documentation=man:cupsd(8) --After=sssd.service -+After=sssd.service network.target - - [Service] - ExecStart=@sbindir@/cupsd -l --Type=simple -+Type=notify - Restart=on-failure - - [Install] --Also=org.cups.cupsd.socket org.cups.cupsd.path -+Also=cups.socket cups.path - WantedBy=printer.target -diff -up cups-2.2.12/scheduler/org.cups.cupsd.socket.in.systemd-socket cups-2.2.12/scheduler/org.cups.cupsd.socket.in ---- cups-2.2.12/scheduler/org.cups.cupsd.socket.in.systemd-socket 2019-08-16 00:35:30.000000000 +0200 -+++ cups-2.2.12/scheduler/org.cups.cupsd.socket.in 2019-08-19 09:31:09.703370325 +0200 -@@ -1,6 +1,6 @@ - [Unit] - Description=CUPS Scheduler --PartOf=org.cups.cupsd.service -+PartOf=cups.service - - [Socket] - ListenStream=@CUPS_DEFAULT_DOMAINSOCKET@ -diff -up cups-2.2.12/scheduler/org.cups.cups-lpd.socket.systemd-socket cups-2.2.12/scheduler/org.cups.cups-lpd.socket ---- cups-2.2.12/scheduler/org.cups.cups-lpd.socket.systemd-socket 2019-08-16 00:35:30.000000000 +0200 -+++ cups-2.2.12/scheduler/org.cups.cups-lpd.socket 2019-08-19 09:31:09.703370325 +0200 -@@ -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/cups-webui-uri.patch b/cups-webui-uri.patch deleted file mode 100644 index 7021205c072e208ee9b07e5f0d41577e09a5ed40..0000000000000000000000000000000000000000 --- a/cups-webui-uri.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/cgi-bin/admin.c b/cgi-bin/admin.c -index a87e6be..4600d33 100644 ---- a/cgi-bin/admin.c -+++ b/cgi-bin/admin.c -@@ -974,6 +974,8 @@ do_am_printer(http_t *http, /* I - HTTP connection */ - - cgiSetVariable("TEMPLATE_NAME", template); - } -+ -+ cgiSetVariable("DEVICE_URI", var); - } - } - diff --git a/cups-ypbind.patch b/cups-ypbind.patch deleted file mode 100644 index 17e90a57d6436aea432297d2f54c72137674a4df..0000000000000000000000000000000000000000 --- a/cups-ypbind.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up cups-2.2.12/scheduler/org.cups.cupsd.service.in.ypbind cups-2.2.12/scheduler/org.cups.cupsd.service.in ---- cups-2.2.12/scheduler/org.cups.cupsd.service.in.ypbind 2019-08-19 10:00:47.586326493 +0200 -+++ cups-2.2.12/scheduler/org.cups.cupsd.service.in 2019-08-19 10:01:39.295890076 +0200 -@@ -1,7 +1,7 @@ - [Unit] - Description=CUPS Scheduler - Documentation=man:cupsd(8) --After=sssd.service network.target -+After=sssd.service network.target ypbind.service - - [Service] - ExecStart=@sbindir@/cupsd -l diff --git a/cups.logrotate b/cups.logrotate deleted file mode 100644 index 773c70fd2aa92610b47438422f8d94e7651a2c90..0000000000000000000000000000000000000000 --- a/cups.logrotate +++ /dev/null @@ -1,5 +0,0 @@ -/var/log/cups/*_log { - missingok - notifempty - sharedscripts -} diff --git a/cups.spec b/cups.spec index 3e2406583bd1499bb85e73ac6b20ae2f64b8892f..e54467b236b18f0d376f910ebb688c56adfa4772 100644 --- a/cups.spec +++ b/cups.spec @@ -1,72 +1,84 @@ %global cups_serverbin %{_exec_prefix}/lib/cups +%global OP_VER op2 + Name: cups Epoch: 1 -Version: 2.3.3 -Release: 8 +Version: 2.3.3%{OP_VER} +Release: 1 Summary: CUPS is the standards-based, open source printing system for linux operating systems. License: GPLv2+ and LGPLv2+ with exceptions and AML Url: http://www.cups.org/ -Source0: https://github.com/apple/cups/archive/v%{version}.tar.gz +# Apple stopped uploading the new versions into github, use OpenPrinting fork +Source0: https://github.com/OpenPrinting/cups/releases/download/v%{version}/cups-%{version}-source.tar.gz -Source2: cupsprinter.png -Source3: cups.logrotate -Source5: macros.cups +Source1: cupsprinter.png +Source2: macros.cups Patch1: cups-system-auth.patch Patch2: cups-multilib.patch Patch3: cups-banners.patch Patch4: cups-no-export-ssllibs.patch Patch5: cups-direct-usb.patch -Patch6: cups-eggcups.patch -Patch7: cups-driverd-timeout.patch -Patch8: cups-logrotate.patch -Patch9: cups-usb-paperout.patch -Patch10: cups-uri-compat.patch -Patch11: cups-hp-deviceid-oid.patch -Patch12: cups-ricoh-deviceid-oid.patch -Patch13: cups-systemd-socket.patch -Patch14: cups-freebind.patch -Patch15: cups-ipp-multifile.patch -Patch16: cups-web-devices-timeout.patch -Patch17: cups-synconclose.patch -Patch18: cups-ypbind.patch -Patch19: cups-lspp.patch -Patch20: cups-failover-backend.patch -Patch21: cups-filter-debug.patch -Patch22: cups-dymo-deviceid.patch -Patch23: cups-autostart-when-enabled.patch -Patch24: cups-prioritize-print-color-mode.patch -Patch25: cups-ppdleak.patch -Patch26: cups-rastertopwg-crash.patch -Patch27: cups-etimedout.patch -Patch28: cups-webui-uri.patch -Patch29: cups-ipptool-mdns-uri.patch -Patch30: cups-manual-copies.patch -Patch6000: backport-CVE-2020-10001.patch - -Provides: cupsddk cupsddk-drivers cups-filesystem cups-client cups-ipptool cups-lpd -Provides: lpd lpr /usr/bin/lpq /usr/bin/lpr /usr/bin/lp /usr/bin/cancel /usr/bin/lprm /usr/bin/lpstat -Obsoletes: cups-client cups-filesystem cups-lpd cups-ipptool - -Provides: cups-printerapp = %{version}-%{release} -Obsoletes: cups-printerapp < %{version}-%{release} +Patch6: cups-driverd-timeout.patch +Patch7: cups-usb-paperout.patch +Patch8: cups-uri-compat.patch +Patch9: cups-freebind.patch +Patch10: cups-ipp-multifile.patch +Patch11: cups-web-devices-timeout.patch +Patch12: cups-failover-backend.patch +Patch13: cups-dymo-deviceid.patch +Patch14: cups-logs.patch +Patch15: backport-backend-usb-libusb.c-Use-60s-timeout-for-reading-at-.patch +Patch16: cups-nssuserlookup-target.patch +Patch17: backport-Retry-Validate-Job-once-if-needed-Issue-132.patch +Patch18: backport-cups.service.in-Add-SYSTEMD_WANTED_BY-variable.patch +Patch19: cups-cleanfiles.patch +Patch20: backport-cgi-bin-ipp-var.c-Use-guest-user-for-Move-Job-when-n.patch +Patch21: backport-scheduler-job.c-use-gziptoany-for-raw-files-not-just.patch +Patch22: cups-restart-job-hold-until.patch +Patch23: backport-cups-md5passwd.c-Stub-out-httpMD5-functions.patch +Patch24: cups-deprecate-drivers.patch +Patch25: cups-fstack-strong.patch +Patch26: cups-lspp.patch BuildRequires: pam-devel pkgconf-pkg-config pkgconfig(gnutls) libacl-devel openldap-devel pkgconfig(libusb-1.0) BuildRequires: krb5-devel pkgconfig(avahi-client) systemd pkgconfig(libsystemd) pkgconfig(dbus-1) python3-cups -BuildRequires: automake zlib-devel gcc gcc-c++ libselinux-devel audit-libs-devel -Requires: dbus systemd acl cups-filters /usr/sbin/alternatives %{name}-libs = %{epoch}:%{version}-%{release} +BuildRequires: automake zlib-devel gcc gcc-c++ libselinux-devel audit-libs-devel make +Requires: dbus systemd acl cups-filters /usr/sbin/alternatives +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-client%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-filesystem = %{epoch}:%{version}-%{release} + +# Requires working PrivateTmp (bug #807672) +Requires(pre): systemd +Requires(post): systemd +Requires(post): grep, sed +Requires(preun): systemd +Requires(postun): systemd %description CUPS is the standards-based, open source printing system developed by Apple Inc. for UNIX®-like operating systems. CUPS uses the Internet Printing -Protocol (IPP) to support printing to local and network printers.. +Protocol (IPP) to support printing to local and network printers. + +%package client +Summary: CUPS printing system - client programs +License: GPLv2 +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Provides: /usr/bin/lpq /usr/bin/lpr /usr/bin/lp /usr/bin/cancel /usr/bin/lprm /usr/bin/lpstat +Requires: /usr/sbin/alternatives +Provides: lpr + +%description client +CUPS printing system provides a portable printing layer for +UNIX® operating systems. This package contains command-line client +programs. %package devel Summary: CUPS printing system - development environment License: LGPLv2 -Requires: %{name}-libs = %{epoch}:%{version}-%{release} +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} Requires: gnutls-devel krb5-devel zlib-devel -Provides: cupsddk-devel %description devel CUPS is the standards-based, open source printing system developed by Apple Inc. @@ -77,8 +89,53 @@ package to develop other printer drivers. Summary: CUPS libs License: LGPLv2 and zlib -%description libs -The package provides cups libraries +%description libs +CUPS printing system provides a portable printing layer for +UNIX® operating systems. It has been developed by Apple Inc. +to promote a standard printing solution for all UNIX vendors and users. +CUPS provides the System V and Berkeley command-line interfaces. +The cups-libs package provides libraries used by applications to use CUPS +natively, without needing the lp/lpr commands. + +%package filesystem +Summary: CUPS printing system - directory layout +BuildArch: noarch + +%description filesystem +CUPS printing system provides a portable printing layer for +UNIX® operating systems. This package provides some directories which are +required by other packages that add CUPS drivers (i.e. filters, backends etc.). + +%package lpd +Summary: CUPS printing system - lpd emulation +Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Provides: lpd + +%description lpd +CUPS printing system provides a portable printing layer for +UNIX® operating systems. This is the package that provides standard +lpd emulation. + +%package ipptool +Summary: CUPS printing system - tool for performing IPP requests +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Requires: avahi + +%description ipptool +Sends IPP requests to the specified URI and tests and/or displays the results. + +%package printerapp +Summary: CUPS printing system - tools for printer application +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Requires: avahi + +%description printerapp +Provides IPP everywhere printer application ippeveprinter and tools for printing +PostScript and HP PCL document formats - ippevepcl and ippeveps. The printer +application enables older printers for IPP everywhere standard - so if older printer +is installed with a printer application, its print queue acts as IPP everywhere printer +to CUPS daemon. This solution will substitute printer drivers and raw queues in the future. %package help Summary: Documents for cups @@ -92,9 +149,10 @@ Man pages and other related documents. sed -i -e '1iMaxLogSize 0' conf/cupsd.conf.in sed -i -e 's,^ErrorLog .*$,ErrorLog syslog,' -i -e 's,^AccessLog .*$,AccessLog syslog,' -i -e 's,^PageLog .*,PageLog syslog,' conf/cups-files.conf.in +perl -pi -e "s,^.SILENT:,," Makedefs.in aclocal -I config-scripts -autoconf -I config-scripts +autoconf -f -I config-scripts %build export DSOFLAGS="$DSOFLAGS -L../cgi-bin -L../filter -L../ppdc -L../scheduler -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/generic-hardened-ld -Wl,-z,relro,-z,now -fPIE -pie" @@ -107,7 +165,6 @@ export CFLAGS="$RPM_OPT_FLAGS -fstack-protector-all -DLDAP_DEPRECATED=1" --with-log-file-perm=0600 \ --enable-relro \ --with-dbusdir=%{_sysconfdir}/dbus-1 \ - --with-php=/usr/bin/php-cgi \ --enable-avahi \ --enable-threads \ --enable-gnutls \ @@ -115,10 +172,15 @@ export CFLAGS="$RPM_OPT_FLAGS -fstack-protector-all -DLDAP_DEPRECATED=1" --with-xinetd=no \ --with-access-log-level=actions \ --enable-page-logging \ + --with-rundir=%{_rundir}/cups \ + --enable-sync-on-close \ localedir=%{_datadir}/locale %make_build +%check +make check + %install make BUILDROOT=${RPM_BUILD_ROOT} install @@ -141,26 +203,25 @@ done mv ${RPM_BUILD_ROOT}%{_mandir}/man8/lpc.8 ${RPM_BUILD_ROOT}%{_mandir}/man8/lpc-cups.8 popd -mv ${RPM_BUILD_ROOT}%{_unitdir}/org.cups.cupsd.path ${RPM_BUILD_ROOT}%{_unitdir}/cups.path -mv ${RPM_BUILD_ROOT}%{_unitdir}/org.cups.cupsd.service ${RPM_BUILD_ROOT}%{_unitdir}/cups.service -mv ${RPM_BUILD_ROOT}%{_unitdir}/org.cups.cupsd.socket ${RPM_BUILD_ROOT}%{_unitdir}/cups.socket -mv ${RPM_BUILD_ROOT}%{_unitdir}/org.cups.cups-lpd.socket ${RPM_BUILD_ROOT}%{_unitdir}/cups-lpd.socket -mv ${RPM_BUILD_ROOT}%{_unitdir}/org.cups.cups-lpd@.service ${RPM_BUILD_ROOT}%{_unitdir}/cups-lpd@.service - -/bin/sed -i -e "s,org.cups.cupsd,cups,g" ${RPM_BUILD_ROOT}%{_unitdir}/cups.service - install -d ${RPM_BUILD_ROOT}%{_datadir}/pixmaps ${RPM_BUILD_ROOT}%{_sysconfdir}/X11/sysconfig \ - ${RPM_BUILD_ROOT}%{_sysconfdir}/X11/applnk/System ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d \ + ${RPM_BUILD_ROOT}%{_sysconfdir}/X11/applnk/System \ ${RPM_BUILD_ROOT}%{_rpmconfigdir}/macros.d -install -p -m 644 %{SOURCE2} ${RPM_BUILD_ROOT}%{_datadir}/pixmaps -install -p -m 644 %{SOURCE3} ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/cups -install -m 0644 %{SOURCE5} ${RPM_BUILD_ROOT}%{_rpmconfigdir}/macros.d +install -p -m 644 %{SOURCE1} ${RPM_BUILD_ROOT}%{_datadir}/pixmaps +install -m 0644 %{SOURCE2} ${RPM_BUILD_ROOT}%{_rpmconfigdir}/macros.d touch ${RPM_BUILD_ROOT}%{_sysconfdir}/cups/{printers,classes,client,subscriptions}.conf touch ${RPM_BUILD_ROOT}%{_sysconfdir}/cups/lpoptions install -d ${RPM_BUILD_ROOT}%{_datadir}/ppd +# Remove unshipped files. +rm -rf %{buildroot}%{_mandir}/cat? %{buildroot}%{_mandir}/*/cat? +rm -f %{buildroot}%{_datadir}/applications/cups.desktop +rm -rf %{buildroot}%{_datadir}/icons +# there are pdf-banners shipped with cups-filters (#919489) +rm -rf %{buildroot}%{_datadir}/cups/banners +rm -f %{buildroot}%{_datadir}/cups/data/testprint + install -d ${RPM_BUILD_ROOT}%{_tmpfilesdir} cat > ${RPM_BUILD_ROOT}%{_tmpfilesdir}/cups.conf < %{name}.lang -%pre - -%preun -%systemd_preun %{name}.path %{name}.socket %{name}.service -%systemd_preun cups-lpd.socket - %post - %systemd_post %{name}.path %{name}.socket %{name}.service install -d ${RPM_BUILD_ROOT}%{_localstatedir}/run/cups/certs /bin/sed -i -e "s,^PageLogFormat,#PageLogFormat,i" %{_sysconfdir}/cups/cups-files.conf +%post client +/usr/sbin/alternatives --install %{_bindir}/lpr print %{_bindir}/lpr.cups 40 \ + --slave %{_bindir}/lp print-lp %{_bindir}/lp.cups \ + --slave %{_bindir}/lpq print-lpq %{_bindir}/lpq.cups \ + --slave %{_bindir}/lprm print-lprm %{_bindir}/lprm.cups \ + --slave %{_bindir}/lpstat print-lpstat %{_bindir}/lpstat.cups \ + --slave %{_bindir}/cancel print-cancel %{_bindir}/cancel.cups \ + --slave %{_sbindir}/lpc print-lpc %{_sbindir}/lpc.cups \ + --slave %{_mandir}/man1/cancel.1.gz print-cancelman %{_mandir}/man1/cancel-cups.1.gz \ + --slave %{_mandir}/man1/lp.1.gz print-lpman %{_mandir}/man1/lp-cups.1.gz \ + --slave %{_mandir}/man8/lpc.8.gz print-lpcman %{_mandir}/man8/lpc-cups.8.gz \ + --slave %{_mandir}/man1/lpq.1.gz print-lpqman %{_mandir}/man1/lpq-cups.1.gz \ + --slave %{_mandir}/man1/lpr.1.gz print-lprman %{_mandir}/man1/lpr-cups.1.gz \ + --slave %{_mandir}/man1/lprm.1.gz print-lprmman %{_mandir}/man1/lprm-cups.1.gz \ + --slave %{_mandir}/man1/lpstat.1.gz print-lpstatman %{_mandir}/man1/lpstat-cups.1.gz || : + +%post lpd %systemd_post cups-lpd.socket -exit 0 - -%post libs -p /sbin/ldconfig + +%ldconfig_scriptlets libs + +%preun +%systemd_preun %{name}.path %{name}.socket %{name}.service + +%preun client +if [ $1 -eq 0 ] ; then + /usr/sbin/alternatives --remove print %{_bindir}/lpr.cups || : +fi + +%preun lpd +%systemd_preun cups-lpd.socket %postun - %systemd_postun_with_restart %{name}.path %{name}.socket %{name}.service + +%postun lpd %systemd_postun_with_restart cups-lpd.socket -exit 0 - -%postun libs -p /sbin/ldconfig %triggerin -- samba-client ln -sf %{_libexecdir}/samba/cups_backend_smb %{_exec_prefix}/lib/cups/backend/smb || : @@ -217,13 +296,77 @@ exit 0 rm -f %{_exec_prefix}/lib/cups/backend/smb %files -f %{name}.lang +%{_bindir}/cupstestppd +%{_bindir}/ppd* +%{_sbindir}/* +# client subpackage +%exclude %{_sbindir}/lpc.cups +%dir %{cups_serverbin}/daemon +%{cups_serverbin}/daemon/cups-deviced +%{cups_serverbin}/daemon/cups-driverd +%{cups_serverbin}/daemon/cups-exec +%{cups_serverbin}/backend/* +%{cups_serverbin}/cgi-bin +%{cups_serverbin}/filter/* +%{cups_serverbin}/monitor +%{cups_serverbin}/notifier +%{_datadir}/cups/drv/sample.drv +%{_datadir}/cups/examples +%{_datadir}/cups/mime/mime.types +%{_datadir}/cups/mime/mime.convs +%{_datadir}/cups/ppdc/*.defs +%{_datadir}/cups/ppdc/*.h +%dir %{_datadir}/cups/templates +%{_datadir}/cups/templates/*.tmpl +%dir %{_datadir}/cups/templates/de +%{_datadir}/cups/templates/de/*.tmpl +%dir %{_datadir}/cups/templates/es +%{_datadir}/cups/templates/es/*.tmpl +%dir %{_datadir}/cups/templates/fr +%{_datadir}/cups/templates/fr/*.tmpl +%dir %{_datadir}/cups/templates/ja +%{_datadir}/cups/templates/ja/*.tmpl +%dir %{_datadir}/cups/templates/pt_BR +%{_datadir}/cups/templates/pt_BR/*.tmpl +%dir %{_datadir}/cups/templates/ru +%{_datadir}/cups/templates/ru/*.tmpl +%dir %{_datadir}/%{name}/usb +%{_datadir}/%{name}/usb/org.cups.usb-quirks +%dir %{_datadir}/%{name}/www +%{_datadir}/%{name}/www/images +%{_datadir}/%{name}/www/*.css +# 1658673 - html files cannot be docs, because CUPS web ui will not have +# introduction page on Fedora Docker image (because rpms are installed +# without docs there because of space reasons) +%dir %{_datadir}/%{name}/www/de +%dir %{_datadir}/%{name}/www/es +%dir %{_datadir}/%{name}/www/ja +%dir %{_datadir}/%{name}/www/pt_BR +%dir %{_datadir}/%{name}/www/ru +%{_datadir}/pixmaps/cupsprinter.png +%dir %attr(1770,root,lp) %{_localstatedir}/spool/cups/tmp +%dir %attr(0710,root,lp) %{_localstatedir}/spool/cups +%dir %attr(0755,root,lp) %{_localstatedir}/log/cups +# client subpackage +%exclude %{_mandir}/man1/lp*.1.gz +%exclude %{_mandir}/man1/cancel-cups.1.gz +%exclude %{_mandir}/man8/lpc-cups.8.gz +# devel subpackage +%exclude %{_mandir}/man1/cups-config.1.gz +# ipptool subpackage +%exclude %{_mandir}/man1/ipptool.1.gz +%exclude %{_mandir}/man5/ipptoolfile.5.gz +# lpd subpackage +%exclude %{_mandir}/man8/cups-lpd.8.gz +# printerapp +%exclude %{_mandir}/man1/ippeveprinter.1.gz +%exclude %{_mandir}/man7/ippevepcl.7.gz +%exclude %{_mandir}/man7/ippeveps.7.gz +%dir %attr(0755,root,lp) %{_rundir}/cups +%dir %attr(0511,lp,sys) %{_rundir}/cups/certs %dir %attr(0755,root,lp) %{_sysconfdir}/cups -%dir %attr(0755,root,lp) %{_localstatedir}/run/cups -%dir %attr(0511,lp,sys) %{_localstatedir}/run/cups/certs -%{_tmpfilesdir}/cups.conf -%{_tmpfilesdir}/cups-lp.conf -%verify(not md5 size mtime) %config(noreplace) %attr(0640,root,lp) %{_sysconfdir}/cups/cupsd.conf %attr(0640,root,lp) %{_sysconfdir}/cups/cupsd.conf.default +%verify(not md5 size mtime) %config(noreplace) %attr(0640,root,lp) %{_sysconfdir}/cups/cupsd.conf %verify(not md5 size mtime) %config(noreplace) %attr(0640,root,lp) %{_sysconfdir}/cups/cups-files.conf %attr(0640,root,lp) %{_sysconfdir}/cups/cups-files.conf.default %verify(not md5 size mtime) %config(noreplace) %attr(0644,root,lp) %{_sysconfdir}/cups/client.conf @@ -235,92 +378,73 @@ rm -f %{_exec_prefix}/lib/cups/backend/smb %verify(not md5 size mtime) %config(noreplace) %attr(0644,root,lp) %{_sysconfdir}/cups/lpoptions %dir %attr(0755,root,lp) %{_sysconfdir}/cups/ppd %dir %attr(0700,root,lp) %{_sysconfdir}/cups/ssl -%config(noreplace) %{_sysconfdir}/pam.d/cups -%config(noreplace) %{_sysconfdir}/logrotate.d/cups %config(noreplace) %{_sysconfdir}/dbus-1/system.d/cups.conf - +%config(noreplace) %{_sysconfdir}/pam.d/cups +%{_tmpfilesdir}/cups.conf +%{_tmpfilesdir}/cups-lp.conf +%attr(0644, root, root)%{_unitdir}/%{name}.service +%attr(0644, root, root)%{_unitdir}/%{name}.socket +%attr(0644, root, root)%{_unitdir}/%{name}.path + +%files client +%{_bindir}/cancel* +%{_bindir}/lp* +%{_sbindir}/lpc.cups +%{_mandir}/man1/cancel-cups.1.gz +%{_mandir}/man1/lp*.1.gz +%{_mandir}/man8/lpc-cups.8.gz + +%files libs +%{license} LICENSE +%{license} NOTICE +%{_libdir}/libcups.so.2 +%{_libdir}/libcupsimage.so.2 + +%files filesystem +%dir %{cups_serverbin} +%dir %{cups_serverbin}/backend +%dir %{cups_serverbin}/driver +%dir %{cups_serverbin}/filter +%dir %{_datadir}/cups %dir %{_datadir}/cups/data %dir %{_datadir}/cups/drv %dir %{_datadir}/cups/mime %dir %{_datadir}/cups/model %dir %{_datadir}/cups/ppdc %dir %{_datadir}/ppd -%exclude %{_mandir}/cat? -%exclude %{_mandir}/*/cat? -%exclude %{_datadir}/applications/cups.desktop -%exclude %{_datadir}/icons -%exclude %{_datadir}/cups/banners -%exclude %{_datadir}/cups/data/testprint - -%{_unitdir}/%{name}.service -%{_unitdir}/%{name}.socket -%{_unitdir}/%{name}.path -%{_unitdir}/cups-lpd.socket -%{_unitdir}/cups-lpd@.service -%{_bindir}/cupstestppd -#%%{_bindir}/cupstestdsc -%{_bindir}/ppd* -%{_bindir}/cancel* -%{_bindir}/lp* -%{_bindir}/ipptool + +%files devel +%{_bindir}/cups-config +%{_includedir}/cups +%{_libdir}/*.so +%{_mandir}/man1/cups-config.1.gz +%{_rpmconfigdir}/macros.d/macros.cups + +%files lpd +%{cups_serverbin}/daemon/cups-lpd +%{_mandir}/man8/cups-lpd.8.gz +%attr(0644, root, root)%{_unitdir}/cups-lpd.socket +%attr(0644, root, root)%{_unitdir}/cups-lpd@.service + +%files ipptool %{_bindir}/ippfind +%{_bindir}/ipptool +%dir %{_datadir}/cups/ipptool +%{_datadir}/cups/ipptool/* +%{_mandir}/man1/ipptool.1.gz +%{_mandir}/man5/ipptoolfile.5.gz + +%files printerapp %{_bindir}/ippeveprinter -%{_sbindir}/* %dir %{cups_serverbin}/command %{cups_serverbin}/command/ippevepcl %{cups_serverbin}/command/ippeveps - -%{_exec_prefix}/lib/cups/backend/* -%{_exec_prefix}/lib/cups/cgi-bin -%dir %{_exec_prefix}/lib/cups/driver -%dir %{_exec_prefix}/lib/cups/daemon -%{_exec_prefix}/lib/cups/daemon/cups-deviced -%{_exec_prefix}/lib/cups/daemon/cups-driverd -%{_exec_prefix}/lib/cups/daemon/cups-exec -%{_exec_prefix}/lib/cups/notifier -%{_exec_prefix}/lib/cups/filter/* -%{_exec_prefix}/lib/cups/monitor -%{_exec_prefix}/lib/cups/daemon/cups-lpd - -%{_datadir}/cups/templates/*.tmpl -%{_datadir}/cups/templates/de/*.tmpl -%{_datadir}/cups/templates/fr/*.tmpl -%{_datadir}/cups/templates/es/*.tmpl -%{_datadir}/cups/templates/ja/*.tmpl -%{_datadir}/cups/templates/ru/*.tmpl -%{_datadir}/cups/templates/pt_BR/*.tmpl -%dir %attr(1770,root,lp) %{_localstatedir}/spool/cups/tmp -%dir %attr(0710,root,lp) %{_localstatedir}/spool/cups -%dir %attr(0755,root,lp) %{_localstatedir}/log/cups -%{_datadir}/pixmaps/cupsprinter.png - -%{_datadir}/cups/drv/sample.drv -%{_datadir}/cups/examples -%{_datadir}/cups/mime/mime.types -%{_datadir}/cups/mime/mime.convs -%{_datadir}/cups/ppdc/*.defs -%{_datadir}/cups/ppdc/*.h - -%{_datadir}/%{name}/www/images -%{_datadir}/%{name}/www/*.css -%dir %{_datadir}/%{name}/usb -%{_datadir}/%{name}/usb/org.cups.usb-quirks -%dir %{_datadir}/cups/ipptool -%{_datadir}/cups/ipptool/* - -%files libs -%{license} LICENSE NOTICE -%{_libdir}/lib*.so.* - -%files devel -%{_bindir}/cups-config -%{_libdir}/*.so -%{_includedir}/cups -%{_rpmconfigdir}/macros.d/macros.cups +%{_mandir}/man1/ippeveprinter.1.gz +%{_mandir}/man7/ippevepcl.7.gz +%{_mandir}/man7/ippeveps.7.gz %files help %{_mandir}/man[1578]/* - %doc README.md CREDITS.md CHANGES.md %doc %{_datadir}/%{name}/www/index.html %doc %{_datadir}/%{name}/www/help @@ -333,6 +457,9 @@ rm -f %{_exec_prefix}/lib/cups/backend/smb %doc %{_datadir}/%{name}/www/apple-touch-icon.png %changelog +* Mon Nov 29 2021 hanhui - 2.3.3op2-1 +- DESC:update to cups-2.3.3op2 + * Thu Nov 04 2021 wangkerong - 2.3.3-8 - Type:bugfix - ID:NA @@ -404,3 +531,4 @@ rm -f %{_exec_prefix}/lib/cups/backend/smb * Wed Sep 18 2019 Guan Yanjie - 2.2.8-6 - Package init + diff --git a/ncp.backend b/ncp.backend deleted file mode 100644 index d57ada1bcf99a05ecc87f3265213a8cbaff73da9..0000000000000000000000000000000000000000 --- a/ncp.backend +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh -# This is a modified version of 'ncpprint'. It can now be used as a CUPS -# backend. -# Modifications: -# Copyright (C) 2002 Red Hat, inc -# Copyright (C) 2002 Tim Waugh -# Before modification: shipped as /usr/share/printconf/util/ncpprint - -if [ -z "$*" ] -then - # This is where we would enumerate all the URIs we support. - # Patches welcome. - exit 0 -fi - -FILE=$6 -if [ -z "$FILE" ] -then - FILE=- -fi - -# $DEVICE_URI is 'ncp://[user:password@]server/queue' -URI=${DEVICE_URI#*://} -queue=${URI#*/} -URI=${URI%/$queue} -server=${URI#*@} -URI=${URI%$server} -URI=${URI%@} -if [ -n "$URI" ] -then - user=${URI%:*} - URI=${URI#$user} - password=${URI#:} -fi - -#echo user: ${user-(none)} -#echo password: ${password-(none)} -#echo server: $server -#echo queue: $queue - -if [ -n "$user" ] -then - if [ -n "$password" ] - then - /usr/bin/nprint -S "$server" -q "$queue" -U "$user" -P "$password" -N "$FILE" 2>/dev/null - else - /usr/bin/nprint -S "$server" -q "$queue" -U "$user" -n -N "$FILE" 2>/dev/null - fi -else - /usr/bin/nprint -S "$server" -q "$queue" -N "$FILE" 2>/dev/null -fi