Red Hat Bugzilla – Bug 1430882
The -h option is overridden by _cupsSetDefaults settings when the IPP port is not given
Last modified: 2018-04-10 09:42:14 EDT
Created attachment 1261676 [details] Possible patch adapted from upstream Description of problem: The "-h" option to "lp*" commands (like lpstat) is ignored if ServerName is set in client.conf and the port isn't specified in the argument to the "-h" option. Version-Release number of selected component (if applicable): cups-1.6.3-26 How reproducible: 100% Steps to Reproduce: 1. Set "ServerName <some-host>" in /etc/cups/client.conf 2. run "lpstat -h <another-host> -p" Actual results: The printer list from <another-host>. Expected results: The printer list from <some-host>. Additional info: # cat /etc/cups/client.conf # Empty # lpstat -a lpstat: No destinations added. # lpstat -h rhel73-test -p printer pass is idle. enabled since Thu 09 Mar 2017 10:30:04 AM PST # lpstat -h rhel68-test -p printer fail is idle. enabled since Thu 09 Mar 2017 10:31:18 AM PST # echo "ServerName rhel68-test" > /etc/cups/client.conf # cat /etc/cups/client.conf ServerName rhel68-test # lpstat -h rhel73-test -p printer fail is idle. enabled since Thu 09 Mar 2017 10:31:18 AM PST # lpstat -h rhel73-test:631 -p printer pass is idle. enabled since Thu 09 Mar 2017 10:30:04 AM PST This is the same as cups.org STR #4675 which was resolved with https://github.com/apple/cups/commit/4b9daaf451a59d1eb1c99aac32d4e3cb19416397 I've adapted that patch for RHEL 7.3 and attached. The patch fixes the issue in my testing: [root@sf01799390 cupsrpms]# yum update *.rpm ... Updated: cups.x86_64 1:1.6.3-26.el7_3.sf01799390.1 cups-client.x86_64 1:1.6.3-26.el7_3.sf01799390.1 cups-filesystem.noarch 1:1.6.3-26.el7_3.sf01799390.1 cups-libs.x86_64 1:1.6.3-26.el7_3.sf01799390.1 Complete! # lpstat -h rhel73-test -p printer pass is idle. enabled since Thu 09 Mar 2017 10:30:04 AM PST
Created attachment 1329577 [details] Proposed patch
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, 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/RHBA-2018:0782