Bug 1715907

Summary: CUPS- client: cupsGetPPD3() function tries to load PPD from IPP printer and not from the CUPS queue
Product: Red Hat Enterprise Linux 7 Reporter: Oliver Freyermuth <o.freyermuth>
Component: cupsAssignee: Zdenek Dohnal <zdohnal>
Status: CLOSED ERRATA QA Contact: Petr Dancak <pdancak>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.6CC: o.freyermuth, pdancak, psklenar, thozza, wienemann
Target Milestone: rcKeywords: AutoVerified, Patch, TestCaseProvided, Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: cups-1.6.3-46.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-09-29 19:21:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1757052    
Attachments:
Description Flags
Backported patch none

Description Oliver Freyermuth 2019-05-31 15:13:06 UTC
Description of problem:
Setting up a system as CUPS client via /etc/cups/client.conf of a CUPS server exporting printers with IPP URIs, the CUPS client attempts to query the printer itself for a PPD file instead of querying the CUPS server, leading to client program / desktop hang if the printer is not reachable. 
Reproducible with "lpoptions -l" or most Qt applications. 

The underlying issue is caused by the CUPS client misinterpreting IPP printer URIs as CUPS servers:
https://github.com/apple/cups/issues/4725
This issue is fixed by upstream's commit:
https://github.com/apple/cups/commit/dd37b5bcf97db7069826a807892736e912b7e935


Version-Release number of selected component (if applicable):
cups-libs-1.6.3-35.el7


How reproducible:
Always. 


Steps to Reproduce:
1. Set up a machine as CUPS client via /etc/cups/client.conf:
   ServerName cups-test.example.com
2. Have the CUPS server export a printer via IPP. 
3. Have that printer unreachable to the machine which wants to print,
   e.g. in a private network. 
4. Try to print from a Qt based app / run "lpoptions -l". 
   Anything which triggers a call to cupsGetPPD(). 

Actual results:
Applications / commands hang, trying to contact the printer. 


Expected results:
Printing works. 


Additional info:
See https://github.com/apple/cups/issues/4725 for the bug,
and https://github.com/apple/cups/commit/dd37b5bcf97db7069826a807892736e912b7e935 for the patch fixing it.

Comment 2 Zdenek Dohnal 2019-06-03 10:03:45 UTC
Hi Oliver,

thank you for reporting the issue, investigating and finding the patch! If you are able, would you mind filing customer ticket on access.redhat.com? It would help me to justify prioritization of the issue during our internal planning.

Comment 3 Zdenek Dohnal 2019-06-03 10:06:38 UTC
Plus would you mind explaining in more detail step 2? (how-to set it up etc.)


(In reply to Oliver Freyermuth from comment #0)
> 2. Have the CUPS server export a printer via IPP.

Comment 5 Oliver Freyermuth 2019-06-03 13:39:47 UTC
Hi Zdenek,

(In reply to Zdenek Dohnal from comment #2)
> Hi Oliver,
> 
> thank you for reporting the issue, investigating and finding the patch! 

Thanks for taking a look at it! 

> If
> you are able, would you mind filing customer ticket on access.redhat.com? It
> would help me to justify prioritization of the issue during our internal
> planning.

Sadly, I can't (we are effectively using CentOS 7). I would still expect the issue to be very relevant for RHEL users, but I can't file a customer ticket :-(. 

> Plus would you mind explaining in more detail step 2? (how-to set it up etc.)

There's nothing special, really - installing a cups server, opening up access to port 631, adding any printer which supports IPP and is in a different subnet only accessibe to the CUPS server and not to the client and sharing that is sufficient on the server end (I also used CentOS 7 there in our case). 
So (in general, unless you play tricks with routing) that means the CUPS server machine needs to be multi-homed inside the "desktop" / "client" network and the "printer" network. 

On the client, it's sufficient to have an /etc/cups/client.conf with the content:
ServerName myprintserver.example.com
Let me know if there are any more details you'd like to know ;-).

Comment 6 Zdenek Dohnal 2020-02-11 13:04:09 UTC
I was able to reproduce and I'll create a test for the issue at least.

Comment 7 Zdenek Dohnal 2020-02-12 12:08:13 UTC
Created attachment 1662655 [details]
Backported patch

Comment 18 errata-xmlrpc 2020-09-29 19:21:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: cups security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:3864