Bug 1287585

Summary: lpoption wrongly tries to fetch PPD directly from the printer
Product: [Fedora] Fedora Reporter: Richard Neuboeck <hawk>
Component: cupsAssignee: Zdenek Dohnal <zdohnal>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 22CC: jpopelka, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-19 20:15:46 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:

Description Richard Neuboeck 2015-12-02 11:40:16 UTC
Description of problem:

lpoptions -l should show the available printer options. Instead it fails with 'lpoptions: Unable to get PPD file for Printername: Not Found'. Tracing the network traffic shows that the client tries to fetch the PPD file directly from the printer instead of the print server. Of course the printer does not provide the PPD file so the request fails.


Version-Release number of selected component (if applicable):

cups-client-2.0.3-1.fc22.x86_64


How reproducible:

always.


Steps to Reproduce:
1. Set up printer server using IPP to access the network printer (i.e.: ipp://X.X.X.X/ipp)
2. Set up the client /etc/cups/client.conf to access 'ServerName printerserver'. Disable local printer server on the client.
3. Run lpoptions -l on the client.


Actual results:

[hawk@iconia ~]$ lpoptions -l
lpoptions: Unable to get PPD file for Canon_PS: Not Found


Expected results:

[hawk@denobula ~]$ lpoptions -l
Opt2CF/Cassette Feeding Unit: False *True
...


Additional info:

The problem does not seem to be new. This (old) Debian bug report describes the same problem and shows when the problematic code was introduced:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=729713

The conclusion from the mentioned report is that due to the use of IPP cups thinks there is another cups server. Of course this works if you run a local cups daemon that needs to fetch the PPD from the 'real' server. In this case it mistakenly thinks it needs to fetch the PPD directly from the printer.

Removing the mentioned code element from cups/util.c makes lpoptions work as expected but I guess will break fetching the right PPD if a local server is running.

Here is the root cause from cups/util.c

    if (device_uri &&
        (!strncmp(device_uri, "ipp://", 6) ||
         !strncmp(device_uri, "ipps://", 7) ||
         ((strstr(device_uri, "._ipp.") != NULL ||
           strstr(device_uri, "._ipps.") != NULL) &&
          !strcmp(device_uri + strlen(device_uri) - 5, "/cups"))))
    {
     /*
      * Statically-configured shared printer.
      */

      httpSeparateURI(HTTP_URI_CODING_ALL, _httpResolveURI(device_uri, uri, sizeof(uri), _HTTP_RESOLVE_DEFAULT, NULL, NULL), scheme, sizeof(scheme), username, sizeof(username), host, hostsize, port, resource, resourcesize);
      ippDelete(response);

      DEBUG_printf(("5cups_get_printer_uri: Resolved to host=\"%s\", port=%d, resource=\"%s\"", host, *port, resource));
      return (1);
    }
    else

Comment 1 Jiri Popelka 2015-12-02 18:26:36 UTC
I'm wondering if there's a corresponding upstream ticket.
Looks like the Debian maintainer (Didier) once asked on cups-devel list, but I can't find anything in https://cups.org/lists.php

Comment 2 Richard Neuboeck 2015-12-03 10:32:27 UTC
I couldn't find any either.

The patch from http://cups.org/str.php?L4178 introduces the plain ipp:// and ipps:// device-uri selection to the part where Bonjour shared printer URLs are handled.

Instead of disabling the whole code block it is sufficient to remove those two lines.

I've created a CUPS bug report: https://www.cups.org/str.php?L4743

Comment 3 Fedora Admin XMLRPC Client 2016-06-24 10:30:02 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 4 Fedora End Of Life 2016-07-19 20:15:46 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.