OpenPrinting / cups

OpenPrinting CUPS Sources
https://openprinting.github.io/cups
Apache License 2.0
1.01k stars 182 forks source link

Kyocera FS-4200DN stops working after commit "Throw an error if a member attribute occurs outside a collection." #755

Closed zwetschgenbaeumle closed 1 year ago

zwetschgenbaeumle commented 1 year ago

starting with commit

69ba26c811e4abfb92ebb6c7ed8070a9f74b72d7 "Throw an error if a member attribute occurs outside a collection."

Some of our Kyocera printers, for example all Kyocera FS-4200DN, stop working. Cups says it cannot determine the printer's status.

Before that commit ipptool reports:

ipptool ipp://blafasel/ipp ipp-everywhere.test "document-format": Bad mimeMediaType value "" - bad characters (RFC 8011 section 5.1.10). successful-ok

With this commit I get

ipptool ipp://blafasel/ipp ipp-everywhere.test IPP member attribute outside of collection. IPP member attribute outside of collection. IPP member attribute outside of collection.

After bisecting I reverted that patch for 2.4.6 and this indeed fixed the problem.

michaelrsweet commented 1 year ago

Can you attach a Wireshark or tcpdump trace when you run this command? This looks like a serious bug in the printer but we'll know more once we see what it is returning...

zwetschgenbaeumle commented 1 year ago

blablabla.zip

This is the trace with iptool from cups v2.4.6 compiled as debian package (bookworm) with 69ba26c811e4abfb92ebb6c7ed8070a9f74b72d7 reverted.

michaelrsweet commented 1 year ago

OK, so the IPP response from this printer is bad. The problem appears to start with the pwg-raster-document-type-supported attribute, which contains a memberAttrName tag for "media-supported", followed by the list of supported media sizes. Please report this to Kyocera, and check for firmware updates for this printer.

zwetschgenbaeumle commented 1 year ago

I already thought that this is due to the printer. But I doubt Kyocera will fix this (for the FS-4200DN or any other models which are end of life). I just hoped that cups has a no regression and things should continue to work policy and may include quirks (as the linux kernel does for almost every category of hardware). We cannot throw away all these printers (and it would conform those thinking it works under windows but does not work under linux). So basically we (and others who still use older kyocera models) either keep 2.3.3op2 from bullseye or maintain a fork where this patch is reverted. As the the version in bookworm has other flaws (printing in color stops working is one) one may have to do this anyway.

michaelrsweet commented 1 year ago

The problem with allowing this in CUPS is that it was the cause of a security problem. Treating it as just another value for the attribute is wrong (media sizes mixed with supported raster formats), trying to map the member attribute as another attribute is wrong (would break collection handling, among other things), and there is no reliable way to ignore and recover from it.

If you don't expect to get a fix from Kyocera then you're stuck with using a legacy driver with AppSocket (socket://address) to send jobs to the printer, just like Windows.