diff --git a/cups-deprecate-drivers-webui.patch b/cups-deprecate-drivers-webui.patch deleted file mode 100644 index c4e8ad9..0000000 --- a/cups-deprecate-drivers-webui.patch +++ /dev/null @@ -1,89 +0,0 @@ -diff --git a/cgi-bin/admin.c b/cgi-bin/admin.c -index 02b9d9d..669cb65 100644 ---- a/cgi-bin/admin.c -+++ b/cgi-bin/admin.c -@@ -619,6 +619,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */ - *oldinfo; /* Old printer information */ - const cgi_file_t *file; /* Uploaded file, if any */ - const char *var; /* CGI variable */ -+ char *ppd_name = NULL; /* Pointer to PPD name */ - char uri[HTTP_MAX_URI], /* Device or printer URI */ - *uriptr, /* Pointer into URI */ - evefile[1024] = ""; /* IPP Everywhere PPD file */ -@@ -1124,12 +1125,12 @@ do_am_printer(http_t *http, /* I - HTTP connection */ - - if (!file) - { -- var = cgiGetVariable("PPD_NAME"); -- if (!strcmp(var, "everywhere")) -+ ppd_name = cgiGetVariable("PPD_NAME"); -+ if (!strcmp(ppd_name, "everywhere")) - get_printer_ppd(cgiGetVariable("DEVICE_URI"), evefile, sizeof(evefile)); -- else if (strcmp(var, "__no_change__")) -+ else if (strcmp(ppd_name, "__no_change__")) - ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "ppd-name", -- NULL, var); -+ NULL, ppd_name); - } - - ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_TEXT, "printer-location", -@@ -1219,7 +1220,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */ - - cgiCopyTemplateLang("printer-modified.tmpl"); - } -- else -+ else if (ppd_name && (strcmp(ppd_name, "everywhere") == 0 || strstr(ppd_name, "driverless"))) - { - /* - * Set the printer options... -@@ -1229,6 +1230,16 @@ do_am_printer(http_t *http, /* I - HTTP connection */ - do_set_options(http, 0); - return; - } -+ else -+ { -+ /* -+ * If we don't have an everywhere model, show printer-added -+ * template with warning about drivers going away... -+ */ -+ -+ cgiStartHTML(title); -+ cgiCopyTemplateLang("printer-added.tmpl"); -+ } - - cgiEndHTML(); - } -diff --git a/templates/choose-model.tmpl b/templates/choose-model.tmpl -index e916cf8..9c9b71f 100644 ---- a/templates/choose-model.tmpl -+++ b/templates/choose-model.tmpl -@@ -39,7 +39,7 @@ - - - -diff --git a/templates/printer-added.tmpl b/templates/printer-added.tmpl -index 0ccf6d3..9ebc835 100644 ---- a/templates/printer-added.tmpl -+++ b/templates/printer-added.tmpl -@@ -1,4 +1,15 @@ --

Add Printer

-+

Add Printer {printer_name}

- -

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

-+Note:Printer drivers and raw queues are deprecated and will stop working in a future version of CUPS. -+
-+ -+
-+ -+ -+ -+ -+
diff --git a/cups-deprecate-drivers.patch b/cups-deprecate-drivers.patch new file mode 100644 index 0000000..f0fb420 --- /dev/null +++ b/cups-deprecate-drivers.patch @@ -0,0 +1,164 @@ +diff --git a/cgi-bin/admin.c b/cgi-bin/admin.c +index 02b9d9d..669cb65 100644 +--- a/cgi-bin/admin.c ++++ b/cgi-bin/admin.c +@@ -619,6 +619,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */ + *oldinfo; /* Old printer information */ + const cgi_file_t *file; /* Uploaded file, if any */ + const char *var; /* CGI variable */ ++ char *ppd_name = NULL; /* Pointer to PPD name */ + char uri[HTTP_MAX_URI], /* Device or printer URI */ + *uriptr, /* Pointer into URI */ + evefile[1024] = ""; /* IPP Everywhere PPD file */ +@@ -1124,12 +1125,12 @@ do_am_printer(http_t *http, /* I - HTTP connection */ + + if (!file) + { +- var = cgiGetVariable("PPD_NAME"); +- if (!strcmp(var, "everywhere")) ++ ppd_name = cgiGetVariable("PPD_NAME"); ++ if (!strcmp(ppd_name, "everywhere")) + get_printer_ppd(cgiGetVariable("DEVICE_URI"), evefile, sizeof(evefile)); +- else if (strcmp(var, "__no_change__")) ++ else if (strcmp(ppd_name, "__no_change__")) + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "ppd-name", +- NULL, var); ++ NULL, ppd_name); + } + + ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_TEXT, "printer-location", +@@ -1219,7 +1220,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */ + + cgiCopyTemplateLang("printer-modified.tmpl"); + } +- else ++ else if (ppd_name && (strcmp(ppd_name, "everywhere") == 0 || strstr(ppd_name, "driverless"))) + { + /* + * Set the printer options... +@@ -1229,6 +1230,16 @@ do_am_printer(http_t *http, /* I - HTTP connection */ + do_set_options(http, 0); + return; + } ++ else ++ { ++ /* ++ * If we don't have an everywhere model, show printer-added ++ * template with warning about drivers going away... ++ */ ++ ++ cgiStartHTML(title); ++ cgiCopyTemplateLang("printer-added.tmpl"); ++ } + + cgiEndHTML(); + } +diff --git a/scheduler/printers.c b/scheduler/printers.c +index 3bfe4a8..248bdba 100644 +--- a/scheduler/printers.c ++++ b/scheduler/printers.c +@@ -950,6 +950,8 @@ cupsdLoadAllPrinters(void) + *value, /* Pointer to value */ + *valueptr; /* Pointer into value */ + cupsd_printer_t *p; /* Current printer */ ++ int found_raw = 0; /* Flag whether raw queue is installed */ ++ int found_driver = 0; /* Flag whether queue with classic driver is installed */ + + + /* +@@ -1025,6 +1027,30 @@ cupsdLoadAllPrinters(void) + + cupsdSetPrinterAttrs(p); + ++ if ((p->device_uri && strncmp(p->device_uri, "ipp:", 4) && strncmp(p->device_uri, "ipps:", 5) && strncmp(p->device_uri, "implicitclass:", 14)) || ++ !p->make_model || ++ (p->make_model && strstr(p->make_model, "IPP Everywhere") == NULL && strstr(p->make_model, "driverless") == NULL)) ++ { ++ /* ++ * Warn users about printer drivers and raw queues will be deprecated. ++ * It will warn users in the following scenarios: ++ * - the queue doesn't use ipp, ipps or implicitclass backend, which means ++ * it doesn't communicate via IPP and is raw or uses a driver for sure ++ * - the queue doesn't have make_model - it is raw ++ * - the queue uses a correct backend, but the model is not IPP Everywhere/driverless ++ */ ++ if (!p->make_model) ++ { ++ cupsdLogMessage(CUPSD_LOG_DEBUG, "Queue %s is a raw queue, which is deprecated.", p->name); ++ found_raw = 1; ++ } ++ else ++ { ++ cupsdLogMessage(CUPSD_LOG_DEBUG, "Queue %s uses a printer driver, which is deprecated.", p->name); ++ found_driver = 1; ++ } ++ } ++ + if (strncmp(p->device_uri, "file:", 5) && p->state != IPP_PRINTER_STOPPED) + { + /* +@@ -1415,6 +1441,12 @@ cupsdLoadAllPrinters(void) + } + } + ++ if (found_raw) ++ cupsdLogMessage(CUPSD_LOG_WARN, "Raw queues are deprecated and will stop working in a future version of CUPS. See https://github.com/OpenPrinting/cups/issues/103"); ++ ++ if (found_driver) ++ cupsdLogMessage(CUPSD_LOG_WARN, "Printer drivers are deprecated and will stop working in a future version of CUPS. See https://github.com/OpenPrinting/cups/issues/103"); ++ + cupsFileClose(fp); + } + +diff --git a/templates/choose-model.tmpl b/templates/choose-model.tmpl +index e916cf8..9c9b71f 100644 +--- a/templates/choose-model.tmpl ++++ b/templates/choose-model.tmpl +@@ -39,7 +39,7 @@ + + + +diff --git a/templates/printer-added.tmpl b/templates/printer-added.tmpl +index 0ccf6d3..9ebc835 100644 +--- a/templates/printer-added.tmpl ++++ b/templates/printer-added.tmpl +@@ -1,4 +1,15 @@ +-

Add Printer

++

Add Printer {printer_name}

+ +

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

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

FAIL: $count warning messages, expected 8.

" >>$strfile ++ echo "

FAIL: $count warning messages, expected 10.

" >>$strfile + echo "
" >>$strfile
+ 	$GREP '^W ' $BASE/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/>$strfile
+ 	echo "    
" >>$strfile diff --git a/cups.spec b/cups.spec index b676874..23a3ce2 100644 --- a/cups.spec +++ b/cups.spec @@ -94,7 +94,7 @@ Patch22: cups-restart-job-hold-until.patch # stub out httpMD5 functions Patch23: 0001-cups-md5passwd.c-Stub-out-httpMD5-functions.patch # 2019845 - Add more warning messages about drivers going deprecated -Patch24: cups-deprecate-drivers-webui.patch +Patch24: cups-deprecate-drivers.patch # 2022610 - compile with -fstack-protector-strong if available Patch25: cups-fstack-strong.patch @@ -319,7 +319,7 @@ to CUPS daemon. This solution will substitute printer drivers and raw queues in # stubbed out httpMD5 functions %patch23 -p1 -b .no-httpmd5 # 2019845 - Add more warning messages about drivers going deprecated -%patch24 -p1 -b .deprecated-drivers-webui +%patch24 -p1 -b .deprecated-drivers # 2022610 - compile with fstack-protector-strong if available %patch25 -p1 -b .fstack-strong @@ -675,6 +675,7 @@ rm -f %{cups_serverbin}/backend/smb %changelog * Fri Nov 12 2021 Zdenek Dohnal - 1:2.3.3op2-10 - 2022610 - fix compilation issues reported by annocheck +- 2019845 - Add more warning messages about driver going deprecated (completed) * Thu Nov 04 2021 Zdenek Dohnal - 1:2.3.3op2-9 - stubbed out deprecated httpMD5 functions