From 8313ea2b0c48678e7cf863ae25b48297801011d8 Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Mon, 18 Nov 2019 19:00:44 +0100 Subject: [PATCH] 2.3.0 - new printerapp subpackage --- .gitignore | 1 + ...d-for-old-Samsung-drivers-Issue-5562.patch | 34 - ...nux-session-cookies-used-a-predictab.patch | 22 - ...of-printer-resource-files-Issue-5652.patch | 110 ++ ...y-leaks-found-by-Coverity-Issue-5375.patch | 206 ---- ...ulti-file-jobs-Issue-5359-Issue-5413.patch | 56 - cups-0755.patch | 21 - cups-accesslog-null.patch | 13 - cups-avahi-address.patch | 95 -- cups-avahi-no-threaded.patch | 1029 ----------------- cups-cupsenumdests2.patch | 509 -------- cups-dnssd-deviceid.patch | 38 - cups-dont-send-http-options-field.patch | 13 - cups-eggcups.patch | 38 +- cups-epson-A6-crash.patch | 13 - cups-failover-backend.patch | 22 +- cups-ippeve-webui.patch | 124 -- cups-ippvalidateattr-regression.patch | 63 - cups-journal-history.patch | 109 -- cups-lpr-help.patch | 48 - cups-lspp.patch | 252 ++-- cups-multilib.patch | 10 +- cups-no-dest.patch | 19 - cups-no-gcry.patch | 12 - cups-no-gzip-man.patch | 18 - cups-peercred.patch | 11 - cups-pid.patch | 37 - cups-res_init.patch | 26 - cups-serverbin-compat.patch | 193 ---- cups-str3382.patch | 62 - cups-strict-ppd-line-length.patch | 30 - cups-substitute-bad-attrs.patch | 141 --- cups-synconclose.patch | 4 +- cups-use-ipp1.1.patch | 12 - cups.spec | 241 ++-- sources | 2 +- 36 files changed, 378 insertions(+), 3256 deletions(-) delete mode 100644 0001-Add-a-workaround-for-old-Samsung-drivers-Issue-5562.patch delete mode 100644 0001-CVE-2018-4700-Linux-session-cookies-used-a-predictab.patch create mode 100644 0001-Fix-handling-of-printer-resource-files-Issue-5652.patch delete mode 100644 0001-Fix-memory-leaks-found-by-Coverity-Issue-5375.patch delete mode 100644 0001-Fix-stuck-multi-file-jobs-Issue-5359-Issue-5413.patch delete mode 100644 cups-0755.patch delete mode 100644 cups-accesslog-null.patch delete mode 100644 cups-avahi-address.patch delete mode 100644 cups-avahi-no-threaded.patch delete mode 100644 cups-cupsenumdests2.patch delete mode 100644 cups-dnssd-deviceid.patch delete mode 100644 cups-dont-send-http-options-field.patch delete mode 100644 cups-epson-A6-crash.patch delete mode 100644 cups-ippeve-webui.patch delete mode 100644 cups-ippvalidateattr-regression.patch delete mode 100644 cups-journal-history.patch delete mode 100644 cups-lpr-help.patch delete mode 100644 cups-no-dest.patch delete mode 100644 cups-no-gcry.patch delete mode 100644 cups-no-gzip-man.patch delete mode 100644 cups-peercred.patch delete mode 100644 cups-pid.patch delete mode 100644 cups-res_init.patch delete mode 100644 cups-serverbin-compat.patch delete mode 100644 cups-str3382.patch delete mode 100644 cups-strict-ppd-line-length.patch delete mode 100644 cups-substitute-bad-attrs.patch delete mode 100644 cups-use-ipp1.1.patch diff --git a/.gitignore b/.gitignore index 0f267cb..a5e2820 100644 --- a/.gitignore +++ b/.gitignore @@ -90,3 +90,4 @@ cups-1.4.4-source.tar.bz2 /cups-2.2.10-source.tar.gz /cups-2.2.11-source.tar.gz /cups-2.2.12-source.tar.gz +/cups-2.3.0-source.tar.gz diff --git a/0001-Add-a-workaround-for-old-Samsung-drivers-Issue-5562.patch b/0001-Add-a-workaround-for-old-Samsung-drivers-Issue-5562.patch deleted file mode 100644 index 28cf4ab..0000000 --- a/0001-Add-a-workaround-for-old-Samsung-drivers-Issue-5562.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 4c00fa533f99ed1b17fa14d33e2fd42c54c45bea Mon Sep 17 00:00:00 2001 -From: Michael R Sweet -Date: Mon, 15 Apr 2019 16:50:04 -0400 -Subject: [PATCH] Add a workaround for old Samsung drivers (Issue #5562) - -diff --git a/cups/ppd.c b/cups/ppd.c -index 8bda7c6a0..f958728cb 100644 ---- a/cups/ppd.c -+++ b/cups/ppd.c -@@ -1171,6 +1171,24 @@ _ppdOpen( - else if (!strcmp(string, "Plus90")) - ppd->landscape = 90; - } -+ else if (!strcmp(keyword, "Emulators") && string && ppd->num_emulations == 0) -+ { -+ /* -+ * Issue #5562: Samsung printer drivers incorrectly use Emulators keyword -+ * to configure themselves -+ * -+ * The Emulators keyword was loaded but never used by anything in CUPS, -+ * and has no valid purpose in CUPS. The old code was removed due to a -+ * memory leak (Issue #5475), so the following (new) code supports a single -+ * name for the Emulators keyword, allowing these drivers to work until we -+ * remove PPD and driver support entirely in a future version of CUPS. -+ */ -+ -+ ppd->num_emulations = 1; -+ ppd->emulations = calloc(1, sizeof(ppd_emul_t)); -+ -+ strlcpy(ppd->emulations[0].name, string, sizeof(ppd->emulations[0].name)); -+ } - else if (!strcmp(keyword, "JobPatchFile")) - { - /* diff --git a/0001-CVE-2018-4700-Linux-session-cookies-used-a-predictab.patch b/0001-CVE-2018-4700-Linux-session-cookies-used-a-predictab.patch deleted file mode 100644 index 2745b5d..0000000 --- a/0001-CVE-2018-4700-Linux-session-cookies-used-a-predictab.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/cgi-bin/var.c b/cgi-bin/var.c -index 316b67f05..12f3c8344 100644 ---- a/cgi-bin/var.c -+++ b/cgi-bin/var.c -@@ -1186,6 +1186,7 @@ cgi_set_sid(void) - const char *remote_addr, /* REMOTE_ADDR */ - *server_name, /* SERVER_NAME */ - *server_port; /* SERVER_PORT */ -+ struct timeval curtime; /* Current time */ - - - if ((remote_addr = getenv("REMOTE_ADDR")) == NULL) -@@ -1195,7 +1196,8 @@ cgi_set_sid(void) - if ((server_port = getenv("SERVER_PORT")) == NULL) - server_port = "SERVER_PORT"; - -- CUPS_SRAND(time(NULL)); -+ gettimeofday(&curtime, NULL); -+ CUPS_SRAND(curtime.tv_sec + curtime.tv_usec); - snprintf(buffer, sizeof(buffer), "%s:%s:%s:%02X%02X%02X%02X%02X%02X%02X%02X", - remote_addr, server_name, server_port, - (unsigned)CUPS_RAND() & 255, (unsigned)CUPS_RAND() & 255, diff --git a/0001-Fix-handling-of-printer-resource-files-Issue-5652.patch b/0001-Fix-handling-of-printer-resource-files-Issue-5652.patch new file mode 100644 index 0000000..382f5ce --- /dev/null +++ b/0001-Fix-handling-of-printer-resource-files-Issue-5652.patch @@ -0,0 +1,110 @@ +From eff8c82f6a43ee1816e3b5899381d525c3231d37 Mon Sep 17 00:00:00 2001 +From: Michael R Sweet +Date: Wed, 2 Oct 2019 14:06:02 -0400 +Subject: [PATCH] Fix handling of printer resource files (Issue #5652) +diff --git a/scheduler/client.c b/scheduler/client.c +index f693e7c49..c2ee8f12a 100644 +--- a/scheduler/client.c ++++ b/scheduler/client.c +@@ -1099,7 +1099,7 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */ + } + } + } +- else if (!strncmp(con->uri, "/admin", 6) || !strncmp(con->uri, "/printers", 9) || !strncmp(con->uri, "/classes", 8) || !strncmp(con->uri, "/help", 5) || !strncmp(con->uri, "/jobs", 5)) ++ else if (!buf[0] && (!strncmp(con->uri, "/admin", 6) || !strncmp(con->uri, "/classes", 8) || !strncmp(con->uri, "/help", 5) || !strncmp(con->uri, "/jobs", 5) || !strncmp(con->uri, "/printers", 9))) + { + if (!WebInterface) + { +@@ -1125,14 +1125,6 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */ + cupsdSetStringf(&con->command, "%s/cgi-bin/admin.cgi", ServerBin); + cupsdSetString(&con->options, strchr(con->uri + 6, '?')); + } +- else if (!strncmp(con->uri, "/printers", 9)) +- { +- cupsdSetStringf(&con->command, "%s/cgi-bin/printers.cgi", ServerBin); +- if (con->uri[9] && con->uri[10]) +- cupsdSetString(&con->options, con->uri + 9); +- else +- cupsdSetString(&con->options, NULL); +- } + else if (!strncmp(con->uri, "/classes", 8)) + { + cupsdSetStringf(&con->command, "%s/cgi-bin/classes.cgi", ServerBin); +@@ -1149,6 +1141,14 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */ + else + cupsdSetString(&con->options, NULL); + } ++ else if (!strncmp(con->uri, "/printers", 9)) ++ { ++ cupsdSetStringf(&con->command, "%s/cgi-bin/printers.cgi", ServerBin); ++ if (con->uri[9] && con->uri[10]) ++ cupsdSetString(&con->options, con->uri + 9); ++ else ++ cupsdSetString(&con->options, NULL); ++ } + else + { + cupsdSetStringf(&con->command, "%s/cgi-bin/help.cgi", ServerBin); +@@ -1458,7 +1458,7 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */ + break; + } + +- if (!strncmp(con->uri, "/admin", 6) || !strncmp(con->uri, "/printers", 9) || !strncmp(con->uri, "/classes", 8) || !strncmp(con->uri, "/help", 5) || !strncmp(con->uri, "/jobs", 5)) ++ if (!buf[0] && (!strncmp(con->uri, "/admin", 6) || !strncmp(con->uri, "/classes", 8) || !strncmp(con->uri, "/help", 5) || !strncmp(con->uri, "/jobs", 5) || !strncmp(con->uri, "/printers", 9))) + { + /* + * CGI output... +@@ -2701,6 +2701,7 @@ get_file(cupsd_client_t *con, /* I - Client connection */ + * Figure out the real filename... + */ + ++ filename[0] = '\0'; + language[0] = '\0'; + + if (!strncmp(con->uri, "/help", 5) && (con->uri[5] == '/' || !con->uri[5])) +@@ -2718,6 +2719,7 @@ get_file(cupsd_client_t *con, /* I - Client connection */ + + if ((p = cupsdFindDest(dest)) == NULL) + { ++ strlcpy(filename, "/", len); + cupsdLogClient(con, CUPSD_LOG_INFO, "No destination \"%s\" found.", dest); + return (NULL); + } +@@ -2754,6 +2756,7 @@ get_file(cupsd_client_t *con, /* I - Client connection */ + + if ((p = cupsdFindDest(dest)) == NULL) + { ++ strlcpy(filename, "/", len); + cupsdLogClient(con, CUPSD_LOG_INFO, "No destination \"%s\" found.", dest); + return (NULL); + } +@@ -2786,6 +2789,14 @@ get_file(cupsd_client_t *con, /* I - Client connection */ + + perm_check = 0; + } ++ else if (!strncmp(con->uri, "/admin", 6) || !strncmp(con->uri, "/classes", 8) || !strncmp(con->uri, "/jobs", 5) || !strncmp(con->uri, "/printers", 9)) ++ { ++ /* ++ * Admin/class/job/printer pages are served by CGI... ++ */ ++ ++ return (NULL); ++ } + else if (!strncmp(con->uri, "/rss/", 5) && !strchr(con->uri + 5, '/')) + snprintf(filename, len, "%s/rss/%s", CacheDir, con->uri + 5); + else if (!strncmp(con->uri, "/strings/", 9) && !strcmp(con->uri + strlen(con->uri) - 8, ".strings")) +@@ -2795,12 +2806,14 @@ get_file(cupsd_client_t *con, /* I - Client connection */ + + if ((p = cupsdFindDest(dest)) == NULL) + { ++ strlcpy(filename, "/", len); + cupsdLogClient(con, CUPSD_LOG_INFO, "No destination \"%s\" found.", dest); + return (NULL); + } + + if (!p->strings) + { ++ strlcpy(filename, "/", len); + cupsdLogClient(con, CUPSD_LOG_INFO, "No strings files for \"%s\".", dest); + return (NULL); + } diff --git a/0001-Fix-memory-leaks-found-by-Coverity-Issue-5375.patch b/0001-Fix-memory-leaks-found-by-Coverity-Issue-5375.patch deleted file mode 100644 index ec224c3..0000000 --- a/0001-Fix-memory-leaks-found-by-Coverity-Issue-5375.patch +++ /dev/null @@ -1,206 +0,0 @@ -diff --git a/backend/ipp.c b/backend/ipp.c -index 32eb3aaa4..2a880bd75 100644 ---- a/backend/ipp.c -+++ b/backend/ipp.c -@@ -3612,6 +3612,8 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */ - } - } - -+ cupsArrayDelete(new_reasons); -+ - _cupsMutexUnlock(&report_mutex); - - /* -diff --git a/cgi-bin/search.c b/cgi-bin/search.c -index 3956afc33..ad1f5ed0e 100644 ---- a/cgi-bin/search.c -+++ b/cgi-bin/search.c -@@ -361,4 +362,5 @@ void - cgiFreeSearch(void *search) /* I - Search context */ - { - regfree((regex_t *)search); -+ free(search); - } -diff --git a/cups/http-addrlist.c b/cups/http-addrlist.c -index 5d510140b..688901a7d 100644 ---- a/cups/http-addrlist.c -+++ b/cups/http-addrlist.c -@@ -612,6 +613,7 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p - if (!temp) - { - httpAddrFreeList(first); -+ freeaddrinfo(results); - _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(errno), 0); - return (NULL); - } -diff --git a/cups/http.c b/cups/http.c -index a9235b087..d9332cc83 100644 ---- a/cups/http.c -+++ b/cups/http.c -@@ -3915,7 +3915,7 @@ http_create( - if ((http = calloc(sizeof(http_t), 1)) == NULL) - { - _cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(errno), 0); -- httpAddrFreeList(addrlist); -+ httpAddrFreeList(myaddrlist); - return (NULL); - } - -diff --git a/ppdc/ppdc-source.cxx b/ppdc/ppdc-source.cxx -index be24cebae..4e8cba7bb 100644 ---- a/ppdc/ppdc-source.cxx -+++ b/ppdc/ppdc-source.cxx -@@ -2665,6 +2666,7 @@ ppdcSource::scan_file(ppdcFile *fp, // I - File to read - // Add it to the current option... - if (!o) - { -+ c->release(); - _cupsLangPrintf(stderr, - _("ppdc: Choice found on line %d of %s with no " - "Option."), fp->line, fp->filename); -diff --git a/scheduler/cups-driverd.cxx b/scheduler/cups-driverd.cxx -index 657eee0a0..b518a9325 100644 ---- a/scheduler/cups-driverd.cxx -+++ b/scheduler/cups-driverd.cxx -@@ -153,7 +153,7 @@ static ppd_info_t *add_ppd(const char *filename, const char *name, - size_t size, int model_number, int type, - const char *scheme); - static int cat_drv(const char *name, int request_id); --static int cat_ppd(const char *name, int request_id); -+static void cat_ppd(const char *name, int request_id); - static int cat_static(const char *name, int request_id); - static int cat_tar(const char *name, int request_id); - static int compare_inodes(struct stat *a, struct stat *b); -@@ -163,12 +163,12 @@ static int compare_names(const ppd_info_t *p0, - const ppd_info_t *p1); - static int compare_ppds(const ppd_info_t *p0, - const ppd_info_t *p1); --static int dump_ppds_dat(const char *filename); -+static void dump_ppds_dat(const char *filename); - static void free_array(cups_array_t *a); - static cups_file_t *get_file(const char *name, int request_id, - const char *subdir, char *buffer, - size_t bufsize, char **subfile); --static int list_ppds(int request_id, int limit, const char *opt); -+static void list_ppds(int request_id, int limit, const char *opt); - static int load_drivers(cups_array_t *include, - cups_array_t *exclude); - static int load_drv(const char *filename, const char *name, -@@ -204,13 +204,13 @@ main(int argc, /* I - Number of command-line args */ - */ - - if (argc == 3 && !strcmp(argv[1], "cat")) -- return (cat_ppd(argv[2], 0)); -+ cat_ppd(argv[2], 0); - else if ((argc == 2 || argc == 3) && !strcmp(argv[1], "dump")) -- return (dump_ppds_dat(argv[2])); -+ dump_ppds_dat(argv[2]); - else if (argc == 4 && !strcmp(argv[1], "get")) -- return (cat_ppd(argv[3], atoi(argv[2]))); -+ cat_ppd(argv[3], atoi(argv[2])); - else if (argc == 5 && !strcmp(argv[1], "list")) -- return (list_ppds(atoi(argv[2]), atoi(argv[3]), argv[4])); -+ list_ppds(atoi(argv[2]), atoi(argv[3]), argv[4]); - else - { - fputs("Usage: cups-driverd cat ppd-name\n", stderr); -@@ -428,7 +428,7 @@ cat_drv(const char *name, /* I - PPD name */ - * 'cat_ppd()' - Copy a PPD file to stdout. - */ - --static int /* O - Exit code */ -+static void - cat_ppd(const char *name, /* I - PPD name */ - int request_id) /* I - Request ID for response? */ - { -@@ -445,7 +445,7 @@ cat_ppd(const char *name, /* I - PPD name */ - if (strstr(name, "../")) - { - fputs("ERROR: Invalid PPD name.\n", stderr); -- return (1); -+ exit(1); - } - - strlcpy(scheme, name, sizeof(scheme)); -@@ -475,11 +475,11 @@ cat_ppd(const char *name, /* I - PPD name */ - puts("Content-Type: application/ipp\n"); - - if (!scheme[0]) -- return (cat_static(name, request_id)); -+ exit(cat_static(name, request_id)); - else if (!strcmp(scheme, "drv")) -- return (cat_drv(name, request_id)); -+ exit(cat_drv(name, request_id)); - else if (!strcmp(scheme, "file")) -- return (cat_tar(name, request_id)); -+ exit(cat_tar(name, request_id)); - else - { - /* -@@ -517,7 +517,7 @@ cat_ppd(const char *name, /* I - PPD name */ - cupsdSendIPPTrailer(); - } - -- return (1); -+ exit(1); - } - - /* -@@ -547,15 +547,15 @@ cat_ppd(const char *name, /* I - PPD name */ - - fprintf(stderr, "ERROR: [cups-driverd] Unable to execute \"%s\" - %s\n", - line, strerror(errno)); -- return (1); -+ exit(1); - } - } - - /* -- * Return with no errors... -+ * Exit with no errors... - */ - -- return (0); -+ exit(0); - } - - -@@ -778,7 +778,7 @@ compare_ppds(const ppd_info_t *p0, /* I - First PPD file */ - * 'dump_ppds_dat()' - Dump the contents of the ppds.dat file. - */ - --static int /* O - Exit status */ -+static void - dump_ppds_dat(const char *filename) /* I - Filename */ - { - char temp[1024]; /* ppds.dat filename */ -@@ -810,7 +810,7 @@ dump_ppds_dat(const char *filename) /* I - Filename */ - ppd->record.make_and_model, ppd->record.device_id, - ppd->record.scheme); - -- return (0); -+ exit(0); - } - - -@@ -1004,7 +1004,7 @@ get_file(const char *name, /* I - Name */ - * 'list_ppds()' - List PPD files. - */ - --static int /* O - Exit code */ -+static void - list_ppds(int request_id, /* I - Request ID */ - int limit, /* I - Limit */ - const char *opt) /* I - Option argument */ -@@ -1566,7 +1566,7 @@ list_ppds(int request_id, /* I - Request ID */ - if (request_id) - cupsdSendIPPTrailer(); - -- return (0); -+ exit(0); - } - - --- -2.17.1 - diff --git a/0001-Fix-stuck-multi-file-jobs-Issue-5359-Issue-5413.patch b/0001-Fix-stuck-multi-file-jobs-Issue-5359-Issue-5413.patch deleted file mode 100644 index 2d7ca02..0000000 --- a/0001-Fix-stuck-multi-file-jobs-Issue-5359-Issue-5413.patch +++ /dev/null @@ -1,56 +0,0 @@ -diff --git a/backend/socket.c b/backend/socket.c -index 675061dd9..68379e95b 100644 ---- a/backend/socket.c -+++ b/backend/socket.c -@@ -397,8 +397,10 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ - lseek(print_fd, 0, SEEK_SET); - } - -- tbytes = backendRunLoop(print_fd, device_fd, snmp_fd, &(addrlist->addr), 1, -- 0, backendNetworkSideCB); -+ if ((bytes = backendRunLoop(print_fd, device_fd, snmp_fd, &(addrlist->addr), 1, 0, backendNetworkSideCB)) < 0) -+ tbytes = -1; -+ else -+ tbytes = bytes; - - if (print_fd != 0 && tbytes >= 0) - _cupsLangPrintFilter(stderr, "INFO", _("Print file sent.")); -@@ -406,7 +408,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ - - fputs("STATE: +cups-waiting-for-job-completed\n", stderr); - -- if (waiteof) -+ if (waiteof && tbytes >= 0) - { - /* - * Shutdown the socket and wait for the other end to finish... -@@ -443,7 +445,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ - if (print_fd != 0) - close(print_fd); - -- return (CUPS_BACKEND_OK); -+ return (tbytes >= 0 ? CUPS_BACKEND_OK : CUPS_BACKEND_FAILED); - } - - -diff --git a/scheduler/main.c b/scheduler/main.c -index 4b3914ade..472b9946d 100644 ---- a/scheduler/main.c -+++ b/scheduler/main.c -@@ -1472,9 +1472,16 @@ process_children(void) - (!job->filters[i] && WIFEXITED(old_status))) - { /* Backend and filter didn't crash */ - if (job->filters[i]) -+ { - job->status = status; /* Filter failed */ -+ } - else -+ { - job->status = -status; /* Backend failed */ -+ -+ if (job->current_file < job->num_files) -+ cupsdSetJobState(job, IPP_JOB_ABORTED, CUPSD_JOB_FORCE, "Canceling multi-file job due to backend failure."); -+ } - } - - if (job->state_value == IPP_JOB_PROCESSING && diff --git a/cups-0755.patch b/cups-0755.patch deleted file mode 100644 index 0c3b18b..0000000 --- a/cups-0755.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -up cups-2.2.4/Makedefs.in.0755 cups-2.2.4/Makedefs.in ---- cups-2.2.4/Makedefs.in.0755 2017-06-30 20:39:59.411493947 +0200 -+++ cups-2.2.4/Makedefs.in 2017-06-30 20:43:29.553609350 +0200 -@@ -38,14 +38,14 @@ SHELL = /bin/sh - # Installation programs... - # - --INSTALL_BIN = $(LIBTOOL) $(INSTALL) -c -m @CUPS_EXE_FILE_PERM@ @INSTALL_STRIP@ -+INSTALL_BIN = $(LIBTOOL) $(INSTALL) -c -m 755 @INSTALL_STRIP@ - INSTALL_COMPDATA = $(INSTALL) -c -m 444 @INSTALL_GZIP@ - INSTALL_CONFIG = $(INSTALL) -c -m @CUPS_CONFIG_FILE_PERM@ - INSTALL_DATA = $(INSTALL) -c -m 444 - INSTALL_DIR = $(INSTALL) -d --INSTALL_LIB = $(LIBTOOL) $(INSTALL) -c -m @CUPS_EXE_FILE_PERM@ @INSTALL_STRIP@ -+INSTALL_LIB = $(LIBTOOL) $(INSTALL) -c -m 755 @INSTALL_STRIP@ - INSTALL_MAN = $(INSTALL) -c -m 444 --INSTALL_SCRIPT = $(INSTALL) -c -m @CUPS_EXE_FILE_PERM@ -+INSTALL_SCRIPT = $(INSTALL) -c -m 755 - - # - # Default user, group, and system groups for the scheduler... diff --git a/cups-accesslog-null.patch b/cups-accesslog-null.patch deleted file mode 100644 index fdb7d61..0000000 --- a/cups-accesslog-null.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/scheduler/log.c b/scheduler/log.c -index 74790dc35..b6226201f 100644 ---- a/scheduler/log.c -+++ b/scheduler/log.c -@@ -1046,7 +1047,7 @@ cupsdLogRequest(cupsd_client_t *con, /* I - Request to log */ - * Filter requests as needed... - */ - -- if (AccessLogLevel == CUPSD_ACCESSLOG_NONE) -+ if (AccessLogLevel == CUPSD_ACCESSLOG_NONE || !AccessLog) - return (1); - else if (AccessLogLevel < CUPSD_ACCESSLOG_ALL) - { diff --git a/cups-avahi-address.patch b/cups-avahi-address.patch deleted file mode 100644 index b8090ea..0000000 --- a/cups-avahi-address.patch +++ /dev/null @@ -1,95 +0,0 @@ -diff -up cups-2.2b2/cups/http-support.c.avahi-address cups-2.2b2/cups/http-support.c ---- cups-2.2b2/cups/http-support.c.avahi-address 2016-06-24 17:43:35.000000000 +0200 -+++ cups-2.2b2/cups/http-support.c 2016-06-27 15:31:34.201361844 +0200 -@@ -2340,7 +2340,7 @@ http_resolve_cb( - const char *type, /* I - Registration type */ - const char *domain, /* I - Domain (unused) */ - const char *hostTarget, /* I - Hostname */ -- const AvahiAddress *address, /* I - Address (unused) */ -+ const AvahiAddress *address, /* I - Address */ - uint16_t port, /* I - Port number */ - AvahiStringList *txt, /* I - TXT record */ - AvahiLookupResultFlags flags, /* I - Lookup flags (unused) */ -@@ -2493,39 +2493,62 @@ http_resolve_cb( - * getting the IP address of the .local name and then do reverse-lookups... - */ - -- http_addrlist_t *addrlist, /* List of addresses */ -- *addr; /* Current address */ -+ http_addr_t addr; -+ size_t addrlen; -+ int error; - - DEBUG_printf(("5http_resolve_cb: Looking up \"%s\".", hostTarget)); - -- snprintf(fqdn, sizeof(fqdn), "%d", ntohs(port)); -- if ((addrlist = httpAddrGetList(hostTarget, AF_UNSPEC, fqdn)) != NULL) -+ switch (address->proto) - { -- for (addr = addrlist; addr; addr = addr->next) -+ case AVAHI_PROTO_INET: -+ addr.ipv4.sin_family = AF_INET; -+ addrlen = sizeof (addr.ipv4.sin_addr); -+ memcpy (&addr.ipv4.sin_addr, &address->data, addrlen); -+ break; -+ case AVAHI_PROTO_INET6: -+ addr.ipv6.sin6_family = AF_INET6; -+ addrlen = sizeof (addr.ipv6.sin6_addr); -+ memcpy (&addr.ipv6.sin6_addr, &address->data, addrlen); -+ break; -+ default: -+ DEBUG_printf(("8http_resolve_cb: unknown address family %d", -+ address->proto)); -+ addrlen = 0; -+ } -+ -+ if (addrlen > 0) { -+ error = getnameinfo(&addr.addr, httpAddrLength (&addr), -+ fqdn, sizeof(fqdn), NULL, 0, NI_NAMEREQD); -+ -+ if (!error) - { -- int error = getnameinfo(&(addr->addr.addr), (socklen_t)httpAddrLength(&(addr->addr)), fqdn, sizeof(fqdn), NULL, 0, NI_NAMEREQD); -+ DEBUG_printf(("8http_resolve_cb: Found \"%s\".", fqdn)); - -- if (!error) -- { -- DEBUG_printf(("5http_resolve_cb: Found \"%s\".", fqdn)); -+ if ((hostptr = fqdn + strlen(fqdn) - 6) <= fqdn || -+ _cups_strcasecmp(hostptr, ".local")) - -- if ((hostptr = fqdn + strlen(fqdn) - 6) <= fqdn || -- _cups_strcasecmp(hostptr, ".local")) -- { -- hostTarget = fqdn; -- break; -- } -+ { -+ hostTarget = fqdn; - } -+ } else { -+ avahi_address_snprint (fqdn, sizeof (fqdn), address); -+ hostTarget = fqdn; -+ - #ifdef DEBUG -- else -- DEBUG_printf(("5http_resolve_cb: \"%s\" did not resolve: %d", -- httpAddrString(&(addr->addr), fqdn, sizeof(fqdn)), -- error)); -+ DEBUG_printf(("8http_resolve_cb: \"%s\" did not resolve: %d", -+ fqdn, error)); - #endif /* DEBUG */ - } - -- httpAddrFreeList(addrlist); - } -+ } else { -+ /* -+ * Use the IP address that responded... -+ */ -+ -+ avahi_address_snprint (fqdn, sizeof (fqdn), address); -+ hostTarget = fqdn; - } - - /* diff --git a/cups-avahi-no-threaded.patch b/cups-avahi-no-threaded.patch deleted file mode 100644 index a238b38..0000000 --- a/cups-avahi-no-threaded.patch +++ /dev/null @@ -1,1029 +0,0 @@ -diff -up cups-2.2.7/scheduler/avahi.c.avahi-no-threaded cups-2.2.7/scheduler/avahi.c ---- cups-2.2.7/scheduler/avahi.c.avahi-no-threaded 2018-04-03 14:27:17.067410826 +0200 -+++ cups-2.2.7/scheduler/avahi.c 2018-04-03 14:27:17.067410826 +0200 -@@ -0,0 +1,441 @@ -+/* -+ * "$Id$" -+ * -+ * Avahi poll implementation for the CUPS scheduler. -+ * -+ * Copyright (C) 2010, 2011 Red Hat, Inc. -+ * Authors: -+ * Tim Waugh -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * -+ * Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * -+ * Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -+ * OF THE POSSIBILITY OF SUCH DAMAGE. -+ * -+ * Contents: -+ * -+ * watch_read_cb - Read callback for file descriptor -+ * watch_write_cb - Write callback for file descriptor -+ * watched_fd_add_select() - Call cupsdAddSelect() as needed -+ * watch_new() - Create a new file descriptor watch -+ * watch_free() - Free a file descriptor watch -+ * watch_update() - Update watched events for a file descriptor -+ * watch_get_events() - Get events that happened for a file descriptor -+ * timeout_cb() - Run a timed Avahi callback -+ * timeout_new() - Set a wakeup time -+ * timeout_update() - Update the expiration time for a timeout -+ * timeout_free() - Free a timeout -+ * compare_watched_fds() - Compare watched file descriptors for array sorting -+ * avahi_cups_poll_new() - Create a new Avahi main loop object for CUPS -+ * avahi_cups_poll_free() - Free an Avahi main loop object for CUPS -+ * avahi_cups_poll_get() - Get the abstract poll API structure -+ */ -+ -+#include -+ -+#ifdef HAVE_AVAHI /* Applies to entire file... */ -+ -+/* -+ * Include necessary headers... -+ */ -+ -+#include "cupsd.h" -+ -+#if defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO) -+# include -+#endif /* HAVE_MALLOC_H && HAVE_MALLINFO */ -+ -+#ifdef HAVE_AVAHI -+# include -+#endif /* HAVE_AVAHI */ -+ -+ -+typedef struct -+{ -+ AvahiCupsPoll *cups_poll; -+ -+ int fd; -+ AvahiWatchEvent occurred; -+ cups_array_t *watches; -+} cupsd_watched_fd_t; -+ -+struct AvahiWatch -+{ -+ cupsd_watched_fd_t *watched_fd; -+ -+ AvahiWatchEvent events; -+ AvahiWatchCallback callback; -+ void *userdata; -+}; -+ -+struct AvahiTimeout -+{ -+ AvahiCupsPoll *cups_poll; -+ AvahiTimeoutCallback callback; -+ void *userdata; -+ cupsd_timeout_t *cupsd_timeout; -+}; -+ -+/* -+ * Local functions... -+ */ -+ -+static AvahiWatch * watch_new(const AvahiPoll *api, -+ int fd, -+ AvahiWatchEvent events, -+ AvahiWatchCallback callback, -+ void *userdata); -+static void watch_free(AvahiWatch *watch); -+static void watch_update(AvahiWatch *watch, -+ AvahiWatchEvent events); -+static AvahiWatchEvent watch_get_events(AvahiWatch *watch); -+ -+ -+/* -+ * 'watch_read_cb' - Read callback for file descriptor -+ */ -+ -+static void -+watch_read_cb (void *userdata) -+{ -+ AvahiWatch *watch; -+ cupsd_watched_fd_t *watched_fd = userdata; -+ watched_fd->occurred |= AVAHI_WATCH_IN; -+ for (watch = (AvahiWatch *)cupsArrayFirst(watched_fd->watches); -+ watch; -+ watch = (AvahiWatch *)cupsArrayNext(watched_fd->watches)) -+ { -+ if (watch->events & watched_fd->occurred) -+ { -+ (watch->callback) (watch, watched_fd->fd, -+ AVAHI_WATCH_IN, watch->userdata); -+ watched_fd->occurred &= ~AVAHI_WATCH_IN; -+ break; -+ } -+ } -+} -+ -+ -+/* -+ * 'watch_write_cb' - Write callback for file descriptor -+ */ -+ -+static void -+watch_write_cb (void *userdata) -+{ -+ AvahiWatch *watch; -+ cupsd_watched_fd_t *watched_fd = userdata; -+ watched_fd->occurred |= AVAHI_WATCH_OUT; -+ for (watch = (AvahiWatch *)cupsArrayFirst(watched_fd->watches); -+ watch; -+ watch = (AvahiWatch *)cupsArrayNext(watched_fd->watches)) -+ { -+ if (watch->events & watched_fd->occurred) -+ { -+ (watch->callback) (watch, watched_fd->fd, -+ AVAHI_WATCH_OUT, watch->userdata); -+ watched_fd->occurred &= ~AVAHI_WATCH_OUT; -+ break; -+ } -+ } -+} -+ -+ -+/* -+ * 'watched_fd_add_select' - Call cupsdAddSelect() as needed -+ */ -+ -+static int /* O - Watches? */ -+watched_fd_add_select (cupsd_watched_fd_t *watched_fd) -+{ -+ AvahiWatch *watch; -+ cupsd_selfunc_t read_cb = NULL, write_cb = NULL; -+ int any_watches = 0; -+ -+ for (watch = (AvahiWatch *)cupsArrayFirst(watched_fd->watches); -+ watch; -+ watch = (AvahiWatch *)cupsArrayNext(watched_fd->watches)) -+ { -+ any_watches = 1; -+ if (watch->events & (AVAHI_WATCH_IN | -+ AVAHI_WATCH_ERR | -+ AVAHI_WATCH_HUP)) -+ { -+ read_cb = (cupsd_selfunc_t)watch_read_cb; -+ if (write_cb != NULL) -+ break; -+ } -+ -+ if (watch->events & AVAHI_WATCH_OUT) -+ { -+ write_cb = (cupsd_selfunc_t)watch_write_cb; -+ if (read_cb != NULL) -+ break; -+ } -+ } -+ -+ if (read_cb || write_cb) -+ cupsdAddSelect (watched_fd->fd, read_cb, write_cb, watched_fd); -+ else -+ cupsdRemoveSelect (watched_fd->fd); -+ -+ return (any_watches); -+} -+ -+/* -+ * 'watch_new' - Create a new file descriptor watch -+ */ -+ -+static AvahiWatch * -+watch_new (const AvahiPoll *api, -+ int fd, -+ AvahiWatchEvent events, -+ AvahiWatchCallback callback, -+ void *userdata) -+{ -+ cupsd_watched_fd_t key, *watched_fd; -+ AvahiCupsPoll *cups_poll = api->userdata; -+ AvahiWatch *watch = malloc(sizeof(AvahiWatch)); -+ if (watch == NULL) -+ return (NULL); -+ -+ watch->events = events; -+ watch->callback = callback; -+ watch->userdata = userdata; -+ -+ key.fd = fd; -+ watched_fd = cupsArrayFind (cups_poll->watched_fds, &key); -+ if (watched_fd == NULL) -+ { -+ watched_fd = malloc(sizeof(cupsd_watched_fd_t)); -+ if (watched_fd == NULL) -+ { -+ free (watch); -+ return (NULL); -+ } -+ -+ watched_fd->fd = fd; -+ watched_fd->occurred = 0; -+ watched_fd->cups_poll = cups_poll; -+ watched_fd->watches = cupsArrayNew (NULL, NULL); -+ cupsArrayAdd (cups_poll->watched_fds, watched_fd); -+ } -+ -+ watch->watched_fd = watched_fd; -+ cupsArrayAdd(watched_fd->watches, watch); -+ watched_fd_add_select (watched_fd); -+ return (watch); -+} -+ -+ -+/* -+ * 'watch_free' - Free a file descriptor watch -+ */ -+ -+static void -+watch_free (AvahiWatch *watch) -+{ -+ cupsd_watched_fd_t *watched_fd = watch->watched_fd; -+ AvahiCupsPoll *cups_poll = watched_fd->cups_poll; -+ -+ cupsArrayRemove (watched_fd->watches, watch); -+ free (watch); -+ -+ if (!watched_fd_add_select (watched_fd)) -+ { -+ /* No more watches */ -+ cupsArrayRemove (cups_poll->watched_fds, watched_fd); -+ free (watched_fd); -+ } -+} -+ -+ -+/* -+ * 'watch_update' - Update watched events for a file descriptor -+ */ -+ -+static void -+watch_update (AvahiWatch *watch, -+ AvahiWatchEvent events) -+{ -+ watch->events = events; -+ watched_fd_add_select (watch->watched_fd); -+} -+ -+ -+/* -+ * 'watch_get_events' - Get events that happened for a file descriptor -+ */ -+ -+static AvahiWatchEvent -+watch_get_events (AvahiWatch *watch) -+{ -+ return (watch->watched_fd->occurred); -+} -+ -+ -+/* -+ * 'timeout_cb()' - Run a timed Avahi callback -+ */ -+ -+static void -+timeout_cb (cupsd_timeout_t *cupsd_timeout, void *userdata) -+{ -+ AvahiTimeout *timeout = userdata; -+ (timeout->callback) (timeout, timeout->userdata); -+} -+ -+ -+/* -+ * 'timeout_new' - Set a wakeup time -+ */ -+ -+static AvahiTimeout * -+timeout_new (const AvahiPoll *api, -+ const struct timeval *tv, -+ AvahiTimeoutCallback callback, -+ void *userdata) -+{ -+ AvahiTimeout *timeout; -+ AvahiCupsPoll *cups_poll = api->userdata; -+ -+ timeout = malloc(sizeof(AvahiTimeout)); -+ if (timeout == NULL) -+ return (NULL); -+ -+ timeout->cups_poll = cups_poll; -+ timeout->callback = callback; -+ timeout->userdata = userdata; -+ timeout->cupsd_timeout = cupsdAddTimeout (tv, -+ (cupsd_timeoutfunc_t)timeout_cb, -+ timeout); -+ cupsArrayAdd (cups_poll->timeouts, timeout); -+ return (timeout); -+} -+ -+ -+/* -+ * 'timeout_update' - Update the expiration time for a timeout -+ */ -+ -+static void -+timeout_update (AvahiTimeout *timeout, -+ const struct timeval *tv) -+{ -+ cupsdUpdateTimeout (timeout->cupsd_timeout, tv); -+} -+ -+ -+/* -+ * ' timeout_free' - Free a timeout -+ */ -+ -+static void -+timeout_free (AvahiTimeout *timeout) -+{ -+ cupsArrayRemove (timeout->cups_poll->timeouts, timeout); -+ cupsdRemoveTimeout (timeout->cupsd_timeout); -+ free (timeout); -+} -+ -+ -+/* -+ * 'compare_watched_fds' - Compare watched file descriptors for array sorting -+ */ -+static int -+compare_watched_fds(cupsd_watched_fd_t *p0, -+ cupsd_watched_fd_t *p1) -+{ -+ /* -+ * Compare by fd (no two elements have the same fd) -+ */ -+ -+ if (p0->fd == p1->fd) -+ return 0; -+ -+ return (p0->fd < p1->fd ? -1 : 1); -+} -+ -+ -+/* -+ * 'avahi_cups_poll_new' - Create a new Avahi main loop object for CUPS -+ */ -+ -+AvahiCupsPoll * -+avahi_cups_poll_new (void) -+{ -+ AvahiCupsPoll *cups_poll = malloc(sizeof(AvahiCupsPoll)); -+ if (cups_poll == NULL) -+ return (NULL); -+ -+ cups_poll->watched_fds = cupsArrayNew ((cups_array_func_t)compare_watched_fds, -+ NULL); -+ cups_poll->timeouts = cupsArrayNew (NULL, NULL); -+ -+ cups_poll->api.userdata = cups_poll; -+ cups_poll->api.watch_new = watch_new; -+ cups_poll->api.watch_free = watch_free; -+ cups_poll->api.watch_update = watch_update; -+ cups_poll->api.watch_get_events = watch_get_events; -+ -+ cups_poll->api.timeout_new = timeout_new; -+ cups_poll->api.timeout_update = timeout_update; -+ cups_poll->api.timeout_free = timeout_free; -+ -+ return (cups_poll); -+} -+ -+ -+/* -+ * 'avahi_cups_poll_free' - Free an Avahi main loop object for CUPS -+ */ -+void -+avahi_cups_poll_free (AvahiCupsPoll *cups_poll) -+{ -+ cupsd_watched_fd_t *watched_fd; -+ -+ for (watched_fd = (cupsd_watched_fd_t*)cupsArrayFirst(cups_poll->watched_fds); -+ watched_fd; -+ watched_fd = (cupsd_watched_fd_t*)cupsArrayNext(cups_poll->watched_fds)) -+ cupsArrayClear (watched_fd->watches); -+ -+ cupsArrayClear (cups_poll->watched_fds); -+ cupsArrayClear (cups_poll->timeouts); -+} -+ -+ -+/* -+ * 'avahi_cups_poll_get' - Get the abstract poll API structure -+ */ -+ -+const AvahiPoll * -+avahi_cups_poll_get (AvahiCupsPoll *cups_poll) -+{ -+ return (&cups_poll->api); -+} -+ -+ -+#endif /* HAVE_AVAHI ... from top of file */ -+ -+/* -+ * End of "$Id$". -+ */ -diff -up cups-2.2.7/scheduler/avahi.h.avahi-no-threaded cups-2.2.7/scheduler/avahi.h ---- cups-2.2.7/scheduler/avahi.h.avahi-no-threaded 2018-04-03 14:27:17.067410826 +0200 -+++ cups-2.2.7/scheduler/avahi.h 2018-04-03 14:27:17.067410826 +0200 -@@ -0,0 +1,69 @@ -+/* -+ * "$Id$" -+ * -+ * Avahi poll implementation for the CUPS scheduler. -+ * -+ * Copyright (C) 2010, 2011 Red Hat, Inc. -+ * Authors: -+ * Tim Waugh -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * -+ * Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * -+ * Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -+ * OF THE POSSIBILITY OF SUCH DAMAGE. -+ */ -+ -+#include -+ -+#ifdef HAVE_AVAHI -+# include -+# include -+#endif /* HAVE_AVAHI */ -+ -+#ifdef HAVE_AUTHORIZATION_H -+# include -+#endif /* HAVE_AUTHORIZATION_H */ -+ -+ -+#ifdef HAVE_AVAHI -+typedef struct -+{ -+ AvahiPoll api; -+ cups_array_t *watched_fds; -+ cups_array_t *timeouts; -+} AvahiCupsPoll; -+#endif /* HAVE_AVAHI */ -+ -+/* -+ * Prototypes... -+ */ -+ -+#ifdef HAVE_AVAHI -+extern AvahiCupsPoll * avahi_cups_poll_new(void); -+extern void avahi_cups_poll_free(AvahiCupsPoll *cups_poll); -+extern const AvahiPoll *avahi_cups_poll_get(AvahiCupsPoll *cups_poll); -+#endif /* HAVE_AVAHI */ -+ -+ -+/* -+ * End of "$Id$". -+ */ -diff -up cups-2.2.7/scheduler/cupsd.h.avahi-no-threaded cups-2.2.7/scheduler/cupsd.h ---- cups-2.2.7/scheduler/cupsd.h.avahi-no-threaded 2018-03-23 04:48:36.000000000 +0100 -+++ cups-2.2.7/scheduler/cupsd.h 2018-04-03 14:27:17.067410826 +0200 -@@ -118,6 +118,7 @@ extern const char *cups_hstrerror(int); - #include "colorman.h" - #include "conf.h" - #include "banners.h" -+#include "avahi.h" - #include "dirsvc.h" - #include "network.h" - #include "subscriptions.h" -@@ -138,6 +139,15 @@ extern const char *cups_hstrerror(int); - - typedef void (*cupsd_selfunc_t)(void *data); - -+#ifdef HAVE_AVAHI -+/* -+ * Timeout callback function type... -+ */ -+ -+typedef struct _cupsd_timeout_s cupsd_timeout_t; -+typedef void (*cupsd_timeoutfunc_t)(cupsd_timeout_t *timeout, void *data); -+#endif /* HAVE_AVAHI */ -+ - - /* - * Globals... -@@ -162,6 +172,9 @@ VAR int OnDemand VALUE(0); - /* Launched on demand */ - #endif /* HAVE_ONDEMAND */ - -+#ifdef HAVE_AVAHI -+VAR cups_array_t *Timeouts; /* Timed callbacks for main loop */ -+#endif /* HAVE_AVAHI */ - - /* - * Prototypes... -@@ -224,3 +237,15 @@ extern void cupsdStopSelect(void); - /* server.c */ - extern void cupsdStartServer(void); - extern void cupsdStopServer(void); -+ -+#ifdef HAVE_AVAHI -+extern void cupsdInitTimeouts(void); -+extern cupsd_timeout_t *cupsdAddTimeout (const struct timeval *tv, -+ cupsd_timeoutfunc_t cb, -+ void *data); -+extern cupsd_timeout_t *cupsdNextTimeout (long *delay); -+extern void cupsdRunTimeout (cupsd_timeout_t *timeout); -+extern void cupsdUpdateTimeout (cupsd_timeout_t *timeout, -+ const struct timeval *tv); -+extern void cupsdRemoveTimeout (cupsd_timeout_t *timeout); -+#endif /* HAVE_AVAHI */ -\ No newline at end of file -diff -up cups-2.2.7/scheduler/dirsvc.c.avahi-no-threaded cups-2.2.7/scheduler/dirsvc.c ---- cups-2.2.7/scheduler/dirsvc.c.avahi-no-threaded 2018-03-23 04:48:36.000000000 +0100 -+++ cups-2.2.7/scheduler/dirsvc.c 2018-04-03 14:30:13.099422499 +0200 -@@ -193,7 +193,7 @@ cupsdStartBrowsing(void) - cupsdUpdateDNSSDName(); - - # else /* HAVE_AVAHI */ -- if ((DNSSDMaster = avahi_threaded_poll_new()) == NULL) -+ if ((DNSSDMaster = avahi_cups_poll_new()) == NULL) - { - cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to create DNS-SD thread."); - -@@ -204,7 +204,7 @@ cupsdStartBrowsing(void) - { - int error; /* Error code, if any */ - -- DNSSDClient = avahi_client_new(avahi_threaded_poll_get(DNSSDMaster), AVAHI_CLIENT_NO_FAIL, dnssdClientCallback, NULL, &error); -+ DNSSDClient = avahi_client_new(avahi_cups_poll_get(DNSSDMaster), AVAHI_CLIENT_NO_FAIL, dnssdClientCallback, NULL, &error); - - if (DNSSDClient == NULL) - { -@@ -215,11 +215,9 @@ cupsdStartBrowsing(void) - if (FatalErrors & CUPSD_FATAL_BROWSE) - cupsdEndProcess(getpid(), 0); - -- avahi_threaded_poll_free(DNSSDMaster); -+ avahi_cups_poll_free(DNSSDMaster); - DNSSDMaster = NULL; - } -- else -- avahi_threaded_poll_start(DNSSDMaster); - } - # endif /* HAVE_DNSSD */ - } -@@ -635,7 +633,7 @@ dnssdClientCallback( - * Renew Avahi client... - */ - -- DNSSDClient = avahi_client_new(avahi_threaded_poll_get(DNSSDMaster), AVAHI_CLIENT_NO_FAIL, dnssdClientCallback, NULL, &error); -+ DNSSDClient = avahi_client_new(avahi_cups_poll_get(DNSSDMaster), AVAHI_CLIENT_NO_FAIL, dnssdClientCallback, NULL, &error); - - if (!DNSSDClient) - { -@@ -701,17 +699,11 @@ dnssdDeregisterInstance( - *srv = NULL; - - # else /* HAVE_AVAHI */ -- if (!from_callback) -- avahi_threaded_poll_lock(DNSSDMaster); -- - if (*srv) - { - avahi_entry_group_free(*srv); - *srv = NULL; - } -- -- if (!from_callback) -- avahi_threaded_poll_unlock(DNSSDMaster); - # endif /* HAVE_DNSSD */ - } - -@@ -1030,16 +1022,10 @@ dnssdRegisterInstance( - (void)commit; - - # else /* HAVE_AVAHI */ -- if (!from_callback) -- avahi_threaded_poll_lock(DNSSDMaster); -- - if (!*srv) - *srv = avahi_entry_group_new(DNSSDClient, dnssdRegisterCallback, NULL); - if (!*srv) - { -- if (!from_callback) -- avahi_threaded_poll_unlock(DNSSDMaster); -- - cupsdLogMessage(CUPSD_LOG_WARN, "DNS-SD registration of \"%s\" failed: %s", - name, dnssdErrorString(avahi_client_errno(DNSSDClient))); - return (0); -@@ -1154,9 +1140,6 @@ dnssdRegisterInstance( - cupsdLogMessage(CUPSD_LOG_DEBUG, "DNS-SD commit of \"%s\" failed.", - name); - } -- -- if (!from_callback) -- avahi_threaded_poll_unlock(DNSSDMaster); - # endif /* HAVE_DNSSD */ - - if (error) -@@ -1327,9 +1310,6 @@ dnssdStop(void) - DNSSDMaster = NULL; - - # else /* HAVE_AVAHI */ -- if (DNSSDMaster) -- avahi_threaded_poll_stop(DNSSDMaster); -- - if (DNSSDClient) - { - avahi_client_free(DNSSDClient); -@@ -1338,7 +1318,7 @@ dnssdStop(void) - - if (DNSSDMaster) - { -- avahi_threaded_poll_free(DNSSDMaster); -+ avahi_cups_poll_free(DNSSDMaster); - DNSSDMaster = NULL; - } - # endif /* HAVE_DNSSD */ -diff -up cups-2.2.7/scheduler/dirsvc.h.avahi-no-threaded cups-2.2.7/scheduler/dirsvc.h ---- cups-2.2.7/scheduler/dirsvc.h.avahi-no-threaded 2018-03-23 04:48:36.000000000 +0100 -+++ cups-2.2.7/scheduler/dirsvc.h 2018-04-03 14:27:17.068410820 +0200 -@@ -49,7 +49,7 @@ VAR cups_array_t *DNSSDPrinters VALUE(NU - VAR DNSServiceRef DNSSDMaster VALUE(NULL); - /* Master DNS-SD service reference */ - # else /* HAVE_AVAHI */ --VAR AvahiThreadedPoll *DNSSDMaster VALUE(NULL); -+VAR AvahiCupsPoll *DNSSDMaster VALUE(NULL); - /* Master polling interface for Avahi */ - VAR AvahiClient *DNSSDClient VALUE(NULL); - /* Client information */ -diff -up cups-2.2.7/scheduler/main.c.avahi-no-threaded cups-2.2.7/scheduler/main.c ---- cups-2.2.7/scheduler/main.c.avahi-no-threaded 2018-04-03 14:27:17.057410882 +0200 -+++ cups-2.2.7/scheduler/main.c 2018-04-03 14:27:17.069410814 +0200 -@@ -131,7 +131,10 @@ main(int argc, /* I - Number of comm - int service_idle_exit; - /* Idle exit on select timeout? */ - #endif /* HAVE_ONDEMAND */ -- -+#ifdef HAVE_AVAHI -+ cupsd_timeout_t *tmo; /* Next scheduled timed callback */ -+ long tmo_delay; /* Time before it must be called */ -+#endif /* HAVE_AVAHI */ - - #ifdef HAVE_GETEUID - /* -@@ -610,6 +613,14 @@ main(int argc, /* I - Number of comm - - httpInitialize(); - -+#ifdef HAVE_AVAHI -+ /* -+ * Initialize timed callback structures. -+ */ -+ -+ cupsdInitTimeouts(); -+#endif /* HAVE_AVAHI */ -+ - cupsdStartServer(); - - /* -@@ -928,6 +939,16 @@ main(int argc, /* I - Number of comm - } - #endif /* __APPLE__ */ - -+#ifdef HAVE_AVAHI -+ /* -+ * If a timed callback is due, run it. -+ */ -+ -+ tmo = cupsdNextTimeout (&tmo_delay); -+ if (tmo && tmo_delay == 0) -+ cupsdRunTimeout (tmo); -+#endif /* HAVE_AVAHI */ -+ - #ifndef __APPLE__ - /* - * Update the network interfaces once a minute... -@@ -1632,6 +1653,10 @@ select_timeout(int fds) /* I - Number - cupsd_job_t *job; /* Job information */ - cupsd_printer_t *printer; /* Printer information */ - const char *why; /* Debugging aid */ -+#ifdef HAVE_AVAHI -+ cupsd_timeout_t *tmo; /* Timed callback */ -+ long tmo_delay; /* Seconds before calling it */ -+#endif /* HAVE_AVAHI */ - - - cupsdLogMessage(CUPSD_LOG_DEBUG2, "select_timeout: JobHistoryUpdate=%ld", -@@ -1677,6 +1702,19 @@ select_timeout(int fds) /* I - Number - } - #endif /* __APPLE__ */ - -+#ifdef HAVE_AVAHI -+ /* -+ * See if there are any scheduled timed callbacks to run. -+ */ -+ -+ if ((tmo = cupsdNextTimeout(&tmo_delay)) != NULL && -+ (now + tmo_delay) < timeout) -+ { -+ timeout = tmo_delay; -+ why = "run a timed callback"; -+ } -+#endif /* HAVE_AVAHI */ -+ - /* - * Check whether we are accepting new connections... - */ -diff -up cups-2.2.7/scheduler/Makefile.avahi-no-threaded cups-2.2.7/scheduler/Makefile ---- cups-2.2.7/scheduler/Makefile.avahi-no-threaded 2018-03-23 04:48:36.000000000 +0100 -+++ cups-2.2.7/scheduler/Makefile 2018-04-03 14:27:17.069410814 +0200 -@@ -15,6 +15,7 @@ include ../Makedefs - - CUPSDOBJS = \ - auth.o \ -+ avahi.o \ - banners.o \ - cert.o \ - classes.o \ -@@ -38,7 +39,8 @@ CUPSDOBJS = \ - server.o \ - statbuf.o \ - subscriptions.o \ -- sysman.o -+ sysman.o \ -+ timeout.o - LIBOBJS = \ - filter.o \ - mime.o \ -diff -up cups-2.2.7/scheduler/timeout.c.avahi-no-threaded cups-2.2.7/scheduler/timeout.c ---- cups-2.2.7/scheduler/timeout.c.avahi-no-threaded 2018-04-03 14:27:17.069410814 +0200 -+++ cups-2.2.7/scheduler/timeout.c 2018-04-03 14:27:17.069410814 +0200 -@@ -0,0 +1,235 @@ -+/* -+ * "$Id$" -+ * -+ * Timeout functions for the Common UNIX Printing System (CUPS). -+ * -+ * Copyright (C) 2010, 2011 Red Hat, Inc. -+ * Authors: -+ * Tim Waugh -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * -+ * Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * -+ * Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -+ * OF THE POSSIBILITY OF SUCH DAMAGE. -+ * -+ * Contents: -+ * -+ * cupsdInitTimeouts() - Initialise timeout structure. -+ * cupsdAddTimeout() - Add a timed callback. -+ * cupsdNextTimeout() - Find the next enabled timed callback. -+ * cupsdUpdateTimeout() - Adjust the time of a timed callback or disable it. -+ * cupsdRemoveTimeout() - Discard a timed callback. -+ * compare_timeouts() - Compare timed callbacks for array sorting. -+ */ -+ -+#include -+ -+#ifdef HAVE_AVAHI /* Applies to entire file... */ -+ -+/* -+ * Include necessary headers... -+ */ -+ -+#include "cupsd.h" -+ -+#if defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO) -+# include -+#endif /* HAVE_MALLOC_H && HAVE_MALLINFO */ -+ -+#ifdef HAVE_AVAHI -+# include -+#endif /* HAVE_AVAHI */ -+ -+ -+struct _cupsd_timeout_s -+{ -+ struct timeval when; -+ int enabled; -+ cupsd_timeoutfunc_t callback; -+ void *data; -+}; -+ -+/* -+ * Local functions... -+ */ -+ -+/* -+ * 'compare_timeouts()' - Compare timed callbacks for array sorting. -+ */ -+ -+static int -+compare_addrs (void *p0, void *p1) -+{ -+ if (p0 == p1) -+ return (0); -+ if (p0 < p1) -+ return (-1); -+ return (1); -+} -+ -+static int -+compare_timeouts (cupsd_timeout_t *p0, cupsd_timeout_t *p1) -+{ -+ int addrsdiff = compare_addrs (p0, p1); -+ int tvdiff; -+ -+ if (addrsdiff == 0) -+ return (0); -+ -+ if (!p0->enabled || !p1->enabled) -+ { -+ if (!p0->enabled && !p1->enabled) -+ return (addrsdiff); -+ -+ return (p0->enabled ? -1 : 1); -+ } -+ -+ tvdiff = avahi_timeval_compare (&p0->when, &p1->when); -+ if (tvdiff != 0) -+ return (tvdiff); -+ -+ return (addrsdiff); -+} -+ -+ -+/* -+ * 'cupsdInitTimeouts()' - Initialise timeout structures. -+ */ -+ -+void -+cupsdInitTimeouts(void) -+{ -+ Timeouts = cupsArrayNew ((cups_array_func_t)compare_timeouts, NULL); -+} -+ -+ -+/* -+ * 'cupsdAddTimeout()' - Add a timed callback. -+ */ -+ -+cupsd_timeout_t * /* O - Timeout handle */ -+cupsdAddTimeout(const struct timeval *tv, /* I - Absolute time */ -+ cupsd_timeoutfunc_t cb, /* I - Callback function */ -+ void *data) /* I - User data */ -+{ -+ cupsd_timeout_t *timeout; -+ -+ timeout = malloc (sizeof(cupsd_timeout_t)); -+ if (timeout != NULL) -+ { -+ timeout->enabled = (tv != NULL); -+ if (tv) -+ { -+ timeout->when.tv_sec = tv->tv_sec; -+ timeout->when.tv_usec = tv->tv_usec; -+ } -+ -+ timeout->callback = cb; -+ timeout->data = data; -+ cupsArrayAdd (Timeouts, timeout); -+ } -+ -+ return timeout; -+} -+ -+ -+/* -+ * 'cupsdNextTimeout()' - Find the next enabled timed callback. -+ */ -+ -+cupsd_timeout_t * /* O - Next enabled timeout or NULL */ -+cupsdNextTimeout(long *delay) /* O - Seconds before scheduled */ -+{ -+ cupsd_timeout_t *first = cupsArrayFirst (Timeouts); -+ struct timeval curtime; -+ -+ if (first && !first->enabled) -+ first = NULL; -+ -+ if (first && delay) -+ { -+ gettimeofday (&curtime, NULL); -+ if (avahi_timeval_compare (&curtime, &first->when) > 0) -+ { -+ *delay = 0; -+ } else { -+ *delay = 1 + first->when.tv_sec - curtime.tv_sec; -+ if (first->when.tv_usec < curtime.tv_usec) -+ (*delay)--; -+ } -+ } -+ -+ return (first); -+} -+ -+ -+/* -+ * 'cupsdRunTimeout()' - Run a timed callback. -+ */ -+ -+void -+cupsdRunTimeout(cupsd_timeout_t *timeout) /* I - Timeout */ -+{ -+ if (!timeout) -+ return; -+ timeout->enabled = 0; -+ if (!timeout->callback) -+ return; -+ timeout->callback (timeout, timeout->data); -+} -+ -+/* -+ * 'cupsdUpdateTimeout()' - Adjust the time of a timed callback or disable it. -+ */ -+ -+void -+cupsdUpdateTimeout(cupsd_timeout_t *timeout, /* I - Timeout */ -+ const struct timeval *tv) /* I - Absolute time or NULL */ -+{ -+ cupsArrayRemove (Timeouts, timeout); -+ timeout->enabled = (tv != NULL); -+ if (tv) -+ { -+ timeout->when.tv_sec = tv->tv_sec; -+ timeout->when.tv_usec = tv->tv_usec; -+ } -+ cupsArrayAdd (Timeouts, timeout); -+} -+ -+ -+/* -+ * 'cupsdRemoveTimeout()' - Discard a timed callback. -+ */ -+ -+void -+cupsdRemoveTimeout(cupsd_timeout_t *timeout) /* I - Timeout */ -+{ -+ cupsArrayRemove (Timeouts, timeout); -+ free (timeout); -+} -+ -+ -+#endif /* HAVE_AVAHI ... from top of file */ -+ -+/* -+ * End of "$Id$". -+ */ diff --git a/cups-cupsenumdests2.patch b/cups-cupsenumdests2.patch deleted file mode 100644 index 9e2e9f1..0000000 --- a/cups-cupsenumdests2.patch +++ /dev/null @@ -1,509 +0,0 @@ -diff -up cups-2.2.4/cups/cups.h.cupsenumdests2 cups-2.2.4/cups/cups.h ---- cups-2.2.4/cups/cups.h.cupsenumdests2 2017-06-30 17:44:38.000000000 +0200 -+++ cups-2.2.4/cups/cups.h 2017-10-04 15:31:45.358029517 +0200 -@@ -527,11 +527,20 @@ extern int cupsEnumDests(unsigned flags - cups_ptype_t type, cups_ptype_t mask, - cups_dest_cb_t cb, void *user_data) - _CUPS_API_1_6; -+extern int cupsEnumDests2(http_t *http, unsigned flags, int msec, int *cancel, -+ cups_ptype_t type, cups_ptype_t mask, -+ cups_dest_cb_t cb, void *user_data) -+ _CUPS_API_1_6; - # ifdef __BLOCKS__ - extern int cupsEnumDestsBlock(unsigned flags, int msec, - int *cancel, cups_ptype_t type, - cups_ptype_t mask, - cups_dest_block_t block) -+ _CUPS_API_1_6; -+extern int cupsEnumDestsBlock2(http_t *http, unsigned flags, int msec, -+ int *cancel, cups_ptype_t type, -+ cups_ptype_t mask, -+ cups_dest_block_t block) - _CUPS_API_1_6; - # endif /* __BLOCKS__ */ - extern ipp_status_t cupsFinishDestDocument(http_t *http, -diff -up cups-2.2.4/cups/dest.c.cupsenumdests2 cups-2.2.4/cups/dest.c ---- cups-2.2.4/cups/dest.c.cupsenumdests2 2017-10-04 15:31:45.356029534 +0200 -+++ cups-2.2.4/cups/dest.c 2017-10-04 15:31:45.359029509 +0200 -@@ -1377,6 +1377,423 @@ cupsEnumDests( - return (1); - } - -+/* -+ * 'cupsEnumDests2()' - same as cupsEnumDests(), but for not default http connection -+ */ -+ -+int /* O - 1 on success, 0 on failure */ -+cupsEnumDests2( -+ http_t *http, /* I - Connection to server */ -+ unsigned flags, /* I - Enumeration flags */ -+ int msec, /* I - Timeout in milliseconds, -1 for indefinite */ -+ int *cancel, /* I - Pointer to "cancel" variable */ -+ cups_ptype_t type, /* I - Printer type bits */ -+ cups_ptype_t mask, /* I - Mask for printer type bits */ -+ cups_dest_cb_t cb, /* I - Callback function */ -+ void *user_data) /* I - User data */ -+{ -+ int i, /* Looping var */ -+ num_dests; /* Number of destinations */ -+ cups_dest_t *dests = NULL, /* Destinations */ -+ *dest; /* Current destination */ -+ const char *defprinter; /* Default printer */ -+ char name[1024], /* Copy of printer name */ -+ *instance, /* Pointer to instance name */ -+ *user_default; /* User default printer */ -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) -+ int count, /* Number of queries started */ -+ completed, /* Number of completed queries */ -+ remaining; /* Remainder of timeout */ -+ struct timeval curtime; /* Current time */ -+ _cups_dnssd_data_t data; /* Data for callback */ -+ _cups_dnssd_device_t *device; /* Current device */ -+# ifdef HAVE_DNSSD -+ int nfds, /* Number of files responded */ -+ main_fd; /* File descriptor for lookups */ -+ DNSServiceRef ipp_ref = NULL, /* IPP browser */ -+ local_ipp_ref = NULL; /* Local IPP browser */ -+# ifdef HAVE_SSL -+ DNSServiceRef ipps_ref = NULL,/* IPPS browser */ -+ local_ipps_ref = NULL; /* Local IPPS browser */ -+# endif /* HAVE_SSL */ -+# ifdef HAVE_POLL -+ struct pollfd pfd; /* Polling data */ -+# else -+ fd_set input; /* Input set for select() */ -+ struct timeval timeout; /* Timeout for select() */ -+# endif /* HAVE_POLL */ -+# else /* HAVE_AVAHI */ -+ int error; /* Error value */ -+ AvahiServiceBrowser *ipp_ref = NULL;/* IPP browser */ -+# ifdef HAVE_SSL -+ AvahiServiceBrowser *ipps_ref = NULL; /* IPPS browser */ -+# endif /* HAVE_SSL */ -+# endif /* HAVE_DNSSD */ -+#endif /* HAVE_DNSSD || HAVE_AVAHI */ -+ -+ -+ /* -+ * Range check input... -+ */ -+ -+ (void)flags; -+ -+ if (!cb) -+ return (0); -+ -+ /* -+ * Get ready to enumerate... -+ */ -+ -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) -+ memset(&data, 0, sizeof(data)); -+ -+ data.type = type; -+ data.mask = mask; -+ data.cb = cb; -+ data.user_data = user_data; -+ data.devices = cupsArrayNew3((cups_array_func_t)cups_dnssd_compare_devices, NULL, NULL, 0, NULL, (cups_afree_func_t)cups_dnssd_free_device); -+#endif /* HAVE_DNSSD || HAVE_AVAHI */ -+ -+ if (!(mask & CUPS_PRINTER_DISCOVERED) || !(type & CUPS_PRINTER_DISCOVERED)) -+ { -+ /* -+ * Get the list of local printers and pass them to the callback function... -+ */ -+ -+ num_dests = _cupsGetDests(http, IPP_OP_CUPS_GET_PRINTERS, NULL, -+ &dests, type, mask); -+ -+ if ((user_default = _cupsUserDefault(name, sizeof(name))) != NULL) -+ defprinter = name; -+ else if ((defprinter = cupsGetDefault2(http)) != NULL) -+ { -+ strlcpy(name, defprinter, sizeof(name)); -+ defprinter = name; -+ } -+ -+ if (defprinter) -+ { -+ /* -+ * Separate printer and instance name... -+ */ -+ -+ if ((instance = strchr(name, '/')) != NULL) -+ *instance++ = '\0'; -+ -+ /* -+ * Lookup the printer and instance and make it the default... -+ */ -+ -+ if ((dest = cupsGetDest(name, instance, num_dests, dests)) != NULL) -+ dest->is_default = 1; -+ } -+ -+ for (i = num_dests, dest = dests; -+ i > 0 && (!cancel || !*cancel); -+ i --, dest ++) -+ { -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) -+ const char *device_uri; /* Device URI */ -+#endif /* HAVE_DNSSD || HAVE_AVAHI */ -+ -+ if (!(*cb)(user_data, i > 1 ? CUPS_DEST_FLAGS_MORE : CUPS_DEST_FLAGS_NONE, -+ dest)) -+ break; -+ -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) -+ if (!dest->instance && (device_uri = cupsGetOption("device-uri", dest->num_options, dest->options)) != NULL && !strncmp(device_uri, "dnssd://", 8)) -+ { -+ /* -+ * Add existing queue using service name, etc. so we don't list it again... -+ */ -+ -+ char scheme[32], /* URI scheme */ -+ userpass[32], /* Username:password */ -+ serviceName[256], /* Service name (host field) */ -+ resource[256], /* Resource (options) */ -+ *regtype, /* Registration type */ -+ *replyDomain; /* Registration domain */ -+ int port; /* Port number (not used) */ -+ -+ if (httpSeparateURI(HTTP_URI_CODING_ALL, device_uri, scheme, sizeof(scheme), userpass, sizeof(userpass), serviceName, sizeof(serviceName), &port, resource, sizeof(resource)) >= HTTP_URI_STATUS_OK) -+ { -+ if ((regtype = strstr(serviceName, "._ipp")) != NULL) -+ { -+ *regtype++ = '\0'; -+ -+ if ((replyDomain = strstr(regtype, "._tcp.")) != NULL) -+ { -+ replyDomain[5] = '\0'; -+ replyDomain += 6; -+ -+ if ((device = cups_dnssd_get_device(&data, serviceName, regtype, replyDomain)) != NULL) -+ device->state = _CUPS_DNSSD_ACTIVE; -+ } -+ } -+ } -+ } -+#endif /* HAVE_DNSSD || HAVE_AVAHI */ -+ } -+ -+ cupsFreeDests(num_dests, dests); -+ -+ if (i > 0 || msec == 0) -+ goto enum_finished; -+ } -+ -+ /* -+ * Return early if the caller doesn't want to do discovery... -+ */ -+ -+ if ((mask & CUPS_PRINTER_DISCOVERED) && !(type & CUPS_PRINTER_DISCOVERED)) -+ goto enum_finished; -+ -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) -+ /* -+ * Get Bonjour-shared printers... -+ */ -+ -+ gettimeofday(&curtime, NULL); -+ -+# ifdef HAVE_DNSSD -+ if (DNSServiceCreateConnection(&data.main_ref) != kDNSServiceErr_NoError) -+ return (0); -+ -+ main_fd = DNSServiceRefSockFD(data.main_ref); -+ -+ ipp_ref = data.main_ref; -+ DNSServiceBrowse(&ipp_ref, kDNSServiceFlagsShareConnection, 0, -+ "_ipp._tcp", NULL, -+ (DNSServiceBrowseReply)cups_dnssd_browse_cb, &data); -+ -+ local_ipp_ref = data.main_ref; -+ DNSServiceBrowse(&local_ipp_ref, kDNSServiceFlagsShareConnection, -+ kDNSServiceInterfaceIndexLocalOnly, -+ "_ipp._tcp", NULL, -+ (DNSServiceBrowseReply)cups_dnssd_local_cb, &data); -+ -+# ifdef HAVE_SSL -+ ipps_ref = data.main_ref; -+ DNSServiceBrowse(&ipps_ref, kDNSServiceFlagsShareConnection, 0, -+ "_ipps._tcp", NULL, -+ (DNSServiceBrowseReply)cups_dnssd_browse_cb, &data); -+ -+ local_ipps_ref = data.main_ref; -+ DNSServiceBrowse(&local_ipps_ref, kDNSServiceFlagsShareConnection, -+ kDNSServiceInterfaceIndexLocalOnly, -+ "_ipps._tcp", NULL, -+ (DNSServiceBrowseReply)cups_dnssd_local_cb, &data); -+# endif /* HAVE_SSL */ -+ -+# else /* HAVE_AVAHI */ -+ if ((data.simple_poll = avahi_simple_poll_new()) == NULL) -+ { -+ DEBUG_puts("cupsEnumDests2: Unable to create Avahi simple poll object."); -+ return (1); -+ } -+ -+ avahi_simple_poll_set_func(data.simple_poll, cups_dnssd_poll_cb, &data); -+ -+ data.client = avahi_client_new(avahi_simple_poll_get(data.simple_poll), -+ 0, cups_dnssd_client_cb, &data, -+ &error); -+ if (!data.client) -+ { -+ DEBUG_puts("cupsEnumDests2: Unable to create Avahi client."); -+ avahi_simple_poll_free(data.simple_poll); -+ return (1); -+ } -+ -+ data.browsers = 1; -+ ipp_ref = avahi_service_browser_new(data.client, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, "_ipp._tcp", NULL, 0, cups_dnssd_browse_cb, &data); -+ -+# ifdef HAVE_SSL -+ data.browsers ++; -+ ipps_ref = avahi_service_browser_new(data.client, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, "_ipps._tcp", NULL, 0, cups_dnssd_browse_cb, &data); -+# endif /* HAVE_SSL */ -+# endif /* HAVE_DNSSD */ -+ -+ if (msec < 0) -+ remaining = INT_MAX; -+ else -+ remaining = msec; -+ -+ while (remaining > 0 && (!cancel || !*cancel)) -+ { -+ /* -+ * Check for input... -+ */ -+ -+ DEBUG_printf(("1cupsEnumDests2: remaining=%d", remaining)); -+ -+ cups_elapsed(&curtime); -+ -+# ifdef HAVE_DNSSD -+# ifdef HAVE_POLL -+ pfd.fd = main_fd; -+ pfd.events = POLLIN; -+ -+ nfds = poll(&pfd, 1, remaining > _CUPS_DNSSD_MAXTIME ? _CUPS_DNSSD_MAXTIME : remaining); -+ -+# else -+ FD_ZERO(&input); -+ FD_SET(main_fd, &input); -+ -+ timeout.tv_sec = 0; -+ timeout.tv_usec = 1000 * (remaining > _CUPS_DNSSD_MAXTIME ? _CUPS_DNSSD_MAXTIME : remaining); -+ -+ nfds = select(main_fd + 1, &input, NULL, NULL, &timeout); -+# endif /* HAVE_POLL */ -+ -+ if (nfds > 0) -+ DNSServiceProcessResult(data.main_ref); -+ -+# else /* HAVE_AVAHI */ -+ data.got_data = 0; -+ -+ if ((error = avahi_simple_poll_iterate(data.simple_poll, _CUPS_DNSSD_MAXTIME)) > 0) -+ { -+ /* -+ * We've been told to exit the loop. Perhaps the connection to -+ * Avahi failed. -+ */ -+ -+ break; -+ } -+ -+ DEBUG_printf(("1cupsEnumDests2: got_data=%d", data.got_data)); -+# endif /* HAVE_DNSSD */ -+ -+ remaining -= cups_elapsed(&curtime); -+ -+ for (device = (_cups_dnssd_device_t *)cupsArrayFirst(data.devices), -+ count = 0, completed = 0; -+ device; -+ device = (_cups_dnssd_device_t *)cupsArrayNext(data.devices)) -+ { -+ if (device->ref) -+ count ++; -+ -+ if (device->state == _CUPS_DNSSD_ACTIVE) -+ completed ++; -+ -+ if (!device->ref && device->state == _CUPS_DNSSD_NEW) -+ { -+ DEBUG_printf(("1cupsEnumDests2: Querying '%s'.", device->fullName)); -+ -+# ifdef HAVE_DNSSD -+ device->ref = data.main_ref; -+ -+ if (DNSServiceQueryRecord(&(device->ref), -+ kDNSServiceFlagsShareConnection, -+ 0, device->fullName, -+ kDNSServiceType_TXT, -+ kDNSServiceClass_IN, -+ (DNSServiceQueryRecordReply)cups_dnssd_query_cb, -+ &data) == kDNSServiceErr_NoError) -+ { -+ count ++; -+ } -+ else -+ { -+ device->ref = 0; -+ device->state = _CUPS_DNSSD_ERROR; -+ -+ DEBUG_puts("1cupsEnumDests2: Query failed."); -+ } -+ -+# else /* HAVE_AVAHI */ -+ if ((device->ref = avahi_record_browser_new(data.client, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, device->fullName, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_TXT, 0, cups_dnssd_query_cb, &data)) != NULL) -+ { -+ DEBUG_printf(("1cupsEnumDests2: Query ref=%p", device->ref)); -+ count ++; -+ } -+ else -+ { -+ device->state = _CUPS_DNSSD_ERROR; -+ -+ DEBUG_printf(("1cupsEnumDests2: Query failed: %s", avahi_strerror(avahi_client_errno(data.client)))); -+ } -+# endif /* HAVE_DNSSD */ -+ } -+ else if (device->ref && device->state == _CUPS_DNSSD_PENDING) -+ { -+ completed ++; -+ -+ DEBUG_printf(("1cupsEnumDests2: Query for \"%s\" is complete.", device->fullName)); -+ -+ if ((device->type & mask) == type) -+ { -+ DEBUG_printf(("1cupsEnumDests2: Add callback for \"%s\".", device->dest.name)); -+ if (!(*cb)(user_data, CUPS_DEST_FLAGS_NONE, &device->dest)) -+ { -+ remaining = -1; -+ break; -+ } -+ } -+ -+ device->state = _CUPS_DNSSD_ACTIVE; -+ } -+ } -+ -+# ifdef HAVE_AVAHI -+ DEBUG_printf(("1cupsEnumDests2: remaining=%d, browsers=%d, completed=%d, count=%d, devices count=%d", remaining, data.browsers, completed, count, cupsArrayCount(data.devices))); -+ -+ if (data.browsers == 0 && completed == cupsArrayCount(data.devices)) -+ break; -+# else -+ DEBUG_printf(("1cupsEnumDests2: remaining=%d, completed=%d, count=%d, devices count=%d", remaining, completed, count, cupsArrayCount(data.devices))); -+ -+ if (completed == cupsArrayCount(data.devices)) -+ break; -+# endif /* HAVE_AVAHI */ -+ } -+#endif /* HAVE_DNSSD || HAVE_AVAHI */ -+ -+ /* -+ * Return... -+ */ -+ -+ enum_finished: -+ -+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI) -+ cupsArrayDelete(data.devices); -+ -+# ifdef HAVE_DNSSD -+ if (ipp_ref) -+ DNSServiceRefDeallocate(ipp_ref); -+ if (local_ipp_ref) -+ DNSServiceRefDeallocate(local_ipp_ref); -+ -+# ifdef HAVE_SSL -+ if (ipps_ref) -+ DNSServiceRefDeallocate(ipps_ref); -+ if (local_ipps_ref) -+ DNSServiceRefDeallocate(local_ipps_ref); -+# endif /* HAVE_SSL */ -+ -+ if (data.main_ref) -+ DNSServiceRefDeallocate(data.main_ref); -+ -+# else /* HAVE_AVAHI */ -+ if (ipp_ref) -+ avahi_service_browser_free(ipp_ref); -+# ifdef HAVE_SSL -+ if (ipps_ref) -+ avahi_service_browser_free(ipps_ref); -+# endif /* HAVE_SSL */ -+ -+ if (data.client) -+ avahi_client_free(data.client); -+ if (data.simple_poll) -+ avahi_simple_poll_free(data.simple_poll); -+# endif /* HAVE_DNSSD */ -+#endif /* HAVE_DNSSD || HAVE_AVAHI */ -+ -+ return (1); -+} -+ - - # ifdef __BLOCKS__ - /* -@@ -1413,6 +1830,24 @@ cupsEnumDestsBlock( - return (cupsEnumDests(flags, timeout, cancel, type, mask, - (cups_dest_cb_t)cups_block_cb, (void *)block)); - } -+ -+/* -+ * 'cupsEnumDestsBlock2()' - same as cupsEnumDestsBlock(), only with non default http connection -+ */ -+ -+int /* O - 1 on success, 0 on failure */ -+cupsEnumDestsBlock2( -+ http_t *http, /* I - Connection to server@ */ -+ unsigned flags, /* I - Enumeration flags */ -+ int timeout, /* I - Timeout in milliseconds, 0 for indefinite */ -+ int *cancel, /* I - Pointer to "cancel" variable */ -+ cups_ptype_t type, /* I - Printer type bits */ -+ cups_ptype_t mask, /* I - Mask for printer type bits */ -+ cups_dest_block_t block) /* I - Block */ -+{ -+ return (cupsEnumDests2(http, flags, timeout, cancel, type, mask, -+ (cups_dest_cb_t)cups_block_cb, (void *)block)); -+} - # endif /* __BLOCKS__ */ - - -@@ -2057,7 +2492,13 @@ cupsGetDests2(http_t *http, /* I - - data.num_dests = 0; - data.dests = NULL; - -- cupsEnumDests(0, 1000, NULL, 0, 0, (cups_dest_cb_t)cups_get_cb, &data); -+ if (!http) -+ http = CUPS_HTTP_DEFAULT; -+ -+ if (http == CUPS_HTTP_DEFAULT) -+ cupsEnumDests(0, 1000, NULL, 0, 0, (cups_dest_cb_t)cups_get_cb, &data); -+ else -+ cupsEnumDests2(http, 0, 1000, NULL, 0, 0, (cups_dest_cb_t)cups_get_cb, &data); - - /* - * Make a copy of the "real" queues for a later sanity check... -diff -up cups-2.2.4/cups/util.c.cupsenumdests2 cups-2.2.4/cups/util.c ---- cups-2.2.4/cups/util.c.cupsenumdests2 2017-06-30 17:44:38.000000000 +0200 -+++ cups-2.2.4/cups/util.c 2017-10-04 15:36:08.453828842 +0200 -@@ -197,7 +197,13 @@ cupsCreateJob( - data.name = name; - data.dest = NULL; - -- cupsEnumDests(0, 1000, NULL, 0, 0, (cups_dest_cb_t)cups_create_cb, &data); -+ if (!http) -+ http = CUPS_HTTP_DEFAULT; -+ -+ if (http == CUPS_HTTP_DEFAULT) -+ cupsEnumDests(0, 1000, NULL, 0, 0, (cups_dest_cb_t)cups_create_cb, &data); -+ else -+ cupsEnumDests2(http, 0, 1000, NULL, 0, 0, (cups_dest_cb_t)cups_create_cb, &data); - - if (!data.dest) - { diff --git a/cups-dnssd-deviceid.patch b/cups-dnssd-deviceid.patch deleted file mode 100644 index 7bd2463..0000000 --- a/cups-dnssd-deviceid.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff -up cups-2.1.4/backend/dnssd.c.dnssd-deviceid cups-2.1.4/backend/dnssd.c ---- cups-2.1.4/backend/dnssd.c.dnssd-deviceid 2016-06-15 14:36:19.922353606 +0200 -+++ cups-2.1.4/backend/dnssd.c 2016-06-15 14:45:45.794966648 +0200 -@@ -1188,15 +1188,22 @@ query_callback( - if (device->device_id) - free(device->device_id); - -+if (device_id[0]) -+{ -+ /* Mark this as the real device ID. */ -+ ptr = device_id + strlen(device_id); -+ snprintf(ptr, sizeof(device_id) - (ptr - device_id), "FZY:0;"); -+} -+ - if (!device_id[0] && strcmp(model, "Unknown")) - { - if (make_and_model[0]) -- snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s;", -+ snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s;FZY:1;", - make_and_model, model); - else if (!_cups_strncasecmp(model, "designjet ", 10)) -- snprintf(device_id, sizeof(device_id), "MFG:HP;MDL:%s;", model + 10); -+ snprintf(device_id, sizeof(device_id), "MFG:HP;MDL:%s;FZY:1;", model + 10); - else if (!_cups_strncasecmp(model, "stylus ", 7)) -- snprintf(device_id, sizeof(device_id), "MFG:EPSON;MDL:%s;", model + 7); -+ snprintf(device_id, sizeof(device_id), "MFG:EPSON;MDL:%s;FZY:1;", model + 7); - else if ((ptr = strchr(model, ' ')) != NULL) - { - /* -@@ -1206,7 +1213,7 @@ query_callback( - memcpy(make_and_model, model, (size_t)(ptr - model)); - make_and_model[ptr - model] = '\0'; - -- snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s;", -+ snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s;FZY:1;", - make_and_model, ptr + 1); - } - } diff --git a/cups-dont-send-http-options-field.patch b/cups-dont-send-http-options-field.patch deleted file mode 100644 index 79af685..0000000 --- a/cups-dont-send-http-options-field.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/scheduler/client.c b/scheduler/client.c -index d057602..8960516 100644 ---- a/scheduler/client.c -+++ b/scheduler/client.c -@@ -1023,8 +1023,6 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */ - } - - httpClearFields(con->http); -- httpSetField(con->http, HTTP_FIELD_ALLOW, -- "GET, HEAD, OPTIONS, POST, PUT"); - httpSetField(con->http, HTTP_FIELD_CONTENT_LENGTH, "0"); - - if (!cupsdSendHeader(con, HTTP_STATUS_OK, NULL, CUPSD_AUTH_NONE)) diff --git a/cups-eggcups.patch b/cups-eggcups.patch index 20422c0..b49638e 100644 --- a/cups-eggcups.patch +++ b/cups-eggcups.patch @@ -1,7 +1,7 @@ -diff -up cups-2.2.10/backend/ipp.c.eggcups cups-2.2.10/backend/ipp.c ---- cups-2.2.10/backend/ipp.c.eggcups 2018-12-07 20:41:56.000000000 +0100 -+++ cups-2.2.10/backend/ipp.c 2018-12-14 14:17:25.594421897 +0100 -@@ -152,6 +152,70 @@ static char tmpfilename[1024] = ""; +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 */ @@ -72,7 +72,7 @@ diff -up cups-2.2.10/backend/ipp.c.eggcups cups-2.2.10/backend/ipp.c /* * Local functions... -@@ -1753,6 +1817,15 @@ main(int argc, /* I - Number of comm +@@ -1768,6 +1832,15 @@ main(int argc, /* I - Number of comm fprintf(stderr, "DEBUG: Print job accepted - job ID %d.\n", job_id); } @@ -88,22 +88,22 @@ diff -up cups-2.2.10/backend/ipp.c.eggcups cups-2.2.10/backend/ipp.c ippDelete(response); if (job_canceled) -diff -up cups-2.2.10/backend/Makefile.eggcups cups-2.2.10/backend/Makefile ---- cups-2.2.10/backend/Makefile.eggcups 2018-12-14 14:17:25.595421889 +0100 -+++ cups-2.2.10/backend/Makefile 2018-12-14 14:18:52.465712525 +0100 -@@ -263,7 +263,7 @@ dnssd: dnssd.o ../cups/$(LIBCUPS) libbac +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) $(LDFLAGS) -o ipp ipp.o libbackend.a $(LIBS) -+ $(LD_CC) $(LDFLAGS) -o ipp ipp.o libbackend.a $(LIBS) $(SERVERLIBS) +- $(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 - $(LN) ipp http -diff -up cups-2.2.10/scheduler/subscriptions.c.eggcups cups-2.2.10/scheduler/subscriptions.c ---- cups-2.2.10/scheduler/subscriptions.c.eggcups 2018-12-07 20:41:56.000000000 +0100 -+++ cups-2.2.10/scheduler/subscriptions.c 2018-12-14 14:17:25.595421889 +0100 -@@ -1291,13 +1291,13 @@ cupsd_send_dbus(cupsd_eventmask_t event, + $(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"; @@ -112,14 +112,14 @@ diff -up cups-2.2.10/scheduler/subscriptions.c.eggcups cups-2.2.10/scheduler/sub else if (event & CUPSD_EVENT_JOB_CREATED) what = "JobQueuedLocal"; else if ((event & CUPSD_EVENT_JOB_STATE) && job && - job->state_value == IPP_JOB_PROCESSING) + 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; -@@ -1333,7 +1333,7 @@ cupsd_send_dbus(cupsd_eventmask_t event, +@@ -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); diff --git a/cups-epson-A6-crash.patch b/cups-epson-A6-crash.patch deleted file mode 100644 index e8813b1..0000000 --- a/cups-epson-A6-crash.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/filter/rastertoepson.c b/filter/rastertoepson.c -index 73e8d0600..4522e6b48 100644 ---- a/filter/rastertoepson.c -+++ b/filter/rastertoepson.c -@@ -301,7 +302,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); diff --git a/cups-failover-backend.patch b/cups-failover-backend.patch index 815623e..2eda934 100644 --- a/cups-failover-backend.patch +++ b/cups-failover-backend.patch @@ -1,6 +1,6 @@ -diff -up cups-2.2.10/backend/failover.c.failover cups-2.2.10/backend/failover.c ---- cups-2.2.10/backend/failover.c.failover 2019-03-15 13:49:11.072784214 +0100 -+++ cups-2.2.10/backend/failover.c 2019-03-15 13:49:11.072784214 +0100 +diff -up cups-2.3.0/backend/failover.c.failover cups-2.3.0/backend/failover.c +--- cups-2.3.0/backend/failover.c.failover 2019-10-07 12:22:17.158626746 +0200 ++++ cups-2.3.0/backend/failover.c 2019-10-07 12:22:17.158626746 +0200 @@ -0,0 +1,837 @@ +/* + * Failover Backend for the Common UNIX Printing System (CUPS). @@ -839,10 +839,10 @@ diff -up cups-2.2.10/backend/failover.c.failover cups-2.2.10/backend/failover.c + else + return (NULL); +} -diff -up cups-2.2.10/backend/Makefile.failover cups-2.2.10/backend/Makefile ---- cups-2.2.10/backend/Makefile.failover 2019-03-15 13:49:11.042784468 +0100 -+++ cups-2.2.10/backend/Makefile 2019-03-15 13:50:39.563035149 +0100 -@@ -28,6 +28,7 @@ include ../Makedefs +diff -up cups-2.3.0/backend/Makefile.failover cups-2.3.0/backend/Makefile +--- cups-2.3.0/backend/Makefile.failover 2019-10-07 12:22:17.067627388 +0200 ++++ cups-2.3.0/backend/Makefile 2019-10-07 12:24:17.046780985 +0200 +@@ -22,6 +22,7 @@ include ../Makedefs RBACKENDS = \ ipp \ lpd \ @@ -850,7 +850,7 @@ diff -up cups-2.2.10/backend/Makefile.failover cups-2.2.10/backend/Makefile $(DNSSD_BACKEND) UBACKENDS = \ snmp \ -@@ -51,6 +52,7 @@ LIBOBJS = \ +@@ -45,6 +46,7 @@ LIBOBJS = \ OBJS = \ ipp.o \ lpd.o \ @@ -858,8 +858,8 @@ diff -up cups-2.2.10/backend/Makefile.failover cups-2.2.10/backend/Makefile dnssd.o \ snmp.o \ socket.o \ -@@ -278,6 +280,13 @@ lpd: lpd.o ../cups/$(LIBCUPS) libbackend - $(LD_CC) $(LDFLAGS) -o lpd lpd.o libbackend.a $(LIBS) +@@ -274,6 +276,13 @@ lpd: lpd.o ../cups/$(LIBCUPS) libbackend + $(LD_CC) $(ALL_LDFLAGS) -o lpd lpd.o libbackend.a $(LINKCUPS) $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@ +# @@ -868,7 +868,7 @@ diff -up cups-2.2.10/backend/Makefile.failover cups-2.2.10/backend/Makefile + +failover: failover.o ../cups/$(LIBCUPS) libbackend.a + echo Linking $@... -+ $(CC) $(LDFLAGS) -o failover failover.o libbackend.a $(LIBS) $(CUPSDLIBS) ++ $(LD_CC) $(ALL_LDFLAGS) -o failover failover.o libbackend.a $(LINKCUPS) # # snmp diff --git a/cups-ippeve-webui.patch b/cups-ippeve-webui.patch deleted file mode 100644 index 049d6b9..0000000 --- a/cups-ippeve-webui.patch +++ /dev/null @@ -1,124 +0,0 @@ -diff --git a/backend/dnssd.c b/backend/dnssd.c -index 34781d5ce..7074f4294 100644 ---- a/backend/dnssd.c -+++ b/backend/dnssd.c -@@ -1252,6 +1252,13 @@ query_callback( - strlcat(make_and_model, " ", sizeof(make_and_model)); - strlcat(make_and_model, model, sizeof(make_and_model)); - -+ if (!_cups_strncasecmp(make_and_model, "EPSON EPSON ", 12)) -+ _cups_strcpy(make_and_model, make_and_model + 6); -+ else if (!_cups_strncasecmp(make_and_model, "HP HP ", 6)) -+ _cups_strcpy(make_and_model, make_and_model + 3); -+ else if (!_cups_strncasecmp(make_and_model, "Lexmark International Lexmark ", 30)) -+ _cups_strcpy(make_and_model, make_and_model + 22); -+ - device->make_and_model = strdup(make_and_model); - } - else -diff --git a/cgi-bin/admin.c b/cgi-bin/admin.c -index f788083fb..a3b5057b0 100644 ---- a/cgi-bin/admin.c -+++ b/cgi-bin/admin.c -@@ -928,6 +929,8 @@ do_am_printer(http_t *http, /* I - HTTP connection */ - else if (!file && - (!cgiGetVariable("PPD_NAME") || cgiGetVariable("SELECT_MAKE"))) - { -+ int ipp_everywhere = !strncmp(var, "ipp://", 6) || !strncmp(var, "ipps://", 7) || (!strncmp(var, "dnssd://", 8) && (strstr(var, "_ipp._tcp") || strstr(var, "_ipps._tcp"))); -+ - if (modify && !cgiGetVariable("SELECT_MAKE")) - { - /* -@@ -1076,6 +1079,8 @@ do_am_printer(http_t *http, /* I - HTTP connection */ - if (!modify) - cgiSetVariable("CURRENT_MAKE_AND_MODEL", - cgiGetArray("PPD_MAKE_AND_MODEL", 0)); -+ if (ipp_everywhere) -+ cgiSetVariable("SHOW_IPP_EVERYWHERE", "1"); - cgiCopyTemplateLang("choose-model.tmpl"); - cgiEndHTML(); - } -diff --git a/templates/choose-model.tmpl b/templates/choose-model.tmpl -index ee9338cc5..d72534236 100644 ---- a/templates/choose-model.tmpl -+++ b/templates/choose-model.tmpl -@@ -39,6 +39,7 @@ - - - -diff --git a/templates/de/choose-model.tmpl b/templates/de/choose-model.tmpl -index cb9b6f3bc..a08a8e3e0 100644 ---- a/templates/de/choose-model.tmpl -+++ b/templates/de/choose-model.tmpl -@@ -39,6 +39,7 @@ Drucker {?printer_is_shared=?nicht:{?printer_is_shared=0?nicht:}} im Netzwerk fr - - - -diff --git a/templates/es/choose-model.tmpl b/templates/es/choose-model.tmpl -index 8a5a4ba90..74f0a9bb9 100644 ---- a/templates/es/choose-model.tmpl -+++ b/templates/es/choose-model.tmpl -@@ -39,6 +39,7 @@ - - - -diff --git a/templates/fr/choose-model.tmpl b/templates/fr/choose-model.tmpl -index 1e154f18a..3038b3fe3 100644 ---- a/templates/fr/choose-model.tmpl -+++ b/templates/fr/choose-model.tmpl -@@ -39,6 +39,7 @@ - - - -diff --git a/templates/ja/choose-model.tmpl b/templates/ja/choose-model.tmpl -index daf1375fd..b3c286b11 100644 ---- a/templates/ja/choose-model.tmpl -+++ b/templates/ja/choose-model.tmpl -@@ -39,6 +39,7 @@ - - - -diff --git a/templates/pt_BR/choose-model.tmpl b/templates/pt_BR/choose-model.tmpl -index 55d8bd8d5..a5939ee9c 100644 ---- a/templates/pt_BR/choose-model.tmpl -+++ b/templates/pt_BR/choose-model.tmpl -@@ -39,6 +39,7 @@ - - - -diff --git a/templates/ru/choose-model.tmpl b/templates/ru/choose-model.tmpl -index 2f0d6d9ba..86507814d 100644 ---- a/templates/ru/choose-model.tmpl -+++ b/templates/ru/choose-model.tmpl -@@ -39,6 +39,7 @@ - - - diff --git a/cups-ippvalidateattr-regression.patch b/cups-ippvalidateattr-regression.patch deleted file mode 100644 index 8185bf8..0000000 --- a/cups-ippvalidateattr-regression.patch +++ /dev/null @@ -1,63 +0,0 @@ -diff --git a/cups/ipp.c b/cups/ipp.c -index 95d53cc44..325de02b9 100644 ---- a/cups/ipp.c -+++ b/cups/ipp.c -@@ -5033,16 +5033,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)) - { -@@ -5091,16 +5094,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)) - { diff --git a/cups-journal-history.patch b/cups-journal-history.patch deleted file mode 100644 index 07717e8..0000000 --- a/cups-journal-history.patch +++ /dev/null @@ -1,109 +0,0 @@ -diff --git a/scheduler/log.c b/scheduler/log.c -index b6226201f..cdb5437dc 100644 ---- a/scheduler/log.c -+++ b/scheduler/log.c -@@ -565,56 +565,15 @@ cupsdLogJob(cupsd_job_t *job, /* I - Job */ - if (level > LogLevel && LogDebugHistory <= 0) - return (1); - --#ifdef HAVE_SYSTEMD_SD_JOURNAL_H -- if (!strcmp(ErrorLog, "syslog")) -- { -- cupsd_printer_t *printer = job ? (job->printer ? job->printer : (job->dest ? cupsdFindDest(job->dest) : NULL)) : NULL; -- static const char * const job_states[] = -- { /* job-state strings */ -- "Pending", -- "PendingHeld", -- "Processing", -- "ProcessingStopped", -- "Canceled", -- "Aborted", -- "Completed" -- }; -- -- va_start(ap, message); -- -- do -- { -- va_copy(ap2, ap); -- status = format_log_line(message, ap2); -- va_end(ap2); -- } -- while (status == 0); -- -- va_end(ap); -- -- if (job) -- sd_journal_send("MESSAGE=%s", log_line, -- "PRIORITY=%i", log_levels[level], -- PWG_Event"=JobStateChanged", -- PWG_ServiceURI"=%s", printer ? printer->uri : "", -- PWG_JobID"=%d", job->id, -- PWG_JobState"=%s", job->state_value < IPP_JSTATE_PENDING ? "" : job_states[job->state_value - IPP_JSTATE_PENDING], -- PWG_JobImpressionsCompleted"=%d", ippGetInteger(job->impressions, 0), -- NULL); -- else -- sd_journal_send("MESSAGE=%s", log_line, -- "PRIORITY=%i", log_levels[level], -- NULL); -- -- return (1); -- } --#endif /* HAVE_SYSTEMD_SD_JOURNAL_H */ -- - /* - * 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)); -@@ -673,7 +632,43 @@ cupsdLogJob(cupsd_job_t *job, /* I - Job */ - return (1); - } - else if (level <= LogLevel) -+ { -+#ifdef HAVE_SYSTEMD_SD_JOURNAL_H -+ if (!strcmp(ErrorLog, "syslog")) -+ { -+ cupsd_printer_t *printer = job ? (job->printer ? job->printer : (job->dest ? cupsdFindDest(job->dest) : NULL)) : NULL; -+ static const char * const job_states[] = -+ { /* job-state strings */ -+ "Pending", -+ "PendingHeld", -+ "Processing", -+ "ProcessingStopped", -+ "Canceled", -+ "Aborted", -+ "Completed" -+ }; -+ -+ if (job) -+ sd_journal_send("MESSAGE=%s", log_line, -+ "PRIORITY=%i", log_levels[level], -+ PWG_Event"=JobStateChanged", -+ PWG_ServiceURI"=%s", printer ? printer->uri : "", -+ PWG_JobID"=%d", job->id, -+ PWG_JobState"=%s", job->state_value < IPP_JSTATE_PENDING ? "" : job_states[job->state_value - IPP_JSTATE_PENDING], -+ PWG_JobImpressionsCompleted"=%d", ippGetInteger(job->impressions, 0), -+ NULL); -+ else -+ sd_journal_send("MESSAGE=%s", log_line, -+ "PRIORITY=%i", log_levels[level], -+ NULL); -+ -+ return (1); -+ } -+ else -+#endif /* HAVE_SYSTEMD_SD_JOURNAL_H */ -+ - return (cupsdWriteErrorLog(level, log_line)); -+ } - else - return (1); - } diff --git a/cups-lpr-help.patch b/cups-lpr-help.patch deleted file mode 100644 index f025698..0000000 --- a/cups-lpr-help.patch +++ /dev/null @@ -1,48 +0,0 @@ -diff -up cups-2.2b2/berkeley/lpr.c.lpr-help cups-2.2b2/berkeley/lpr.c ---- cups-2.2b2/berkeley/lpr.c.lpr-help 2016-06-24 17:43:35.000000000 +0200 -+++ cups-2.2b2/berkeley/lpr.c 2016-06-27 15:11:30.646348752 +0200 -@@ -18,6 +18,31 @@ - #include - - -+static void -+usage (const char *name) -+{ -+ _cupsLangPrintf(stdout, -+"Usage: %s [OPTION] [ file(s) ]\n" -+"Print files.\n\n" -+" -E force encryption\n" -+" -H server[:port] specify alternate server\n" -+" -C title, -J title, -T title\n" -+" set the job name\n\n" -+" -P destination/instance print to named printer\n" -+" -U username specify alternate username\n" -+" -# num-copies set number of copies\n" -+" -h disable banner printing\n" -+" -l print without filtering\n" -+" -m send email on completion\n" -+" -o option[=value] set a job option\n" -+" -p format text file with header\n" -+" -q hold job for printing\n" -+" -r delete files after printing\n" -+"\nWith no file given, read standard input.\n" -+, name); -+} -+ -+ - /* - * 'main()' - Parse options and send files for printing. - */ -@@ -281,6 +306,12 @@ main(int argc, /* I - Number of comm - break; - - default : -+ if (!strcmp (argv[i], "--help")) -+ { -+ usage (argv[0]); -+ return (0); -+ } -+ - _cupsLangPrintf(stderr, _("%s: Error - unknown option \"%c\"."), argv[0], *opt); - return (1); - } diff --git a/cups-lspp.patch b/cups-lspp.patch index 0869beb..7c094d2 100644 --- a/cups-lspp.patch +++ b/cups-lspp.patch @@ -1,7 +1,7 @@ -diff -up cups-2.2.10/config.h.in.lspp cups-2.2.10/config.h.in ---- cups-2.2.10/config.h.in.lspp 2018-12-07 20:41:56.000000000 +0100 -+++ cups-2.2.10/config.h.in 2018-12-14 14:19:25.513442664 +0100 -@@ -730,4 +730,11 @@ static __inline int _cups_abs(int i) { r +diff -up cups-2.3.0/config.h.in.lspp cups-2.3.0/config.h.in +--- cups-2.3.0/config.h.in.lspp 2019-08-23 17:19:38.000000000 +0200 ++++ cups-2.3.0/config.h.in 2019-10-07 12:24:43.058597468 +0200 +@@ -684,4 +684,11 @@ static __inline int _cups_abs(int i) { r # endif /* __GNUC__ || __STDC_VERSION__ */ #endif /* !HAVE_ABS && !abs */ @@ -13,9 +13,9 @@ diff -up cups-2.2.10/config.h.in.lspp cups-2.2.10/config.h.in + + #endif /* !_CUPS_CONFIG_H_ */ -diff -up cups-2.2.10/config-scripts/cups-lspp.m4.lspp cups-2.2.10/config-scripts/cups-lspp.m4 ---- cups-2.2.10/config-scripts/cups-lspp.m4.lspp 2018-12-14 14:19:25.513442664 +0100 -+++ cups-2.2.10/config-scripts/cups-lspp.m4 2018-12-14 14:19:25.513442664 +0100 +diff -up cups-2.3.0/config-scripts/cups-lspp.m4.lspp cups-2.3.0/config-scripts/cups-lspp.m4 +--- cups-2.3.0/config-scripts/cups-lspp.m4.lspp 2019-10-07 12:24:43.058597468 +0200 ++++ cups-2.3.0/config-scripts/cups-lspp.m4 2019-10-07 12:24:43.058597468 +0200 @@ -0,0 +1,36 @@ +dnl +dnl LSPP code for the Common UNIX Printing System (CUPS). @@ -53,22 +53,22 @@ diff -up cups-2.2.10/config-scripts/cups-lspp.m4.lspp cups-2.2.10/config-scripts + ;; + esac +fi -diff -up cups-2.2.10/configure.ac.lspp cups-2.2.10/configure.ac ---- cups-2.2.10/configure.ac.lspp 2018-12-07 20:41:56.000000000 +0100 -+++ cups-2.2.10/configure.ac 2018-12-14 14:19:25.513442664 +0100 -@@ -38,6 +38,8 @@ sinclude(config-scripts/cups-startup.m4) +diff -up cups-2.3.0/configure.ac.lspp cups-2.3.0/configure.ac +--- cups-2.3.0/configure.ac.lspp 2019-10-07 12:24:43.058597468 +0200 ++++ cups-2.3.0/configure.ac 2019-10-07 12:39:20.122546282 +0200 +@@ -34,6 +34,8 @@ sinclude(config-scripts/cups-dnssd.m4) + sinclude(config-scripts/cups-startup.m4) sinclude(config-scripts/cups-defaults.m4) - sinclude(config-scripts/cups-scripting.m4) +sinclude(config-scripts/cups-lspp.m4) + INSTALL_LANGUAGES="" UNINSTALL_LANGUAGES="" LANGFILES="" -diff -up cups-2.2.10/filter/common.c.lspp cups-2.2.10/filter/common.c ---- cups-2.2.10/filter/common.c.lspp 2018-12-07 20:41:56.000000000 +0100 -+++ cups-2.2.10/filter/common.c 2018-12-14 14:19:25.513442664 +0100 -@@ -17,6 +17,12 @@ +diff -up cups-2.3.0/filter/common.c.lspp cups-2.3.0/filter/common.c +--- cups-2.3.0/filter/common.c.lspp 2019-08-23 17:19:38.000000000 +0200 ++++ cups-2.3.0/filter/common.c 2019-10-07 12:24:43.059597461 +0200 +@@ -11,6 +11,12 @@ * Include necessary headers... */ @@ -81,7 +81,7 @@ diff -up cups-2.2.10/filter/common.c.lspp cups-2.2.10/filter/common.c #include "common.h" #include -@@ -299,6 +305,18 @@ WriteLabelProlog(const char *label, /* I +@@ -293,6 +299,18 @@ WriteLabelProlog(const char *label, /* I { const char *classification; /* CLASSIFICATION environment variable */ const char *ptr; /* Temporary string pointer */ @@ -100,7 +100,7 @@ diff -up cups-2.2.10/filter/common.c.lspp cups-2.2.10/filter/common.c /* -@@ -321,6 +339,124 @@ WriteLabelProlog(const char *label, /* I +@@ -315,6 +333,124 @@ WriteLabelProlog(const char *label, /* I return; } @@ -225,7 +225,7 @@ diff -up cups-2.2.10/filter/common.c.lspp cups-2.2.10/filter/common.c /* * Set the classification + page label string... */ -@@ -401,7 +537,10 @@ WriteLabelProlog(const char *label, /* I +@@ -395,7 +531,10 @@ WriteLabelProlog(const char *label, /* I printf(" %.0f moveto ESPpl show\n", top - 14.0); puts("pop"); puts("}bind put"); @@ -236,10 +236,10 @@ diff -up cups-2.2.10/filter/common.c.lspp cups-2.2.10/filter/common.c /* -diff -up cups-2.2.10/filter/pstops.c.lspp cups-2.2.10/filter/pstops.c ---- cups-2.2.10/filter/pstops.c.lspp 2018-12-07 20:41:56.000000000 +0100 -+++ cups-2.2.10/filter/pstops.c 2018-12-14 14:19:25.514442656 +0100 -@@ -3175,6 +3175,18 @@ write_label_prolog(pstops_doc_t *doc, /* +diff -up cups-2.3.0/filter/pstops.c.lspp cups-2.3.0/filter/pstops.c +--- cups-2.3.0/filter/pstops.c.lspp 2019-08-23 17:19:38.000000000 +0200 ++++ cups-2.3.0/filter/pstops.c 2019-10-07 12:24:43.059597461 +0200 +@@ -3170,6 +3170,18 @@ write_label_prolog(pstops_doc_t *doc, /* { const char *classification; /* CLASSIFICATION environment variable */ const char *ptr; /* Temporary string pointer */ @@ -258,7 +258,7 @@ diff -up cups-2.2.10/filter/pstops.c.lspp cups-2.2.10/filter/pstops.c /* -@@ -3197,6 +3209,124 @@ write_label_prolog(pstops_doc_t *doc, /* +@@ -3192,6 +3204,124 @@ write_label_prolog(pstops_doc_t *doc, /* return; } @@ -383,7 +383,7 @@ diff -up cups-2.2.10/filter/pstops.c.lspp cups-2.2.10/filter/pstops.c /* * Set the classification + page label string... */ -@@ -3275,7 +3405,10 @@ write_label_prolog(pstops_doc_t *doc, /* +@@ -3270,7 +3400,10 @@ write_label_prolog(pstops_doc_t *doc, /* doc_printf(doc, " %.0f moveto ESPpl show\n", top - 14.0); doc_puts(doc, "pop\n"); doc_puts(doc, "}bind put\n"); @@ -394,22 +394,22 @@ diff -up cups-2.2.10/filter/pstops.c.lspp cups-2.2.10/filter/pstops.c /* -diff -up cups-2.2.10/Makedefs.in.lspp cups-2.2.10/Makedefs.in ---- cups-2.2.10/Makedefs.in.lspp 2018-12-07 20:41:56.000000000 +0100 -+++ cups-2.2.10/Makedefs.in 2018-12-14 14:19:25.514442656 +0100 -@@ -165,7 +165,7 @@ LDFLAGS = -L../cgi-bin -L../cups -L../f - @LDFLAGS@ @RELROFLAGS@ @PIEFLAGS@ $(OPTIM) - LINKCUPS = @LINKCUPS@ $(LIBGSSAPI) $(DNSSDLIBS) $(SSLLIBS) $(LIBZ) - LINKCUPSIMAGE = @LINKCUPSIMAGE@ --LIBS = $(LINKCUPS) $(COMMONLIBS) -+LIBS = $(LINKCUPS) $(COMMONLIBS) @LIBAUDIT@ @LIBSELINUX@ +diff -up cups-2.3.0/Makedefs.in.lspp cups-2.3.0/Makedefs.in +--- cups-2.3.0/Makedefs.in.lspp 2019-10-07 12:24:43.059597461 +0200 ++++ cups-2.3.0/Makedefs.in 2019-10-07 12:37:19.200565805 +0200 +@@ -174,7 +174,7 @@ IPPFIND_MAN = @IPPFIND_MAN@ + LDFLAGS = @LDFLAGS@ + LINKCUPS = @LINKCUPS@ + LINKCUPSSTATIC = ../cups/$(LIBCUPSSTATIC) $(LIBS) +-LIBS = $(LIBGSSAPI) $(DNSSDLIBS) $(SSLLIBS) $(LIBZ) $(COMMONLIBS) ++LIBS = $(LIBGSSAPI) $(DNSSDLIBS) $(SSLLIBS) $(LIBZ) $(COMMONLIBS) @LIBAUDIT@ @LIBSELINUX@ ONDEMANDFLAGS = @ONDEMANDFLAGS@ ONDEMANDLIBS = @ONDEMANDLIBS@ OPTIM = @OPTIM@ -diff -up cups-2.2.10/scheduler/client.c.lspp cups-2.2.10/scheduler/client.c ---- cups-2.2.10/scheduler/client.c.lspp 2018-12-07 20:41:56.000000000 +0100 -+++ cups-2.2.10/scheduler/client.c 2018-12-14 14:19:25.516442640 +0100 -@@ -22,12 +22,20 @@ +diff -up cups-2.3.0/scheduler/client.c.lspp cups-2.3.0/scheduler/client.c +--- cups-2.3.0/scheduler/client.c.lspp 2019-08-23 17:19:38.000000000 +0200 ++++ cups-2.3.0/scheduler/client.c 2019-10-07 12:33:10.459693580 +0200 +@@ -19,12 +19,20 @@ #define _HTTP_NO_PRIVATE #include "cupsd.h" @@ -430,7 +430,7 @@ diff -up cups-2.2.10/scheduler/client.c.lspp cups-2.2.10/scheduler/client.c /* -@@ -268,6 +276,59 @@ cupsdAcceptClient(cupsd_listener_t *lis) +@@ -265,6 +273,59 @@ cupsdAcceptClient(cupsd_listener_t *lis) } #endif /* HAVE_TCPD_H */ @@ -490,9 +490,9 @@ diff -up cups-2.2.10/scheduler/client.c.lspp cups-2.2.10/scheduler/client.c #ifdef AF_LOCAL if (httpAddrFamily(httpGetAddress(con->http)) == AF_LOCAL) { -@@ -562,6 +623,13 @@ cupsdReadClient(cupsd_client_t *con) /* +@@ -558,6 +619,13 @@ cupsdReadClient(cupsd_client_t *con) /* + struct stat filestats; /* File information */ mime_type_t *type; /* MIME type of file */ - cupsd_printer_t *p; /* Printer */ static unsigned request_id = 0; /* Request ID for temp files */ +#ifdef WITH_LSPP + security_context_t spoolcon; /* context of the job file */ @@ -504,7 +504,7 @@ diff -up cups-2.2.10/scheduler/client.c.lspp cups-2.2.10/scheduler/client.c status = HTTP_STATUS_CONTINUE; -@@ -1938,6 +2006,73 @@ cupsdReadClient(cupsd_client_t *con) /* +@@ -1679,6 +1747,73 @@ cupsdReadClient(cupsd_client_t *con) /* fcntl(con->file, F_SETFD, fcntl(con->file, F_GETFD) | FD_CLOEXEC); } @@ -578,7 +578,7 @@ diff -up cups-2.2.10/scheduler/client.c.lspp cups-2.2.10/scheduler/client.c if (httpGetState(con->http) != HTTP_STATE_POST_SEND) { if (!httpWait(con->http, 0)) -@@ -3484,6 +3619,49 @@ is_path_absolute(const char *path) /* I +@@ -3174,6 +3309,49 @@ is_path_absolute(const char *path) /* I return (1); } @@ -628,10 +628,10 @@ diff -up cups-2.2.10/scheduler/client.c.lspp cups-2.2.10/scheduler/client.c /* * 'pipe_command()' - Pipe the output of a command to the remote client. -diff -up cups-2.2.10/scheduler/client.h.lspp cups-2.2.10/scheduler/client.h ---- cups-2.2.10/scheduler/client.h.lspp 2018-12-07 20:41:56.000000000 +0100 -+++ cups-2.2.10/scheduler/client.h 2018-12-14 14:19:25.516442640 +0100 -@@ -16,6 +16,13 @@ +diff -up cups-2.3.0/scheduler/client.h.lspp cups-2.3.0/scheduler/client.h +--- cups-2.3.0/scheduler/client.h.lspp 2019-08-23 17:19:38.000000000 +0200 ++++ cups-2.3.0/scheduler/client.h 2019-10-07 12:24:43.113597079 +0200 +@@ -13,6 +13,13 @@ #endif /* HAVE_AUTHORIZATION_H */ @@ -645,7 +645,7 @@ diff -up cups-2.2.10/scheduler/client.h.lspp cups-2.2.10/scheduler/client.h /* * HTTP client structure... */ -@@ -66,6 +73,10 @@ struct cupsd_client_s +@@ -63,6 +70,10 @@ struct cupsd_client_s #ifdef HAVE_AUTHORIZATION_H AuthorizationRef authref; /* Authorization ref */ #endif /* HAVE_AUTHORIZATION_H */ @@ -656,7 +656,7 @@ diff -up cups-2.2.10/scheduler/client.h.lspp cups-2.2.10/scheduler/client.h }; #define HTTP(con) ((con)->http) -@@ -139,6 +150,9 @@ extern void cupsdStartListening(void); +@@ -136,6 +147,9 @@ extern void cupsdStartListening(void); extern void cupsdStopListening(void); extern void cupsdUpdateCGI(void); extern void cupsdWriteClient(cupsd_client_t *con); @@ -666,10 +666,10 @@ diff -up cups-2.2.10/scheduler/client.h.lspp cups-2.2.10/scheduler/client.h #ifdef HAVE_SSL extern int cupsdEndTLS(cupsd_client_t *con); -diff -up cups-2.2.10/scheduler/conf.c.lspp cups-2.2.10/scheduler/conf.c ---- cups-2.2.10/scheduler/conf.c.lspp 2018-12-14 14:19:25.510442689 +0100 -+++ cups-2.2.10/scheduler/conf.c 2018-12-14 14:19:25.517442632 +0100 -@@ -40,6 +40,9 @@ +diff -up cups-2.3.0/scheduler/conf.c.lspp cups-2.3.0/scheduler/conf.c +--- cups-2.3.0/scheduler/conf.c.lspp 2019-10-07 12:24:43.049597531 +0200 ++++ cups-2.3.0/scheduler/conf.c 2019-10-07 12:24:43.113597079 +0200 +@@ -37,6 +37,9 @@ # define INADDR_NONE 0xffffffff #endif /* !INADDR_NONE */ @@ -700,7 +700,7 @@ diff -up cups-2.2.10/scheduler/conf.c.lspp cups-2.2.10/scheduler/conf.c /* -@@ -863,6 +873,25 @@ cupsdReadConfiguration(void) +@@ -864,6 +874,25 @@ cupsdReadConfiguration(void) RunUser = getuid(); @@ -726,7 +726,7 @@ diff -up cups-2.2.10/scheduler/conf.c.lspp cups-2.2.10/scheduler/conf.c cupsdLogMessage(CUPSD_LOG_INFO, "Remote access is %s.", RemotePort ? "enabled" : "disabled"); -@@ -1274,7 +1303,19 @@ cupsdReadConfiguration(void) +@@ -1275,7 +1304,19 @@ cupsdReadConfiguration(void) cupsdClearString(&Classification); if (Classification) @@ -746,7 +746,7 @@ diff -up cups-2.2.10/scheduler/conf.c.lspp cups-2.2.10/scheduler/conf.c /* * Check the MaxClients setting, and then allocate memory for it... -@@ -3832,6 +3873,18 @@ read_location(cups_file_t *fp, /* I - C +@@ -3830,6 +3871,18 @@ read_location(cups_file_t *fp, /* I - C return ((FatalErrors & CUPSD_FATAL_CONFIG) ? 0 : linenum); } @@ -765,10 +765,10 @@ diff -up cups-2.2.10/scheduler/conf.c.lspp cups-2.2.10/scheduler/conf.c /* * 'read_policy()' - Read a definition. -diff -up cups-2.2.10/scheduler/conf.h.lspp cups-2.2.10/scheduler/conf.h ---- cups-2.2.10/scheduler/conf.h.lspp 2018-12-07 20:41:56.000000000 +0100 -+++ cups-2.2.10/scheduler/conf.h 2018-12-14 14:19:25.518442624 +0100 -@@ -246,6 +246,13 @@ VAR char *ServerKeychain VALUE(NULL); +diff -up cups-2.3.0/scheduler/conf.h.lspp cups-2.3.0/scheduler/conf.h +--- cups-2.3.0/scheduler/conf.h.lspp 2019-08-23 17:19:38.000000000 +0200 ++++ cups-2.3.0/scheduler/conf.h 2019-10-07 12:24:43.113597079 +0200 +@@ -243,6 +243,13 @@ VAR char *ServerKeychain VALUE(NULL); /* Keychain holding cert + key */ #endif /* HAVE_SSL */ @@ -782,7 +782,7 @@ diff -up cups-2.2.10/scheduler/conf.h.lspp cups-2.2.10/scheduler/conf.h #ifdef HAVE_ONDEMAND VAR int IdleExitTimeout VALUE(60); /* Time after which an idle cupsd will exit */ -@@ -264,6 +271,9 @@ VAR int HaveServerCreds VALUE(0); +@@ -261,6 +268,9 @@ VAR int HaveServerCreds VALUE(0); VAR gss_cred_id_t ServerCreds; /* Server's GSS credentials */ #endif /* HAVE_GSSAPI */ @@ -792,11 +792,11 @@ diff -up cups-2.2.10/scheduler/conf.h.lspp cups-2.2.10/scheduler/conf.h /* * Prototypes... -diff -up cups-2.2.10/scheduler/cupsd.h.lspp cups-2.2.10/scheduler/cupsd.h ---- cups-2.2.10/scheduler/cupsd.h.lspp 2018-12-07 20:41:56.000000000 +0100 -+++ cups-2.2.10/scheduler/cupsd.h 2018-12-14 14:21:04.298636007 +0100 -@@ -11,6 +11,8 @@ - * file is missing or damaged, see the license at "http://www.cups.org/". +diff -up cups-2.3.0/scheduler/cupsd.h.lspp cups-2.3.0/scheduler/cupsd.h +--- cups-2.3.0/scheduler/cupsd.h.lspp 2019-08-23 17:19:38.000000000 +0200 ++++ cups-2.3.0/scheduler/cupsd.h 2019-10-07 12:31:38.458480578 +0200 +@@ -8,6 +8,8 @@ + * information. */ +/* Copyright (C) 2005 Trusted Computer Solutions, Inc. */ @@ -804,7 +804,7 @@ diff -up cups-2.2.10/scheduler/cupsd.h.lspp cups-2.2.10/scheduler/cupsd.h /* * Include necessary headers. -@@ -36,6 +38,14 @@ +@@ -33,6 +35,14 @@ # include #endif /* _WIN32 */ @@ -819,11 +819,11 @@ diff -up cups-2.2.10/scheduler/cupsd.h.lspp cups-2.2.10/scheduler/cupsd.h #include "mime.h" #if defined(HAVE_CDSASSL) -diff -up cups-2.2.10/scheduler/ipp.c.lspp cups-2.2.10/scheduler/ipp.c ---- cups-2.2.10/scheduler/ipp.c.lspp 2018-12-14 14:19:25.478442950 +0100 -+++ cups-2.2.10/scheduler/ipp.c 2018-12-14 14:19:25.520442607 +0100 -@@ -14,6 +14,9 @@ - * missing or damaged, see the license at "http://www.cups.org/". +diff -up cups-2.3.0/scheduler/ipp.c.lspp cups-2.3.0/scheduler/ipp.c +--- cups-2.3.0/scheduler/ipp.c.lspp 2019-10-07 12:24:43.016597764 +0200 ++++ cups-2.3.0/scheduler/ipp.c 2019-10-07 12:31:01.243798920 +0200 +@@ -11,6 +11,9 @@ + * information. */ +/* Copyright (C) 2005 Trusted Computer Solutions, Inc. */ @@ -832,8 +832,8 @@ diff -up cups-2.2.10/scheduler/ipp.c.lspp cups-2.2.10/scheduler/ipp.c /* * Include necessary headers... */ -@@ -37,6 +40,14 @@ extern int mbr_check_membership_by_id(uu - # endif /* HAVE_MEMBERSHIPPRIV_H */ +@@ -27,6 +30,14 @@ extern int mbr_group_name_to_uuid(const + extern int mbr_check_membership_by_id(uuid_t user, gid_t group, int* ismember); #endif /* __APPLE__ */ +#ifdef WITH_LSPP @@ -847,7 +847,7 @@ diff -up cups-2.2.10/scheduler/ipp.c.lspp cups-2.2.10/scheduler/ipp.c /* * Local functions... -@@ -61,6 +72,9 @@ static void cancel_all_jobs(cupsd_client +@@ -51,6 +62,9 @@ static void cancel_all_jobs(cupsd_client static void cancel_job(cupsd_client_t *con, ipp_attribute_t *uri); static void cancel_subscription(cupsd_client_t *con, int id); static int check_rss_recipient(const char *recipient); @@ -857,7 +857,7 @@ diff -up cups-2.2.10/scheduler/ipp.c.lspp cups-2.2.10/scheduler/ipp.c static int check_quotas(cupsd_client_t *con, cupsd_printer_t *p); static void close_job(cupsd_client_t *con, ipp_attribute_t *uri); static void copy_attrs(ipp_t *to, ipp_t *from, cups_array_t *ra, -@@ -1248,6 +1262,21 @@ add_job(cupsd_client_t *con, /* I - Cl +@@ -1240,6 +1254,21 @@ add_job(cupsd_client_t *con, /* I - Cl "time-at-creation", "time-at-processing" }; @@ -879,7 +879,7 @@ diff -up cups-2.2.10/scheduler/ipp.c.lspp cups-2.2.10/scheduler/ipp.c cupsdLogMessage(CUPSD_LOG_DEBUG2, "add_job(%p[%d], %p(%s), %p(%s/%s))", -@@ -1576,6 +1605,106 @@ add_job(cupsd_client_t *con, /* I - Cl +@@ -1568,6 +1597,106 @@ add_job(cupsd_client_t *con, /* I - Cl attr = ippFindAttribute(con->request, "requesting-user-name", IPP_TAG_NAME); @@ -986,7 +986,7 @@ diff -up cups-2.2.10/scheduler/ipp.c.lspp cups-2.2.10/scheduler/ipp.c if ((job = cupsdAddJob(priority, printer->name)) == NULL) { send_ipp_status(con, IPP_INTERNAL_ERROR, -@@ -1584,6 +1713,32 @@ add_job(cupsd_client_t *con, /* I - Cl +@@ -1576,6 +1705,32 @@ add_job(cupsd_client_t *con, /* I - Cl return (NULL); } @@ -1019,7 +1019,7 @@ diff -up cups-2.2.10/scheduler/ipp.c.lspp cups-2.2.10/scheduler/ipp.c job->dtype = printer->type & (CUPS_PRINTER_CLASS | CUPS_PRINTER_REMOTE); job->attrs = con->request; job->dirty = 1; -@@ -1771,6 +1926,29 @@ add_job(cupsd_client_t *con, /* I - Cl +@@ -1763,6 +1918,29 @@ add_job(cupsd_client_t *con, /* I - Cl ippSetString(job->attrs, &attr, 0, printer->job_sheets[0]); ippSetString(job->attrs, &attr, 1, printer->job_sheets[1]); } @@ -1049,7 +1049,7 @@ diff -up cups-2.2.10/scheduler/ipp.c.lspp cups-2.2.10/scheduler/ipp.c job->job_sheets = attr; -@@ -1801,6 +1979,9 @@ add_job(cupsd_client_t *con, /* I - Cl +@@ -1793,6 +1971,9 @@ add_job(cupsd_client_t *con, /* I - Cl "job-sheets=\"%s,none\", " "job-originating-user-name=\"%s\"", Classification, job->username); @@ -1059,7 +1059,7 @@ diff -up cups-2.2.10/scheduler/ipp.c.lspp cups-2.2.10/scheduler/ipp.c } else if (attr->num_values == 2 && strcmp(attr->values[0].string.text, -@@ -1819,6 +2000,9 @@ add_job(cupsd_client_t *con, /* I - Cl +@@ -1811,6 +1992,9 @@ add_job(cupsd_client_t *con, /* I - Cl "job-originating-user-name=\"%s\"", attr->values[0].string.text, attr->values[1].string.text, job->username); @@ -1069,7 +1069,7 @@ diff -up cups-2.2.10/scheduler/ipp.c.lspp cups-2.2.10/scheduler/ipp.c } else if (strcmp(attr->values[0].string.text, Classification) && strcmp(attr->values[0].string.text, "none") && -@@ -1839,6 +2023,9 @@ add_job(cupsd_client_t *con, /* I - Cl +@@ -1831,6 +2015,9 @@ add_job(cupsd_client_t *con, /* I - Cl "job-originating-user-name=\"%s\"", attr->values[0].string.text, attr->values[1].string.text, job->username); @@ -1079,7 +1079,7 @@ diff -up cups-2.2.10/scheduler/ipp.c.lspp cups-2.2.10/scheduler/ipp.c } } else if (strcmp(attr->values[0].string.text, Classification) && -@@ -1879,8 +2066,52 @@ add_job(cupsd_client_t *con, /* I - Cl +@@ -1871,8 +2058,52 @@ add_job(cupsd_client_t *con, /* I - Cl "job-sheets=\"%s\", " "job-originating-user-name=\"%s\"", Classification, job->username); @@ -1132,7 +1132,7 @@ diff -up cups-2.2.10/scheduler/ipp.c.lspp cups-2.2.10/scheduler/ipp.c /* * See if we need to add the starting sheet... -@@ -3654,6 +3885,128 @@ check_rss_recipient( +@@ -3648,6 +3879,128 @@ check_rss_recipient( } @@ -1261,7 +1261,7 @@ diff -up cups-2.2.10/scheduler/ipp.c.lspp cups-2.2.10/scheduler/ipp.c /* * 'check_quotas()' - Check quotas for a printer and user. */ -@@ -4110,6 +4463,15 @@ copy_banner(cupsd_client_t *con, /* I - +@@ -4103,6 +4456,15 @@ copy_banner(cupsd_client_t *con, /* I - char attrname[255], /* Name of attribute */ *s; /* Pointer into name */ ipp_attribute_t *attr; /* Attribute */ @@ -1277,7 +1277,7 @@ diff -up cups-2.2.10/scheduler/ipp.c.lspp cups-2.2.10/scheduler/ipp.c cupsdLogMessage(CUPSD_LOG_DEBUG2, -@@ -4145,6 +4507,85 @@ copy_banner(cupsd_client_t *con, /* I - +@@ -4138,6 +4500,85 @@ copy_banner(cupsd_client_t *con, /* I - fchmod(cupsFileNumber(out), 0640); fchown(cupsFileNumber(out), RunUser, Group); @@ -1363,7 +1363,7 @@ diff -up cups-2.2.10/scheduler/ipp.c.lspp cups-2.2.10/scheduler/ipp.c /* * Try the localized banner file under the subdirectory... -@@ -4239,6 +4680,24 @@ copy_banner(cupsd_client_t *con, /* I - +@@ -4232,6 +4673,24 @@ copy_banner(cupsd_client_t *con, /* I - else s = attrname; @@ -1388,7 +1388,7 @@ diff -up cups-2.2.10/scheduler/ipp.c.lspp cups-2.2.10/scheduler/ipp.c if (!strcmp(s, "printer-name")) { cupsFilePuts(out, job->dest); -@@ -6470,6 +6929,22 @@ get_job_attrs(cupsd_client_t *con, /* I +@@ -6439,6 +6898,22 @@ get_job_attrs(cupsd_client_t *con, /* I exclude = cupsdGetPrivateAttrs(policy, con, printer, job->username); @@ -1411,7 +1411,7 @@ diff -up cups-2.2.10/scheduler/ipp.c.lspp cups-2.2.10/scheduler/ipp.c /* * Copy attributes... */ -@@ -6867,6 +7342,11 @@ get_jobs(cupsd_client_t *con, /* I - C +@@ -6836,6 +7311,11 @@ get_jobs(cupsd_client_t *con, /* I - C if (username[0] && _cups_strcasecmp(username, job->username)) continue; @@ -1423,7 +1423,7 @@ diff -up cups-2.2.10/scheduler/ipp.c.lspp cups-2.2.10/scheduler/ipp.c if (count > 0) ippAddSeparator(con->response); -@@ -11465,6 +11945,11 @@ validate_user(cupsd_job_t *job, /* I +@@ -11445,6 +11925,11 @@ validate_user(cupsd_job_t *job, /* I strlcpy(username, get_username(con), userlen); @@ -1435,11 +1435,11 @@ diff -up cups-2.2.10/scheduler/ipp.c.lspp cups-2.2.10/scheduler/ipp.c /* * Check the username against the owner... */ -diff -up cups-2.2.10/scheduler/job.c.lspp cups-2.2.10/scheduler/job.c ---- cups-2.2.10/scheduler/job.c.lspp 2018-12-14 14:19:25.486442885 +0100 -+++ cups-2.2.10/scheduler/job.c 2018-12-14 14:19:25.521442599 +0100 -@@ -11,6 +11,9 @@ - * missing or damaged, see the license at "http://www.cups.org/". +diff -up cups-2.3.0/scheduler/job.c.lspp cups-2.3.0/scheduler/job.c +--- cups-2.3.0/scheduler/job.c.lspp 2019-10-07 12:24:43.024597707 +0200 ++++ cups-2.3.0/scheduler/job.c 2019-10-07 12:30:13.092210820 +0200 +@@ -8,6 +8,9 @@ + * information. */ +/* Copyright (C) 2005 Trusted Computer Solutions, Inc. */ @@ -1448,7 +1448,7 @@ diff -up cups-2.2.10/scheduler/job.c.lspp cups-2.2.10/scheduler/job.c /* * Include necessary headers... */ -@@ -26,6 +29,14 @@ +@@ -23,6 +26,14 @@ # endif /* HAVE_IOKIT_PWR_MGT_IOPMLIBPRIVATE_H */ #endif /* __APPLE__ */ @@ -1463,7 +1463,7 @@ diff -up cups-2.2.10/scheduler/job.c.lspp cups-2.2.10/scheduler/job.c /* * Design Notes for Job Management -@@ -547,6 +558,14 @@ cupsdContinueJob(cupsd_job_t *job) /* I +@@ -544,6 +555,14 @@ cupsdContinueJob(cupsd_job_t *job) /* I /* PRINTER_STATE_REASONS env var */ rip_max_cache[255]; /* RIP_MAX_CACHE env variable */ @@ -1478,7 +1478,7 @@ diff -up cups-2.2.10/scheduler/job.c.lspp cups-2.2.10/scheduler/job.c cupsdLogMessage(CUPSD_LOG_DEBUG2, -@@ -1083,6 +1102,67 @@ cupsdContinueJob(cupsd_job_t *job) /* I +@@ -1080,6 +1099,67 @@ cupsdContinueJob(cupsd_job_t *job) /* I if (final_content_type[0]) envp[envc ++] = final_content_type; @@ -1546,7 +1546,7 @@ diff -up cups-2.2.10/scheduler/job.c.lspp cups-2.2.10/scheduler/job.c if (Classification && !banner_page) { if ((attr = ippFindAttribute(job->attrs, "job-sheets", -@@ -1862,6 +1942,22 @@ cupsdLoadJob(cupsd_job_t *job) /* I - J +@@ -1858,6 +1938,22 @@ cupsdLoadJob(cupsd_job_t *job) /* I - J ippSetString(job->attrs, &job->reasons, 0, "none"); } @@ -1569,7 +1569,7 @@ diff -up cups-2.2.10/scheduler/job.c.lspp cups-2.2.10/scheduler/job.c job->impressions = ippFindAttribute(job->attrs, "job-impressions-completed", IPP_TAG_INTEGER); job->sheets = ippFindAttribute(job->attrs, "job-media-sheets-completed", IPP_TAG_INTEGER); job->job_sheets = ippFindAttribute(job->attrs, "job-sheets", IPP_TAG_NAME); -@@ -2277,6 +2373,14 @@ cupsdSaveJob(cupsd_job_t *job) /* I - J +@@ -2273,6 +2369,14 @@ cupsdSaveJob(cupsd_job_t *job) /* I - J { char filename[1024]; /* Job control filename */ cups_file_t *fp; /* Job file */ @@ -1584,7 +1584,7 @@ diff -up cups-2.2.10/scheduler/job.c.lspp cups-2.2.10/scheduler/job.c cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdSaveJob(job=%p(%d)): job->attrs=%p", -@@ -2299,6 +2403,78 @@ cupsdSaveJob(cupsd_job_t *job) /* I - J +@@ -2295,6 +2399,78 @@ cupsdSaveJob(cupsd_job_t *job) /* I - J fchown(cupsFileNumber(fp), RunUser, Group); @@ -1663,7 +1663,7 @@ diff -up cups-2.2.10/scheduler/job.c.lspp cups-2.2.10/scheduler/job.c job->attrs->state = IPP_IDLE; if (ippWriteIO(fp, (ipp_iocb_t)cupsFileWrite, 1, NULL, -@@ -3980,6 +4156,19 @@ get_options(cupsd_job_t *job, /* I - Jo +@@ -3995,6 +4171,19 @@ get_options(cupsd_job_t *job, /* I - Jo banner_page) continue; @@ -1683,7 +1683,7 @@ diff -up cups-2.2.10/scheduler/job.c.lspp cups-2.2.10/scheduler/job.c /* * Otherwise add them to the list... */ -@@ -4741,6 +4930,18 @@ start_job(cupsd_job_t *job, /* I - +@@ -4805,6 +4994,18 @@ start_job(cupsd_job_t *job, /* I - cupsd_printer_t *printer) /* I - Printer to print job */ { const char *filename; /* Support filename */ @@ -1702,7 +1702,7 @@ diff -up cups-2.2.10/scheduler/job.c.lspp cups-2.2.10/scheduler/job.c ipp_attribute_t *cancel_after = ippFindAttribute(job->attrs, "job-cancel-after", IPP_TAG_INTEGER); -@@ -4929,6 +5130,113 @@ start_job(cupsd_job_t *job, /* I - +@@ -4993,6 +5194,113 @@ start_job(cupsd_job_t *job, /* I - fcntl(job->side_pipes[1], F_SETFD, fcntl(job->side_pipes[1], F_GETFD) | FD_CLOEXEC); @@ -1816,11 +1816,11 @@ diff -up cups-2.2.10/scheduler/job.c.lspp cups-2.2.10/scheduler/job.c /* * Now start the first file in the job... */ -diff -up cups-2.2.10/scheduler/job.h.lspp cups-2.2.10/scheduler/job.h ---- cups-2.2.10/scheduler/job.h.lspp 2018-12-07 20:41:56.000000000 +0100 -+++ cups-2.2.10/scheduler/job.h 2018-12-14 14:19:25.521442599 +0100 -@@ -11,6 +11,13 @@ - * missing or damaged, see the license at "http://www.cups.org/". +diff -up cups-2.3.0/scheduler/job.h.lspp cups-2.3.0/scheduler/job.h +--- cups-2.3.0/scheduler/job.h.lspp 2019-08-23 17:19:38.000000000 +0200 ++++ cups-2.3.0/scheduler/job.h 2019-10-07 12:29:54.364371023 +0200 +@@ -7,6 +7,13 @@ + * Licensed under Apache License v2.0. See the file "LICENSE" for more information. */ +/* Copyright (C) 2005 Trusted Computer Solutions, Inc. */ @@ -1833,7 +1833,7 @@ diff -up cups-2.2.10/scheduler/job.h.lspp cups-2.2.10/scheduler/job.h /* * Constants... */ -@@ -88,6 +95,10 @@ struct cupsd_job_s /**** Job request * +@@ -84,6 +91,10 @@ struct cupsd_job_s /**** Job request * int progress; /* Printing progress */ int num_keywords; /* Number of PPD keywords */ cups_option_t *keywords; /* PPD keywords */ @@ -1844,10 +1844,10 @@ diff -up cups-2.2.10/scheduler/job.h.lspp cups-2.2.10/scheduler/job.h }; typedef struct cupsd_joblog_s /**** Job log message ****/ -diff -up cups-2.2.10/scheduler/main.c.lspp cups-2.2.10/scheduler/main.c ---- cups-2.2.10/scheduler/main.c.lspp 2018-12-14 14:19:25.499442779 +0100 -+++ cups-2.2.10/scheduler/main.c 2018-12-14 14:19:25.522442591 +0100 -@@ -59,6 +59,9 @@ +diff -up cups-2.3.0/scheduler/main.c.lspp cups-2.3.0/scheduler/main.c +--- cups-2.3.0/scheduler/main.c.lspp 2019-10-07 12:24:43.037597616 +0200 ++++ cups-2.3.0/scheduler/main.c 2019-10-07 12:24:43.119597037 +0200 +@@ -57,6 +57,9 @@ # include #endif /* HAVE_SYS_PARAM_H */ @@ -1857,7 +1857,7 @@ diff -up cups-2.2.10/scheduler/main.c.lspp cups-2.2.10/scheduler/main.c /* * Local functions... -@@ -125,6 +128,9 @@ main(int argc, /* I - Number of comm +@@ -123,6 +126,9 @@ main(int argc, /* I - Number of comm #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET) struct sigaction action; /* Actions for POSIX signals */ #endif /* HAVE_SIGACTION && !HAVE_SIGSET */ @@ -1867,7 +1867,7 @@ diff -up cups-2.2.10/scheduler/main.c.lspp cups-2.2.10/scheduler/main.c #ifdef __APPLE__ int use_sysman = 1; /* Use system management functions? */ #else -@@ -488,6 +494,25 @@ main(int argc, /* I - Number of comm +@@ -495,6 +501,25 @@ main(int argc, /* I - Number of comm exit(errno); } @@ -1893,7 +1893,7 @@ diff -up cups-2.2.10/scheduler/main.c.lspp cups-2.2.10/scheduler/main.c /* * Let the system know we are busy while we bring up cupsd... */ -@@ -1181,6 +1206,11 @@ main(int argc, /* I - Number of comm +@@ -1201,6 +1226,11 @@ main(int argc, /* I - Number of comm cupsdStopSelect(); @@ -1905,11 +1905,11 @@ diff -up cups-2.2.10/scheduler/main.c.lspp cups-2.2.10/scheduler/main.c return (!stop_scheduler); } -diff -up cups-2.2.10/scheduler/printers.c.lspp cups-2.2.10/scheduler/printers.c ---- cups-2.2.10/scheduler/printers.c.lspp 2018-12-07 20:41:56.000000000 +0100 -+++ cups-2.2.10/scheduler/printers.c 2018-12-14 14:19:25.522442591 +0100 -@@ -11,6 +11,8 @@ - * missing or damaged, see the license at "http://www.cups.org/". +diff -up cups-2.3.0/scheduler/printers.c.lspp cups-2.3.0/scheduler/printers.c +--- cups-2.3.0/scheduler/printers.c.lspp 2019-08-23 17:19:38.000000000 +0200 ++++ cups-2.3.0/scheduler/printers.c 2019-10-07 12:29:17.956658129 +0200 +@@ -8,6 +8,8 @@ + * information. */ +/* (c) Copyright 2005-2006 Hewlett-Packard Development Company, L.P. */ @@ -1917,7 +1917,7 @@ diff -up cups-2.2.10/scheduler/printers.c.lspp cups-2.2.10/scheduler/printers.c /* * Include necessary headers... */ -@@ -35,6 +37,10 @@ +@@ -32,6 +34,10 @@ # include #endif /* __APPLE__ */ @@ -1928,7 +1928,7 @@ diff -up cups-2.2.10/scheduler/printers.c.lspp cups-2.2.10/scheduler/printers.c /* * Local functions... -@@ -2202,6 +2208,13 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p) +@@ -2252,6 +2258,13 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p) ipp_attribute_t *attr; /* Attribute data */ char *name, /* Current user/group name */ *filter; /* Current filter */ @@ -1941,8 +1941,8 @@ diff -up cups-2.2.10/scheduler/printers.c.lspp cups-2.2.10/scheduler/printers.c +#endif /* WITH_LSPP */ - DEBUG_printf(("cupsdSetPrinterAttrs: entering name = %s, type = %x\n", p->name, -@@ -2329,6 +2342,45 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p) + /* +@@ -2378,6 +2391,45 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p) attr->values[1].string.text = _cupsStrAlloc(Classification ? Classification : p->job_sheets[1]); } diff --git a/cups-multilib.patch b/cups-multilib.patch index 3c6bc39..c8d5686 100644 --- a/cups-multilib.patch +++ b/cups-multilib.patch @@ -1,16 +1,14 @@ -diff -up cups-1.5b1/cups-config.in.multilib cups-1.5b1/cups-config.in ---- cups-1.5b1/cups-config.in.multilib 2010-06-16 02:48:25.000000000 +0200 -+++ cups-1.5b1/cups-config.in 2011-05-23 17:33:31.000000000 +0200 -@@ -22,8 +22,10 @@ prefix=@prefix@ +diff -up cups-2.3.0/cups-config.in.multilib cups-2.3.0/cups-config.in +--- cups-2.3.0/cups-config.in.multilib 2019-10-07 12:10:09.508859587 +0200 ++++ cups-2.3.0/cups-config.in 2019-10-07 12:11:56.614025934 +0200 +@@ -17,7 +17,9 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ bindir=@bindir@ includedir=@includedir@ -libdir=@libdir@ --imagelibdir=@libdir@ +# Fetch libdir from gnutls's pkg-config script. This is a bit +# of a cheat, but the cups-devel package requires gnutls-devel anyway. +libdir=`pkg-config --variable=libdir gnutls` -+imagelibdir=`pkg-config --variable=libdir gnutls` datarootdir=@datadir@ datadir=@datadir@ sysconfdir=@sysconfdir@ diff --git a/cups-no-dest.patch b/cups-no-dest.patch deleted file mode 100644 index 2960a8f..0000000 --- a/cups-no-dest.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -up cups-2.2.4/cups/dest.c.no-dest cups-2.2.4/cups/dest.c ---- cups-2.2.4/cups/dest.c.no-dest 2017-10-02 10:39:19.615395062 +0200 -+++ cups-2.2.4/cups/dest.c 2017-10-02 10:39:54.361104943 +0200 -@@ -2059,15 +2059,6 @@ cupsGetDests2(http_t *http, /* I - - - cupsEnumDests(0, 1000, NULL, 0, 0, (cups_dest_cb_t)cups_get_cb, &data); - -- if (cupsLastError() >= IPP_STATUS_REDIRECTION_OTHER_SITE) -- { -- cupsFreeDests(data.num_dests, data.dests); -- -- *dests = (cups_dest_t *)0; -- -- return (0); -- } -- - /* - * Make a copy of the "real" queues for a later sanity check... - */ diff --git a/cups-no-gcry.patch b/cups-no-gcry.patch deleted file mode 100644 index 912ca9c..0000000 --- a/cups-no-gcry.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up cups-2.0rc1/config-scripts/cups-ssl.m4.no-gcry cups-2.0rc1/config-scripts/cups-ssl.m4 ---- cups-2.0rc1/config-scripts/cups-ssl.m4.no-gcry 2014-09-12 15:41:23.324760213 +0200 -+++ cups-2.0rc1/config-scripts/cups-ssl.m4 2014-09-12 15:43:13.124203363 +0200 -@@ -60,7 +60,6 @@ if test x$enable_ssl != xno; then - dnl Then look for GNU TLS... - if test $have_ssl = 0 -a "x$enable_gnutls" != "xno" -a "x$PKGCONFIG" != x; then - AC_PATH_TOOL(LIBGNUTLSCONFIG,libgnutls-config) -- AC_PATH_TOOL(LIBGCRYPTCONFIG,libgcrypt-config) - if $PKGCONFIG --exists gnutls; then - have_ssl=1 - SSLLIBS=`$PKGCONFIG --libs gnutls` -diff -up cups-2.0rc1/cups/http-private.h.no-gcry cups-2.0rc1/cups/http-private.h diff --git a/cups-no-gzip-man.patch b/cups-no-gzip-man.patch deleted file mode 100644 index c476b7b..0000000 --- a/cups-no-gzip-man.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff -up cups-2.2.4/config-scripts/cups-manpages.m4.no-gzip-man cups-2.2.4/config-scripts/cups-manpages.m4 ---- cups-2.2.4/config-scripts/cups-manpages.m4.no-gzip-man 2017-06-30 20:37:09.470034273 +0200 -+++ cups-2.2.4/config-scripts/cups-manpages.m4 2017-06-30 20:39:15.982884832 +0200 -@@ -53,10 +53,10 @@ case "$host_os_name" in - ;; - linux* | gnu* | darwin*) - # Linux, GNU Hurd, and macOS -- MAN1EXT=1.gz -- MAN5EXT=5.gz -- MAN7EXT=7.gz -- MAN8EXT=8.gz -+ MAN1EXT=1 -+ MAN5EXT=5 -+ MAN7EXT=7 -+ MAN8EXT=8 - MAN8DIR=8 - ;; - *) diff --git a/cups-peercred.patch b/cups-peercred.patch deleted file mode 100644 index a106abb..0000000 --- a/cups-peercred.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up cups-1.5b1/scheduler/auth.c.peercred cups-1.5b1/scheduler/auth.c ---- cups-1.5b1/scheduler/auth.c.peercred 2011-05-20 05:49:49.000000000 +0200 -+++ cups-1.5b1/scheduler/auth.c 2011-05-23 18:00:18.000000000 +0200 -@@ -52,6 +52,7 @@ - * Include necessary headers... - */ - -+#define _GNU_SOURCE - #include "cupsd.h" - #include - #ifdef HAVE_SHADOW_H diff --git a/cups-pid.patch b/cups-pid.patch deleted file mode 100644 index 23ffd47..0000000 --- a/cups-pid.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff -up cups-1.5b1/scheduler/main.c.pid cups-1.5b1/scheduler/main.c ---- cups-1.5b1/scheduler/main.c.pid 2011-05-18 22:44:16.000000000 +0200 -+++ cups-1.5b1/scheduler/main.c 2011-05-23 18:01:20.000000000 +0200 -@@ -311,6 +311,8 @@ main(int argc, /* I - Number of comm - * Setup signal handlers for the parent... - */ - -+ pid_t pid; -+ - #ifdef HAVE_SIGSET /* Use System V signals over POSIX to avoid bugs */ - sigset(SIGUSR1, parent_handler); - sigset(SIGCHLD, parent_handler); -@@ -334,7 +336,7 @@ main(int argc, /* I - Number of comm - signal(SIGHUP, SIG_IGN); - #endif /* HAVE_SIGSET */ - -- if (fork() > 0) -+ if ((pid = fork()) > 0) - { - /* - * OK, wait for the child to startup and send us SIGUSR1 or to crash -@@ -346,7 +348,15 @@ main(int argc, /* I - Number of comm - sleep(1); - - if (parent_signal == SIGUSR1) -+ { -+ FILE *f = fopen ("/var/run/cupsd.pid", "w"); -+ if (f) -+ { -+ fprintf (f, "%d\n", pid); -+ fclose (f); -+ } - return (0); -+ } - - if (wait(&i) < 0) - { diff --git a/cups-res_init.patch b/cups-res_init.patch deleted file mode 100644 index 3866521..0000000 --- a/cups-res_init.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -up cups-1.7b1/cups/http-addr.c.res_init cups-1.7b1/cups/http-addr.c ---- cups-1.7b1/cups/http-addr.c.res_init 2013-03-20 19:14:10.000000000 +0100 -+++ cups-1.7b1/cups/http-addr.c 2013-04-19 12:01:36.927512159 +0200 -@@ -319,7 +319,8 @@ httpAddrLookup( - - if (error) - { -- if (error == EAI_FAIL) -+ if (error == EAI_FAIL || error == EAI_AGAIN || error == EAI_NODATA || -+ error == EAI_NONAME) - cg->need_res_init = 1; - - return (httpAddrString(addr, name, namelen)); -diff -up cups-1.7b1/cups/http-addrlist.c.res_init cups-1.7b1/cups/http-addrlist.c ---- cups-1.7b1/cups/http-addrlist.c.res_init 2013-04-19 12:01:36.930512119 +0200 -+++ cups-1.7b1/cups/http-addrlist.c 2013-04-19 12:03:13.769229554 +0200 -@@ -581,7 +581,8 @@ httpAddrGetList(const char *hostname, /* - } - else - { -- if (error == EAI_FAIL) -+ if (error == EAI_FAIL || error == EAI_AGAIN || error == EAI_NODATA || -+ error == EAI_NONAME) - cg->need_res_init = 1; - - _cupsSetError(IPP_STATUS_ERROR_INTERNAL, gai_strerror(error), 0); diff --git a/cups-serverbin-compat.patch b/cups-serverbin-compat.patch deleted file mode 100644 index 5f51e23..0000000 --- a/cups-serverbin-compat.patch +++ /dev/null @@ -1,193 +0,0 @@ -diff -up cups-2.2rc1/scheduler/conf.c.serverbin-compat cups-2.2rc1/scheduler/conf.c ---- cups-2.2rc1/scheduler/conf.c.serverbin-compat 2016-08-08 20:06:00.000000000 +0200 -+++ cups-2.2rc1/scheduler/conf.c 2016-08-09 09:58:21.324033645 +0200 -@@ -609,6 +609,9 @@ cupsdReadConfiguration(void) - cupsdClearString(&ServerName); - cupsdClearString(&ServerAdmin); - cupsdSetString(&ServerBin, CUPS_SERVERBIN); -+#ifdef __x86_64__ -+ cupsdSetString(&ServerBin_compat, "/usr/lib64/cups"); -+#endif /* __x86_64__ */ - cupsdSetString(&RequestRoot, CUPS_REQUESTS); - cupsdSetString(&CacheDir, CUPS_CACHEDIR); - cupsdSetString(&DataDir, CUPS_DATADIR); -@@ -1604,7 +1607,12 @@ cupsdReadConfiguration(void) - * Read the MIME type and conversion database... - */ - -+#ifdef __x86_64__ -+ snprintf(temp, sizeof(temp), "%s/filter:%s/filter", ServerBin, -+ ServerBin_compat); -+#else - snprintf(temp, sizeof(temp), "%s/filter", ServerBin); -+#endif - snprintf(mimedir, sizeof(mimedir), "%s/mime", DataDir); - - MimeDatabase = mimeNew(); -diff -up cups-2.2rc1/scheduler/conf.h.serverbin-compat cups-2.2rc1/scheduler/conf.h ---- cups-2.2rc1/scheduler/conf.h.serverbin-compat 2016-08-08 20:06:00.000000000 +0200 -+++ cups-2.2rc1/scheduler/conf.h 2016-08-09 09:58:21.325033636 +0200 -@@ -106,6 +106,10 @@ VAR char *ConfigurationFile VALUE(NULL) - /* Root directory for scheduler */ - *ServerBin VALUE(NULL), - /* Root directory for binaries */ -+#ifdef __x86_64__ -+ *ServerBin_compat VALUE(NULL), -+ /* Compat directory for binaries */ -+#endif /* __x86_64__ */ - *StateDir VALUE(NULL), - /* Root directory for state data */ - *RequestRoot VALUE(NULL), -diff -up cups-2.2rc1/scheduler/env.c.serverbin-compat cups-2.2rc1/scheduler/env.c ---- cups-2.2rc1/scheduler/env.c.serverbin-compat 2016-08-08 20:06:00.000000000 +0200 -+++ cups-2.2rc1/scheduler/env.c 2016-08-09 09:58:21.325033636 +0200 -@@ -212,8 +212,13 @@ cupsdUpdateEnv(void) - set_if_undefined("LD_PRELOAD", NULL); - set_if_undefined("NLSPATH", NULL); - if (find_env("PATH") < 0) -+#ifdef __x86_64__ -+ cupsdSetEnvf("PATH", "%s/filter:%s/filter:" CUPS_BINDIR ":" CUPS_SBINDIR -+ ":/bin:/usr/bin", ServerBin, ServerBin_compat); -+#else /* ! defined(__x86_64__) */ - cupsdSetEnvf("PATH", "%s/filter:" CUPS_BINDIR ":" CUPS_SBINDIR - ":/bin:/usr/bin", ServerBin); -+#endif - set_if_undefined("SERVER_ADMIN", ServerAdmin); - set_if_undefined("SHLIB_PATH", NULL); - set_if_undefined("SOFTWARE", CUPS_MINIMAL); -diff -up cups-2.2rc1/scheduler/ipp.c.serverbin-compat cups-2.2rc1/scheduler/ipp.c ---- cups-2.2rc1/scheduler/ipp.c.serverbin-compat 2016-08-09 09:58:21.326033626 +0200 -+++ cups-2.2rc1/scheduler/ipp.c 2016-08-09 10:10:16.266127629 +0200 -@@ -2419,12 +2419,21 @@ add_printer(cupsd_client_t *con, /* I - - * Could not find device in list! - */ - -+#ifdef __x86_64__ -+ snprintf(srcfile, sizeof(srcfile), "%s/backend/%s", ServerBin_compat, -+ scheme); -+ if (access(srcfile, X_OK)) -+ { -+#endif /* __x86_64__ */ - send_ipp_status(con, IPP_NOT_POSSIBLE, - _("Bad device-uri scheme \"%s\"."), scheme); - if (!modify) - cupsdDeletePrinter(printer, 0); - - return; -+#ifdef __x86_64__ -+ } -+#endif /* __x86_64__ */ - } - } - -diff -up cups-2.2rc1/scheduler/job.c.serverbin-compat cups-2.2rc1/scheduler/job.c ---- cups-2.2rc1/scheduler/job.c.serverbin-compat 2016-08-08 20:06:00.000000000 +0200 -+++ cups-2.2rc1/scheduler/job.c 2016-08-09 09:58:21.327033616 +0200 -@@ -1126,8 +1126,32 @@ cupsdContinueJob(cupsd_job_t *job) /* I - i ++, filter = (mime_filter_t *)cupsArrayNext(filters)) - { - if (filter->filter[0] != '/') -- snprintf(command, sizeof(command), "%s/filter/%s", ServerBin, -- filter->filter); -+ { -+ snprintf(command, sizeof(command), "%s/filter/%s", ServerBin, -+ filter->filter); -+#ifdef __x86_64__ -+ if (access(command, F_OK)) -+ { -+ snprintf(command, sizeof(command), "%s/filter/%s", -+ ServerBin_compat, filter->filter); -+ if (!access(command, F_OK)) -+ { -+ /* Not in the correct directory, but found it in the compat -+ * directory. Issue a warning. */ -+ cupsdLogMessage(CUPSD_LOG_INFO, -+ "Filter '%s' not in %s/filter!", -+ filter->filter, ServerBin); -+ } -+ else -+ { -+ /* Not in the compat directory either; make any error -+ * messages use the correct directory name then. */ -+ snprintf(command, sizeof(command), "%s/filter/%s", ServerBin, -+ filter->filter); -+ } -+ } -+#endif /* __x86_64__ */ -+ } - else - strlcpy(command, filter->filter, sizeof(command)); - -@@ -1283,6 +1307,28 @@ cupsdContinueJob(cupsd_job_t *job) /* I - { - cupsdClosePipe(job->back_pipes); - cupsdClosePipe(job->side_pipes); -+#ifdef __x86_64__ -+ if (access(command, F_OK)) -+ { -+ snprintf(command, sizeof(command), "%s/backend/%s", ServerBin_compat, -+ scheme); -+ if (!access(command, F_OK)) -+ { -+ /* Not in the correct directory, but we found it in the compat -+ * directory. Issue a warning. */ -+ cupsdLogMessage(CUPSD_LOG_INFO, -+ "Backend '%s' not in %s/backend!", scheme, -+ ServerBin); -+ } -+ else -+ { -+ /* Not in the compat directory either; make any error -+ messages use the correct directory name then. */ -+ snprintf(command, sizeof(command), "%s/backend/%s", ServerBin, -+ scheme); -+ } -+ } -+#endif /* __x86_64__ */ - - close(job->status_pipes[1]); - job->status_pipes[1] = -1; -diff -up cups-2.2rc1/scheduler/printers.c.serverbin-compat cups-2.2rc1/scheduler/printers.c ---- cups-2.2rc1/scheduler/printers.c.serverbin-compat 2016-08-08 20:06:00.000000000 +0200 -+++ cups-2.2rc1/scheduler/printers.c 2016-08-09 09:58:21.327033616 +0200 -@@ -967,9 +967,19 @@ cupsdLoadAllPrinters(void) - * Backend does not exist, stop printer... - */ - -+#ifdef __x86_64__ -+ snprintf(line, sizeof(line), "%s/backend/%s", ServerBin_compat, -+ p->device_uri); -+ if (access(line, 0)) -+ { -+#endif /* __x86_64__ */ -+ - p->state = IPP_PRINTER_STOPPED; - snprintf(p->state_message, sizeof(p->state_message), - "Backend %s does not exist!", line); -+#ifdef __x86_64__ -+ } -+#endif /* __x86_64__ */ - } - } - -@@ -3481,8 +3491,20 @@ add_printer_filter( - else - snprintf(filename, sizeof(filename), "%s/filter/%s", ServerBin, program); - -+#ifdef __x86_64__ -+ if (_cupsFileCheck(filename, _CUPS_FILE_CHECK_PROGRAM, !RunUser, -+ cupsdLogFCMessage, p) == _CUPS_FILE_CHECK_MISSING) { -+ snprintf(filename, sizeof(filename), "%s/filter/%s", ServerBin_compat, -+ program); -+ if (_cupsFileCheck(filename, _CUPS_FILE_CHECK_PROGRAM, !RunUser, -+ cupsdLogFCMessage, p) == _CUPS_FILE_CHECK_MISSING) -+ snprintf(filename, sizeof(filename), "%s/filter/%s", ServerBin, -+ program); -+ } -+#else /* ! defined(__x86_64__) */ - _cupsFileCheck(filename, _CUPS_FILE_CHECK_PROGRAM, !RunUser, - cupsdLogFCMessage, p); -+#endif - } - - /* diff --git a/cups-str3382.patch b/cups-str3382.patch deleted file mode 100644 index 7f5b3b1..0000000 --- a/cups-str3382.patch +++ /dev/null @@ -1,62 +0,0 @@ -diff -up cups-2.2.7/cups/tempfile.c.str3382 cups-2.2.7/cups/tempfile.c ---- cups-2.2.7/cups/tempfile.c.str3382 2018-03-23 04:48:36.000000000 +0100 -+++ cups-2.2.7/cups/tempfile.c 2018-04-03 14:21:54.567221492 +0200 -@@ -25,6 +25,7 @@ - # include - #else - # include -+# include - #endif /* WIN32 || __EMX__ */ - - -@@ -48,7 +49,7 @@ cupsTempFd(char *filename, /* I - Point - #ifdef WIN32 - DWORD curtime; /* Current time */ - #else -- struct timeval curtime; /* Current time */ -+ mode_t old_umask; /* Old umask before using mkstemp() */ - #endif /* WIN32 */ - - -@@ -114,32 +115,24 @@ cupsTempFd(char *filename, /* I - Point - */ - - snprintf(filename, (size_t)len - 1, "%s/%05lx%08lx", tmpdir, GetCurrentProcessId(), curtime); --#else -- /* -- * Get the current time of day... -- */ -- -- gettimeofday(&curtime, NULL); -- -- /* -- * Format a string using the hex time values... -- */ -- -- snprintf(filename, (size_t)len - 1, "%s/%05x%08x", tmpdir, (unsigned)getpid(), (unsigned)(curtime.tv_sec + curtime.tv_usec + tries)); --#endif /* WIN32 */ - - /* - * Open the file in "exclusive" mode, making sure that we don't - * stomp on an existing file or someone's symlink crack... - */ - --#ifdef WIN32 - fd = open(filename, _O_CREAT | _O_RDWR | _O_TRUNC | _O_BINARY, - _S_IREAD | _S_IWRITE); --#elif defined(O_NOFOLLOW) -- fd = open(filename, O_RDWR | O_CREAT | O_EXCL | O_NOFOLLOW, 0600); - #else -- fd = open(filename, O_RDWR | O_CREAT | O_EXCL, 0600); -+ /* -+ * Use the standard mkstemp() call to make a temporary filename -+ * securely. -- andrew.wood@jdplc.com -+ */ -+ snprintf(filename, len - 1, "%s/cupsXXXXXX", tmpdir); -+ -+ old_umask = umask(0077); -+ fd = mkstemp(filename); -+ umask(old_umask); - #endif /* WIN32 */ - - if (fd < 0 && errno != EEXIST) diff --git a/cups-strict-ppd-line-length.patch b/cups-strict-ppd-line-length.patch deleted file mode 100644 index 4ba1dd2..0000000 --- a/cups-strict-ppd-line-length.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff -up cups-2.0rc1/cups/ppd.c.strict-ppd-line-length cups-2.0rc1/cups/ppd.c ---- cups-2.0rc1/cups/ppd.c.strict-ppd-line-length 2014-02-06 19:33:34.000000000 +0100 -+++ cups-2.0rc1/cups/ppd.c 2014-09-12 18:07:44.227773710 +0200 -@@ -2872,7 +2872,7 @@ ppd_read(cups_file_t *fp, /* I - Fil - *lineptr++ = (char)ch; - col ++; - -- if (col > (PPD_MAX_LINE - 1)) -+ if (col > (PPD_MAX_LINE - 1) && pg->ppd_conform == PPD_CONFORM_STRICT) - { - /* - * Line is too long... -@@ -2933,7 +2933,7 @@ ppd_read(cups_file_t *fp, /* I - Fil - { - col ++; - -- if (col > (PPD_MAX_LINE - 1)) -+ if (col > (PPD_MAX_LINE - 1) && pg->ppd_conform == PPD_CONFORM_STRICT) - { - /* - * Line is too long... -@@ -2992,7 +2992,7 @@ ppd_read(cups_file_t *fp, /* I - Fil - { - col ++; - -- if (col > (PPD_MAX_LINE - 1)) -+ if (col > (PPD_MAX_LINE - 1) && pg->ppd_conform == PPD_CONFORM_STRICT) - { - /* - * Line is too long... diff --git a/cups-substitute-bad-attrs.patch b/cups-substitute-bad-attrs.patch deleted file mode 100644 index 37e65a1..0000000 --- a/cups-substitute-bad-attrs.patch +++ /dev/null @@ -1,141 +0,0 @@ -diff -up cups-2.2.7/scheduler/ipp.c.substitute-bad-attrs cups-2.2.7/scheduler/ipp.c ---- cups-2.2.7/scheduler/ipp.c.substitute-bad-attrs 2018-04-03 15:55:45.974344993 +0200 -+++ cups-2.2.7/scheduler/ipp.c 2018-04-03 16:15:06.723859881 +0200 -@@ -164,6 +164,7 @@ cupsdProcessIPPRequest( - ipp_attribute_t *uri = NULL; /* Printer or job URI attribute */ - ipp_attribute_t *username; /* requesting-user-name attr */ - int sub_id; /* Subscription ID */ -+ int valid = 1; /* Valid request? */ - - - cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdProcessIPPRequest(%p[%d]): operation_id=%04x(%s)", con, con->number, con->request->request.op.operation_id, ippOpString(con->request->request.op.operation_id)); -@@ -423,20 +424,55 @@ cupsdProcessIPPRequest( - else - { - /* -- * OK, all the checks pass so far; make sure requesting-user-name is -- * not "root" from a remote host... -+ * OK, all the checks pass so far; validate "requesting-user-name" -+ * attribute value... - */ - -- if ((username = ippFindAttribute(con->request, "requesting-user-name", -- IPP_TAG_NAME)) != NULL) -- { -- /* -- * Check for root user... -- */ -- -- if (!strcmp(username->values[0].string.text, "root") && -- _cups_strcasecmp(con->http->hostname, "localhost") && -- strcmp(con->username, "root")) -+ if ((username = ippFindAttribute(con->request, "requesting-user-name", IPP_TAG_ZERO)) != NULL) -+ { -+ /* -+ * Validate "requesting-user-name"... -+ */ -+ -+ if (username->group_tag != IPP_TAG_OPERATION && StrictConformance) -+ { -+ cupsdAddEvent(CUPSD_EVENT_SERVER_AUDIT, NULL, NULL, "%04X %s \"requesting-user-name\" attribute in wrong group.", IPP_STATUS_ERROR_BAD_REQUEST, con->http->hostname); -+ send_ipp_status(con, IPP_STATUS_ERROR_BAD_REQUEST, _("\"requesting-user-name\" attribute in wrong group.")); -+ valid = 0; -+ } -+ else if (username->value_tag != IPP_TAG_NAME && username->value_tag != IPP_TAG_NAMELANG) -+ { -+ cupsdAddEvent(CUPSD_EVENT_SERVER_AUDIT, NULL, NULL, "%04X %s \"requesting-user-name\" attribute with wrong syntax.", IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES, con->http->hostname); -+ send_ipp_status(con, IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES, _("\"requesting-user-name\" attribute with wrong syntax.")); -+ if ((attr = ippCopyAttribute(con->response, username, 0)) != NULL) -+ attr->group_tag = IPP_TAG_UNSUPPORTED_GROUP; -+ valid = 0; -+ } -+ else if (!ippValidateAttribute(username)) -+ { -+ cupsdAddEvent(CUPSD_EVENT_SERVER_AUDIT, NULL, NULL, "%04X %s \"requesting-user-name\" attribute with bad value.", IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES, con->http->hostname); -+ -+ if (StrictConformance) -+ { -+ /* -+ * Throw an error... -+ */ -+ -+ send_ipp_status(con, IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES, _("\"requesting-user-name\" attribute with wrong syntax.")); -+ if ((attr = ippCopyAttribute(con->response, username, 0)) != NULL) -+ attr->group_tag = IPP_TAG_UNSUPPORTED_GROUP; -+ valid = 0; -+ } -+ else -+ { -+ /* -+ * Map bad "requesting-user-name" to 'anonymous'... -+ */ -+ -+ ippSetString(con->request, &username, 0, "anonymous"); -+ } -+ } -+ else if (!strcmp(username->values[0].string.text, "root") && _cups_strcasecmp(con->http->hostname, "localhost") && strcmp(con->username, "root")) - { - /* - * Remote unauthenticated user masquerading as local root... -@@ -452,6 +488,8 @@ cupsdProcessIPPRequest( - else - sub_id = 0; - -+ if (valid) -+ { - /* - * Then try processing the operation... - */ -@@ -655,6 +693,7 @@ cupsdProcessIPPRequest( - ippOpString( - con->request->request.op.operation_id)); - break; -+ } - } - } - } -@@ -1615,27 +1654,34 @@ add_job(cupsd_client_t *con, /* I - Cl - _("Bad job-name value: Wrong type or count.")); - if ((attr = ippCopyAttribute(con->response, attr, 0)) != NULL) - attr->group_tag = IPP_TAG_UNSUPPORTED_GROUP; -- return (NULL); -+ -+ if (StrictConformance) -+ return (NULL); -+ -+ /* Don't use invalid attribute */ -+ ippDeleteAttribute(con->request, attr); -+ -+ ippAddString(con->request, IPP_TAG_JOB, IPP_TAG_NAME, "job-name", NULL, "Untitled"); - } - else if (!ippValidateAttribute(attr)) - { - send_ipp_status(con, IPP_ATTRIBUTES, _("Bad job-name value: %s"), - cupsLastErrorString()); -+ - if ((attr = ippCopyAttribute(con->response, attr, 0)) != NULL) - attr->group_tag = IPP_TAG_UNSUPPORTED_GROUP; -- return (NULL); -- } - -- attr = ippFindAttribute(con->request, "requesting-user-name", IPP_TAG_NAME); -+ if (StrictConformance) -+ return (NULL); - -- if (attr && !ippValidateAttribute(attr)) -- { -- send_ipp_status(con, IPP_ATTRIBUTES, _("Bad requesting-user-name value: %s"), cupsLastErrorString()); -- if ((attr = ippCopyAttribute(con->response, attr, 0)) != NULL) -- attr->group_tag = IPP_TAG_UNSUPPORTED_GROUP; -- return (NULL); -+ /* Don't use invalid attribute */ -+ ippDeleteAttribute(con->request, attr); -+ -+ ippAddString(con->request, IPP_TAG_JOB, IPP_TAG_NAME, "job-name", NULL, "Untitled"); - } - -+ attr = ippFindAttribute(con->request, "requesting-user-name", IPP_TAG_NAME); -+ - #ifdef WITH_LSPP - if (is_lspp_config()) - { diff --git a/cups-synconclose.patch b/cups-synconclose.patch index 0dc5b53..380be94 100644 --- a/cups-synconclose.patch +++ b/cups-synconclose.patch @@ -23,8 +23,8 @@ diff -up cups-2.2.12/doc/help/man-cups-files.conf.html.synconclose cups-2.2.12/d
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.man.in.synconclose 2019-08-16 00:35:30.000000000 +0200 -+++ cups-2.2.12/man/cups-files.conf.man.in 2019-08-19 09:58:14.646567949 +0200 +--- 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) diff --git a/cups-use-ipp1.1.patch b/cups-use-ipp1.1.patch deleted file mode 100644 index 41855fc..0000000 --- a/cups-use-ipp1.1.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up cups-1.6.3/cups/usersys.c.use-ipp1.1 cups-1.6.3/cups/usersys.c ---- cups-1.6.3/cups/usersys.c.use-ipp1.1 2013-07-12 11:41:45.368837618 +0200 -+++ cups-1.6.3/cups/usersys.c 2013-07-12 11:41:45.391837299 +0200 -@@ -366,7 +366,7 @@ cupsSetServer(const char *server) /* I - - cg->server_version = 22; - } - else -- cg->server_version = 20; -+ cg->server_version = 11; - - if (cg->server[0] != '/' && (port = strrchr(cg->server, ':')) != NULL && - !strchr(port, ']') && isdigit(port[1] & 255)) diff --git a/cups.spec b/cups.spec index cd6aa2b..96d67b5 100644 --- a/cups.spec +++ b/cups.spec @@ -14,134 +14,98 @@ Summary: CUPS printing system Name: cups Epoch: 1 -Version: 2.2.12 -Release: 3%{?dist} -License: GPLv2+ and LGPLv2+ with exceptions and AML +Version: 2.3.0 +Release: 1%{?dist} +License: ASL 2.0 with exceptions for GPL2/LGPL2 Url: http://www.cups.org/ Source0: https://github.com/apple/cups/releases/download/v%{VERSION}/cups-%{VERSION}-source.tar.gz # Pixmap for desktop file -Source2: cupsprinter.png +Source1: cupsprinter.png # Logrotate configuration -Source6: cups.logrotate +Source2: cups.logrotate # Backend for NCP protocol -Source7: ncp.backend -Source8: macros.cups +Source3: ncp.backend +Source4: macros.cups -# some man pages are shipped gzipped, don't do it -Patch1: cups-no-gzip-man.patch # PAM enablement, very old patch, not even git can track when or why # the patch was added. -Patch2: cups-system-auth.patch +Patch1: cups-system-auth.patch # cups-config from devel package conflicted on multilib arches, # fixed hack with pkg-config calling for gnutls' libdir variable -Patch3: cups-multilib.patch +Patch2: cups-multilib.patch # if someone makes a change to banner files, then there will .rpmnew # with next update of cups-filters - this patch makes sure the banner file # changed by user is used and .rpmnew or .rpmsave is ignored # Note: This could be rewrite with use a kind of #define and send to upstream -Patch5: cups-banners.patch +Patch3: cups-banners.patch # don't export ssl libs to cups-config - can't find the reason. -Patch7: cups-no-export-ssllibs.patch +Patch4: cups-no-export-ssllibs.patch # enables old uri usb:/dev/usb/lp0 - leave it here for users of old printers -Patch8: cups-direct-usb.patch +Patch5: cups-direct-usb.patch # fix for redhat dbus spooler - adding new dbus functions to backend/ipp.c # -> initialize dbus connection and sending dbus broadcast about job queued # on remote queue with QueueChanged type for PRINTER_CHANGED, JOB_STATE_CHANGED # and PRINTER_STATE_CHANGED events -Patch12: cups-eggcups.patch +Patch6: cups-eggcups.patch # when system workload is high, timeout for cups-driverd can be reached - # increase the timeout -Patch13: cups-driverd-timeout.patch +Patch7: cups-driverd-timeout.patch # cupsd implement its own logrotate, but when MaxLogSize 0 is used, logrotated # takes care of it -Patch15: cups-logrotate.patch +Patch8: cups-logrotate.patch # usb backend didn't get any notification about out-of-paper because of kernel -Patch16: cups-usb-paperout.patch +Patch9: cups-usb-paperout.patch # uri compatibility with old Fedoras -Patch19: cups-uri-compat.patch +Patch10: cups-uri-compat.patch # fixing snmp oid for hp printer - upstream doesn't want to support too much # snmp backend, because it's deprecated -Patch22: cups-hp-deviceid-oid.patch +Patch11: cups-hp-deviceid-oid.patch # same as HP OID -Patch24: cups-ricoh-deviceid-oid.patch +Patch12: cups-ricoh-deviceid-oid.patch # change to notify type, because when it fails to start, it gives a error # message + renaming org.cups.cupsd names, because we have cups units in # in older Fedoras -Patch25: cups-systemd-socket.patch +Patch13: cups-systemd-socket.patch # use IP_FREEBIND, because cupsd cannot bind to not yet existing IP address # by default -Patch30: cups-freebind.patch +Patch14: cups-freebind.patch # add support of multifile -Patch35: cups-ipp-multifile.patch +Patch15: cups-ipp-multifile.patch # prolongs web ui timeout -Patch36: cups-web-devices-timeout.patch +Patch16: cups-web-devices-timeout.patch # needs to be set to Yes to avoid race conditions -Patch37: cups-synconclose.patch +Patch17: cups-synconclose.patch # ypbind must be started before cups if NIS configured -Patch38: cups-ypbind.patch +Patch18: cups-ypbind.patch # failover backend for implementing failover functionality # TODO: move it to the cups-filters upstream -Patch39: cups-failover-backend.patch +Patch19: cups-failover-backend.patch + +# reported upstream +# adds logs when job fails due bad conversion +Patch20: cups-filter-debug.patch +# add device id for dymo printer +Patch21: cups-dymo-deviceid.patch # selinux and audit enablement for CUPS - needs work and CUPS upstream wants # to have these features implemented their way in the future Patch100: cups-lspp.patch -# reported upstream or upstream patches - possible removal later -# adding --help option to lpr command -Patch9: cups-lpr-help.patch -# adds logs when job fails due bad conversion -Patch18: cups-filter-debug.patch -# add device id for dymo printer -Patch29: cups-dymo-deviceid.patch - #### UPSTREAM PATCHES #### # cupsctl does not work in 2.2.12, because systemd does not have launch-on-demand feature -Patch40: 0001-Add-workaround-for-systemd-s-lack-of-true-launch-on-.patch -# SIGSEGV in web ui -Patch41: 0001-SIGSEGV-in-CUPS-web-ui-when-adding-a-printer.patch +Patch1001: 0001-Add-workaround-for-systemd-s-lack-of-true-launch-on-.patch +# cannot modify printer uri or create raw print queue +Patch1002: 0001-Fix-handling-of-printer-resource-files-Issue-5652.patch # some ppds use custom keyword, which is incorrect - the correct is 'Custom Size' and ppd # parser ended with error when encountered it. Now the parser adds underscore to incorrect # keyword and continues -Patch42: 0001-PPD-files-containing-custom-option-keywords-did-not-.patch +Patch1003: 0001-PPD-files-containing-custom-option-keywords-did-not-.patch +# SIGSEGV in web ui +Patch1004: 0001-SIGSEGV-in-CUPS-web-ui-when-adding-a-printer.patch ##### Patches removed because IMHO they aren't no longer needed ##### but still I'll leave them in git in case their removal ##### breaks something. -# every filter and backend should be in /usr/lib/cups, the patch for -# for /usr/lib64/cups is not needed -#Patch6: cups-serverbin-compat.patch -# is included in http-private.h, which is included in -# cups-private.h and cups-private.h is included in cupsd.h -#Patch10: cups-peercred.patch -# cupsd doesn't save its pid number by default - the patch was introduced for -# initscripts, which are deprecated - I'll remove this patch for now -#Patch11: cups-pid.patch -# enforce ppd line length only when PPD_CONFORM_STRICT is set for old -# foomatic (from RHEL 3/4) -#Patch14: cups-strict-ppd-line-length.patch -# glibc's getaddrinfo now reacts on changes in /etc/resolv.conf and restarts -# resolver by itself (https://bugzilla.redhat.com/show_bug.cgi?id=1374239) -#Patch17: cups-res_init.patch -# upstream especially doesn't want to use mkstemp because of bad API and -# portability - because it is patch because of depreacated cups-lpd, -# I remove it because of divergence from upstream -#Patch20: cups-str3382.patch -# now done by configure option -#Patch21: cups-0755.patch -# markes fuzzy device ids - created from mdns message - with FZY, not in upstream -# not clear benefit - removing for now -#Patch23: cups-dnssd-deviceid.patch -# upstream rejected this patch, don't diverge from upstream - when trying to use -# dnssd uri discovered by dnssd backend then printing failed -#Patch27: cups-avahi-address.patch -# seems unnecessary derivation from upstream -#Patch31: cups-no-gcry.patch -# Removing this patch, because we want to default to IPP 2.0, which is needed -# by IPP Everywhere -#Patch33: cups-use-ipp1.1.patch -# rejected by upstream, possibly fixed by str4347.patch according upstream -#Patch34: cups-avahi-no-threaded.patch Requires: %{name}-filesystem = %{epoch}:%{version}-%{release} Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} @@ -231,6 +195,14 @@ Provides: lpd Summary: CUPS printing system - tool for performing IPP requests Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +%package printerapp +Summary: CUPS printing system - tools for printer application +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +# ippeveprinter needs avahi for registering and sharing printer +Requires: avahi +# needed for mdns hostname translation +Requires: nss-mdns + %description CUPS printing system provides a portable printing layer for UNIX® operating systems. It has been developed by Apple Inc. @@ -268,91 +240,74 @@ lpd emulation. %description ipptool Sends IPP requests to the specified URI and tests and/or displays the results. +%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. + %prep %setup -q -n cups-%{VERSION} -# Don't gzip man pages in the Makefile, let rpmbuild do it. -%patch1 -p1 -b .no-gzip-man # Use the system pam configuration. -%patch2 -p1 -b .system-auth +%patch1 -p1 -b .system-auth # Prevent multilib conflict in cups-config script. -%patch3 -p1 -b .multilib +%patch2 -p1 -b .multilib # Ignore rpm save/new files in the banners directory. -%patch5 -p1 -b .banners -# Use compatibility fallback path for ServerBin. -#%%patch6 -p1 -b .serverbin-compat +%patch3 -p1 -b .banners # Don't export SSLLIBS to cups-config. -%patch7 -p1 -b .no-export-ssllibs +%patch4 -p1 -b .no-export-ssllibs # Allow file-based usb device URIs. -%patch8 -p1 -b .direct-usb -# Add --help option to lpr. -%patch9 -p1 -b .lpr-help -# Fix compilation of peer credentials support. -#%%patch10 -p1 -b .peercred -# Maintain a cupsd.pid file. -#%%patch11 -p1 -b .pid -# Fix implementation of com.redhat.PrinterSpooler D-Bus object. -%patch12 -p1 -b .eggcups +%patch5 -p1 -b .direct-usb # Increase driverd timeout to 70s to accommodate foomatic (bug #744715). -%patch13 -p1 -b .driverd-timeout -# Only enforce maximum PPD line length when in strict mode. -#%%patch14 -p1 -b .strict-ppd-line-length +%patch7 -p1 -b .driverd-timeout # Re-open the log if it has been logrotated under us. -%patch15 -p1 -b .logrotate +%patch8 -p1 -b .logrotate # Support for errno==ENOSPACE-based USB paper-out reporting. -%patch16 -p1 -b .usb-paperout -# Re-initialise the resolver on failure in httpAddrGetList() (bug #567353). -#%%patch17 -p1 -b .res_init -# Log extra debugging information if no filters are available. -%patch18 -p1 -b .filter-debug +%patch9 -p1 -b .usb-paperout # Allow the usb backend to understand old-style URI formats. -%patch19 -p1 -b .uri-compat -# Fix temporary filename creation. -#%%patch20 -p1 -b .str3382 -# Use mode 0755 for binaries and libraries where appropriate. -#%%patch21 -p1 -b .0755 +%patch10 -p1 -b .uri-compat # Add an SNMP query for HP's device ID OID (STR #3552). -%patch22 -p1 -b .hp-deviceid-oid -# Mark DNS-SD Device IDs that have been guessed at with "FZY:1;". -#%%patch23 -p1 -b .dnssd-deviceid +%patch11 -p1 -b .hp-deviceid-oid # Add an SNMP query for Ricoh's device ID OID (STR #3552). -%patch24 -p1 -b .ricoh-deviceid-oid +%patch12 -p1 -b .ricoh-deviceid-oid # Make cups.service Type=notify (bug #1088918). -%patch25 -p1 -b .systemd-socket -# Use IP address when resolving DNSSD URIs (bug #948288). -#%%patch27 -p1 -b .avahi-address -# Added IEEE 1284 Device ID for a Dymo device (bug #747866). -%patch29 -p1 -b .dymo-deviceid +%patch13 -p1 -b .systemd-socket # Use IP_FREEBIND socket option when binding listening sockets (bug #970809). -%patch30 -p1 -b .freebind -# Don't link against libgcrypt needlessly. -#%%patch31 -p1 -b .no-gcry -# Default to IPP/1.1 for now (bug #977813). -#%%patch33 -p1 -b .use-ipp1.1 -# Don't use D-Bus from two threads (bug #979748). -#%%patch34 -p1 -b .avahi-no-threaded +%patch14 -p1 -b .freebind # Fixes for jobs with multiple files and multiple formats. -%patch35 -p1 -b .ipp-multifile +%patch15 -p1 -b .ipp-multifile # Increase web interface get-devices timeout to 10s (bug #996664). -%patch36 -p1 -b .web-devices-timeout +%patch16 -p1 -b .web-devices-timeout # Set the default for SyncOnClose to Yes. -%patch37 -p1 -b .synconclose +%patch17 -p1 -b .synconclose # CUPS may fail to start if NIS groups are used (bug #1494558) -%patch38 -p1 -b .ypbind +%patch18 -p1 -b .ypbind # Add failover backend (bug #1689209) -%patch39 -p1 -b .failover +%patch19 -p1 -b .failover %if %{lspp} # LSPP support. %patch100 -p1 -b .lspp %endif +# Log extra debugging information if no filters are available. +%patch20 -p1 -b .filter-debug +# Added IEEE 1284 Device ID for a Dymo device (bug #747866). +%patch21 -p1 -b .dymo-deviceid + #### UPSTREAMED PATCHES #### -# issue saw in upstream #5640 -%patch40 -p1 -b .cupsctl-not-working -# 1720688 - [abrt] cups: __strlen_avx2(): printers.cgi killed by SIGSEGV -%patch41 -p1 -b .webui-sigsegv +%patch1001 -p1 -b .cupsctl-not-working +# unable to modify device uri +%patch1002 -p1 -b .cannot-modify-uri # 1750904 - cups is unable to add ppd with custom/Custom option -%patch42 -p1 -b .ppd-custom-option +%patch1003 -p1 -b .ppd-custom-option +# 1720688 - [abrt] cups: __strlen_avx2(): printers.cgi killed by SIGSEGV +%patch1004 -p1 -b .webui-sigsegv + +# removed dbus patch - seems breaking things +# Fix implementation of com.redhat.PrinterSpooler D-Bus object. +#%%patch6 -p1 -b .eggcups # if cupsd is set to log into /var/log/cups, then 'MaxLogSize 0' needs to be # in cupsd.conf to disable cupsd logrotate functionality and use logrotated @@ -444,13 +399,13 @@ mv %{buildroot}%{_unitdir}/org.cups.cups-lpd@.service %{buildroot}%{_unitdir}/cu /bin/sed -i -e "s,org.cups.cupsd,cups,g" %{buildroot}%{_unitdir}/cups.service mkdir -p %{buildroot}%{_datadir}/pixmaps %{buildroot}%{_sysconfdir}/X11/sysconfig %{buildroot}%{_sysconfdir}/X11/applnk/System %{buildroot}%{_sysconfdir}/logrotate.d -install -p -m 644 %{SOURCE2} %{buildroot}%{_datadir}/pixmaps -install -p -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/logrotate.d/cups -install -p -m 755 %{SOURCE7} %{buildroot}%{cups_serverbin}/backend/ncp +install -p -m 644 %{SOURCE1} %{buildroot}%{_datadir}/pixmaps +install -p -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/cups +install -p -m 755 %{SOURCE3} %{buildroot}%{cups_serverbin}/backend/ncp # Ship an rpm macro for where to put driver executables. mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d -install -m 0644 %{SOURCE8} %{buildroot}%{_rpmconfigdir}/macros.d +install -m 0644 %{SOURCE4} %{buildroot}%{_rpmconfigdir}/macros.d # Ship a printers.conf file, and a client.conf file. That way, they get # their SELinux file contexts set correctly. @@ -658,7 +613,7 @@ rm -f %{cups_serverbin}/backend/smb %{_unitdir}/%{name}.socket %{_unitdir}/%{name}.path %{_bindir}/cupstestppd -%{_bindir}/cupstestdsc +#%%{_bindir}/cupstestdsc %{_bindir}/ppd* %{cups_serverbin}/backend/* %{cups_serverbin}/cgi-bin @@ -718,7 +673,8 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man8/lpc-cups.8.gz %files libs -%{license} LICENSE.txt +%{license} LICENSE +%{license} NOTICE %{_libdir}/libcups.so.2 %{_libdir}/libcupsimage.so.2 @@ -758,7 +714,18 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man1/ipptool.1.gz %{_mandir}/man5/ipptoolfile.5.gz +%files printerapp +%{_bindir}/ippeveprinter +%dir %{cups_serverbin}/command +%{cups_serverbin}/command/ippevepcl +%{cups_serverbin}/command/ippeveps +%{_mandir}/man1/ippeveprinter.1.gz +%{_mandir}/man7/ippevepcl.7.gz + %changelog +* Mon Nov 18 2019 Zdenek Dohnal - 1:2.3.0-1 +- 2.3.0 - new printerapp subpackage + * Wed Oct 16 2019 Zdenek Dohnal - 1:2.2.12-3 - 1720688 - [abrt] cups: __strlen_avx2(): printers.cgi killed by SIGSEGV - 1750904 - cups is unable to add ppd with custom/Custom option diff --git a/sources b/sources index 15a1f60..9bcc845 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (cups-2.2.12-source.tar.gz) = b8e7be512938ad388d469d093ad0c882ab42ea1408c27a91340f8424aa0e79e588df3d59795624973b89074a2af650fa9b5b6ed5224138b17e4c6dbbcbf0a2e6 +SHA512 (cups-2.3.0-source.tar.gz) = c51f173b5fbae1554a3f4a3786fb3b5566e50d9f775473788ee3553922ac7e02e4785492c87c93fd46f159f50d97cc10ff6feafb3397cd9c1840840f3a9cdfae