Bug 1287585 - lpoption wrongly tries to fetch PPD directly from the printer
lpoption wrongly tries to fetch PPD directly from the printer
Product: Fedora
Classification: Fedora
Component: cups (Show other bugs)
x86_64 Linux
unspecified Severity low
: ---
: ---
Assigned To: Zdenek Dohnal
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2015-12-02 06:40 EST by Richard Neuboeck
Modified: 2016-07-19 16:15 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-07-19 16:15:46 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
CUPS Bugs and Features 4743 None None None Never
Debian BTS 729713 None None None Never

  None (edit)
Description Richard Neuboeck 2015-12-02 06:40:16 EST
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):


How reproducible:


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:

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);

      DEBUG_printf(("5cups_get_printer_uri: Resolved to host=\"%s\", port=%d, resource=\"%s\"", host, *port, resource));
      return (1);
Comment 1 Jiri Popelka 2015-12-02 13:26:36 EST
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 05:32:27 EST
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 06:30:02 EDT
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 16:15:46 EDT
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

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

Note You need to log in before you can comment on or make changes to this bug.