[cups.bugs] [LOW] STR #1346: cupsd doesn't write last printer's Info line from "/etc/cups/printers.conf" to "/etc/printcap"

kssingvo.suse kssingvo at suse.de
Wed Nov 23 05:46:29 PST 2005


[STR New]

/etc/cups/printers.conf contains these entries [shortened]:
  <DefaultPrinter hl5150dseries>
  Info Brother HL-5150D
  </Printer>
  <Printer km5016>
  Info Kyocera Mita FS-C5016N
  </Printer>
  <Printer laserjet1100>
  Info HP LaserJet 1100
  </Printer>

This results in such a printcap file [shortened]:
  hl5150dseries|Brother HL-5150D:rm=host=hl5150dseries:
  km5016|Kyocera Mita FS-C5016N:rm=host:rp=km5016:
  laserjet1100|laserjet1100:rm=host:rp=laserjet1100:

Have a closer look at the last line:
Instead of
  laserjet1100|HP LaserJet 1100:rm=host:rp=laserjet1100:
you see:
  laserjet1100|laserjet1100:rm=host:rp=laserjet1100:

The problem is located in the logic of
scheduler/printers.c:LoadAllPrinters()
  The AddPrinter() call writes the new printcap file (WritePrintcap())
  but the relevant information of the printcap is gathered later.

ATM I see two possibilities to fix:
- either we add a extra WritePrintcap() call at the end of the loop while
(cupsFileGets() != NULL) (= easier solution)
- or we do the WritePrintcap() after we have read the full information
about a printer (= better solution, like we were teached :-) ).

Please note, that I'm speaking of cups-1.1.x, and not about the SVN
version.

Link: http://www.cups.org/str.php?L1346
Version: 1.1.23





More information about the cups mailing list