diff -Nru cups-2.3.1/debian/changelog cups-2.3.1/debian/changelog --- cups-2.3.1/debian/changelog 2020-02-17 08:19:56.000000000 +0000 +++ cups-2.3.1/debian/changelog 2020-02-24 15:45:01.000000000 +0000 @@ -1,3 +1,26 @@ +cups (2.3.1-9ubuntu1) focal; urgency=medium + + * Revert all the CI test changes + * Add the bug fixes (not CI test changes of 2.3.1-10: + - Add Requires=cups.socket to cups.service, to make sure they start in + the right order + - Add patch proposal from RedHat to fix leakage of ppd (Issue: #5738) + + -- Till Kamppeter Mon, 24 Feb 2020 16:45:01 +0100 + +cups (2.3.1-9) unstable; urgency=medium + + * CI Tests: Ensure the job files are non-empty; should detect more + regressions + + -- Didier Raboud Sat, 22 Feb 2020 17:19:46 +0100 + +cups (2.3.1-8) unstable; urgency=medium + + * Add patch to fix cupsctl when loading cupsd.conf (Issue: #5744) + + -- Didier Raboud Sat, 22 Feb 2020 14:34:48 +0100 + cups (2.3.1-7) unstable; urgency=medium * Add patch to fix conversion of PPD InputSlot choice names; this should fix diff -Nru cups-2.3.1/debian/patches/0005-Fix-scheduler-cupsd.conf-load.patch cups-2.3.1/debian/patches/0005-Fix-scheduler-cupsd.conf-load.patch --- cups-2.3.1/debian/patches/0005-Fix-scheduler-cupsd.conf-load.patch 1970-01-01 00:00:00.000000000 +0000 +++ cups-2.3.1/debian/patches/0005-Fix-scheduler-cupsd.conf-load.patch 2020-02-24 15:32:01.000000000 +0000 @@ -0,0 +1,86 @@ +From: Till Kamppeter +Date: Sat, 22 Feb 2020 14:28:58 +0100 +Subject: Fix scheduler cupsd.conf load + +When running it without arguments it is supposed to read the local CUPS's +cupsd.conf and show a summary of the setting. in CUPS 2.3.1 it shows a mess +with a lot of HTML inside and this is due to the fact that when loading the +file via HTTP using the /admin/cups/cupsd.conf path the scheduler calls the +admin.cgi program which returns the admin front page of the web admin +interface. cupsctl then tries to interpret that as the config file and displays +garbage. Even worse is if you run cupsctl with command line argument (one of +the five switches or a key=value pair) to change a setting. It seems to load +cupsd.conf again and gets again the HTML code of the web interface page. +cupsctl tries to interpret this again, producing garbage, adds the +user-supplied setting and writes all this back into cupsd.conf. Then it tries +to restart the scheduler which fails due to the broken config file. +The problem is that in the file scheduler/client.conf, in the function +get_file() the URI from the client is at first checked whether it begins with +"/admin/" and in this case the CGI program admin.cgi is responsible. Only after +that the check for "/admin/conf/cupsd.conf" comes and is never reached. +I have changed the order now appropriately and this way cupsctl works again. +Note that the problem only occurs if the web interface is active and the +cupsctl command is issued by a non-root user. +This is a regression caused by issue #5652. + +Bug: https://github.com/apple/cups/issues/5744 +--- + scheduler/client.c | 38 +++++++++++++++++++------------------- + 1 file changed, 19 insertions(+), 19 deletions(-) + +diff --git a/scheduler/client.c b/scheduler/client.c +index c2ee8f1..54b841b 100644 +--- a/scheduler/client.c ++++ b/scheduler/client.c +@@ -2789,6 +2789,25 @@ get_file(cupsd_client_t *con, /* I - Client connection */ + + perm_check = 0; + } ++ else if (!strcmp(con->uri, "/admin/conf/cupsd.conf")) ++ { ++ strlcpy(filename, ConfigurationFile, len); ++ ++ perm_check = 0; ++ } ++ else if (!strncmp(con->uri, "/admin/log/", 11)) ++ { ++ if (!strncmp(con->uri + 11, "access_log", 10) && AccessLog[0] == '/') ++ strlcpy(filename, AccessLog, len); ++ else if (!strncmp(con->uri + 11, "error_log", 9) && ErrorLog[0] == '/') ++ strlcpy(filename, ErrorLog, len); ++ else if (!strncmp(con->uri + 11, "page_log", 8) && PageLog[0] == '/') ++ strlcpy(filename, PageLog, len); ++ else ++ return (NULL); ++ ++ 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)) + { + /* +@@ -2822,25 +2841,6 @@ get_file(cupsd_client_t *con, /* I - Client connection */ + + perm_check = 0; + } +- else if (!strcmp(con->uri, "/admin/conf/cupsd.conf")) +- { +- strlcpy(filename, ConfigurationFile, len); +- +- perm_check = 0; +- } +- else if (!strncmp(con->uri, "/admin/log/", 11)) +- { +- if (!strncmp(con->uri + 11, "access_log", 10) && AccessLog[0] == '/') +- strlcpy(filename, AccessLog, len); +- else if (!strncmp(con->uri + 11, "error_log", 9) && ErrorLog[0] == '/') +- strlcpy(filename, ErrorLog, len); +- else if (!strncmp(con->uri + 11, "page_log", 8) && PageLog[0] == '/') +- strlcpy(filename, PageLog, len); +- else +- return (NULL); +- +- perm_check = 0; +- } + else if (con->language) + { + snprintf(language, sizeof(language), "/%s", con->language->language); diff -Nru cups-2.3.1/debian/patches/0006-Fix-leakage-of-ppd.patch cups-2.3.1/debian/patches/0006-Fix-leakage-of-ppd.patch --- cups-2.3.1/debian/patches/0006-Fix-leakage-of-ppd.patch 1970-01-01 00:00:00.000000000 +0000 +++ cups-2.3.1/debian/patches/0006-Fix-leakage-of-ppd.patch 2020-02-24 15:40:58.000000000 +0000 @@ -0,0 +1,21 @@ +From: Zdenek Dohnal +Date: Fri, 14 Feb 2020 16:48:49 +0100 +Subject: Fix leakage of ppd + +--- + ppdc/ppdc-import.cxx | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/ppdc/ppdc-import.cxx b/ppdc/ppdc-import.cxx +index 04b587d..b4a8341 100644 +--- a/ppdc/ppdc-import.cxx ++++ b/ppdc/ppdc-import.cxx +@@ -323,5 +323,8 @@ ppdcSource::import_ppd(const char *f) // I - Filename + } + } + ++ if (ppd) ++ ppdClose(ppd); ++ + return (1); + } diff -Nru cups-2.3.1/debian/patches/0025-Add-Requires-cups.socket-to-cups.service-to-make-sur.patch cups-2.3.1/debian/patches/0025-Add-Requires-cups.socket-to-cups.service-to-make-sur.patch --- cups-2.3.1/debian/patches/0025-Add-Requires-cups.socket-to-cups.service-to-make-sur.patch 1970-01-01 00:00:00.000000000 +0000 +++ cups-2.3.1/debian/patches/0025-Add-Requires-cups.socket-to-cups.service-to-make-sur.patch 2020-02-24 15:40:58.000000000 +0000 @@ -0,0 +1,21 @@ +From: Didier Raboud +Date: Mon, 24 Feb 2020 11:46:49 +0100 +Subject: Add Requires=cups.socket to cups.service, + to make sure they start in the right order + +--- + scheduler/org.cups.cupsd.service.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/scheduler/org.cups.cupsd.service.in b/scheduler/org.cups.cupsd.service.in +index cd23343..79d2c40 100644 +--- a/scheduler/org.cups.cupsd.service.in ++++ b/scheduler/org.cups.cupsd.service.in +@@ -2,6 +2,7 @@ + Description=CUPS Scheduler + Documentation=man:cupsd(8) + After=sssd.service ++Requires=cups.socket + + [Service] + ExecStart=@sbindir@/cupsd -l diff -Nru cups-2.3.1/debian/patches/series cups-2.3.1/debian/patches/series --- cups-2.3.1/debian/patches/series 2020-02-17 08:19:56.000000000 +0000 +++ cups-2.3.1/debian/patches/series 2020-02-24 15:41:42.000000000 +0000 @@ -32,3 +32,6 @@ 0032-Use-dpkg-architecture-in-cups-config-to-make-it-arch.patch 0033-Build-mantohtml-with-the-build-architecture-compiler.patch 0034-po4a-infrastructure-and-translations-for-manpages.patch +0005-Fix-scheduler-cupsd.conf-load.patch +0006-Fix-leakage-of-ppd.patch +0025-Add-Requires-cups.socket-to-cups.service-to-make-sur.patch