Bug 185225 - Cups gets printer hostname totally wrong
Summary: Cups gets printer hostname totally wrong
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: cups
Version: 4
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-03-12 04:40 UTC by JW
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-03-13 13:54:03 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description JW 2006-03-12 04:40:55 UTC
Description of problem:
When cupsd browses other IPP hosts it first invokes AddPrinter().
In AddPrinter() the code changes to p->hostname to point to local hostname.
After the call returns the browser code zaps the p->hostname to remote hostname.
This is unfortunate, because AddPrinter() calls WritePrintcap() which results
in an /etc/printcap conatining the wrong "rm=" entry.
This stuffs up programs like Samba which might use /etc/printcap as a reliable
source of information.

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


How reproducible:
Always

Steps to Reproduce:
1.Start cupsd on host1
2.Start cupsd on host2
3.Look at /etc/printcap on host2
4.Read the code, esp scheduler/{dirsvc.c:284,printers.c:106}
 
Actual results:
host2:/etc/printcap will have host1 remote printer entries with "rm=host2"

Expected results:
host2:/etc/printcap entries for remote printers on host1 should have "rm=host1"

Additional info:
The programming workers writing cupsd should have added a rhostname entry to
the printer_t structure.

Comment 1 JW 2006-03-12 05:11:19 UTC
Please excuse the bad grammar and spelling mistakes in above.
Why isn't there a facility to edit bug entries?


Comment 2 Tim Waugh 2006-03-13 12:26:47 UTC
This behaviour is correct.  The queues exist on the local machine too, and get
forwarded to the remote machine.


Comment 3 JW 2006-03-13 12:46:00 UTC
(In reply to comment #2)
> This behaviour is correct.  The queues exist on the local machine too, and get
> forwarded to the remote machine.
> 

I don't think so. The "rm=" means remote machine, and the local machine is *not*
a remote machine.

It is also a lie to say that the printer exists on the local machine - it
doesn't. It exists on another machine.  That is exactly what the "rm=" is for!!

The way the printcap was dresigned was *not* to use "rm=" to point to local
host.  Because the printcap was designed for the print spooler to determine
where the actual printer is.  And that is exactly what the "rm=" was for.


Comment 4 Tim Waugh 2006-03-13 13:54:03 UTC
http://www.cups.org/str.php?L1483


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