Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1430882

Summary: The -h option is overridden by _cupsSetDefaults settings when the IPP port is not given
Product: Red Hat Enterprise Linux 7 Reporter: Bryan Mason <bmason>
Component: cupsAssignee: Zdenek Dohnal <zdohnal>
Status: CLOSED ERRATA QA Contact: Petr Sklenar <psklenar>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: bmason, psklenar, thozza
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: cups-1.6.3-31.el7 Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 13:41:08 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: 1420851, 1465887, 1465928    
Attachments:
Description Flags
Possible patch adapted from upstream
none
Proposed patch none

Description Bryan Mason 2017-03-09 18:52:23 UTC
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

Comment 6 Zdenek Dohnal 2017-09-22 12:42:13 UTC
Created attachment 1329577 [details]
Proposed patch

Comment 16 errata-xmlrpc 2018-04-10 13:41:08 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, 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