[Pkg-cups-devel] Bug#523124: CUPS has stale printers appearing if browsing whith short names is enabled and another host suddently changes its ip

Quentin Godfroy godfroy at clipper.ens.fr
Wed Apr 8 17:15:39 UTC 2009


Package: cups
Version: 1.3.8-1lenny4.1

Context : local cupsd accepts browsing messages, with BrowseShortNames
enabled.

if a remote cupsd server which publishes printers changes suddently its IP a
new printer with a long name (but the same name before '@') is created
locally and old one still exists (this is not the bug).

The problem is that the short name becomes quickly stale in the sense that
it becomes bound to the device URI file:/dev/null, never expires and
survives restarts of cupsd service.

Moreover cupsd still considers these stale printers as valid printers and it
is possible to have jobs waiting to be printed by these non-existant
printers.

The only way to get rid of these entries is to stop cupsd, remove stale
entries from /var/cache/cups/remote.cache and restart cupsd.

The solution would be to allow these stale entries to expire the same way as
normal printers, as any device listed in remote.cache shoud do.

For example, I have on my system two of these stale printers, as lpstat -v
shows :

$ lpstat -v
device for HP_Deskjet_F300_series: /dev/null
device for HP_Deskjet_F300_series at MacBook250Go-2.local: ipp://MacBook250Go-2.local:631/printers/HP_Deskjet_F300_series
device for SONA: ipp://sona/ipp/
device for wifi_HP_Deskjet_F300_series: /dev/null
device for wifi_HP_Deskjet_F300_series at MacBook250Go-2.local: ipp://MacBook250Go-2.local:631/printers/wifi_HP_Deskjet_F300_series

Clearly the address of MacBook250Go-2.local changed at some point of the day
(maybe hours before), but the stale printers did not disappear.

The corresponding /var/cache/cups/remote.cache :
|# Remote cache file for CUPS v1.3.8
|# Written by cupsd on 2009-04-08 18:56
|<Printer HP_Deskjet_F300_series>
|Type 16879620
|BrowseTime 1239199085
|Info HP Deskjet F300 series
|Location Ordinateur de Roberto Mantaci (2)
|DeviceURI file:/dev/null
|State Idle
|Accepting Yes
|JobSheets none none
|</Printer>
|<Printer HP_Deskjet_F300_series at MacBook250Go-2.local>
|Type 16814086
|BrowseTime 1239210058
|Info HP Deskjet F300 series
|MakeModel HP DeskJet F300 Series All in One on MacBook250Go-2.local
|Location Ordinateur de Roberto Mantaci (2)
|DeviceURI ipp://MacBook250Go-2.local:631/printers/HP_Deskjet_F300_series
|State Idle
|Accepting Yes
|JobSheets none none
|Option job-sheets none,none
|Option lease-duration 300
|</Printer>
|<Printer wifi_HP_Deskjet_F300_series>
|Type 16887820
|BrowseTime 1239199085
|Info wifi HP Deskjet F300 series
|Location Base Station 0968e5
|DeviceURI file:/dev/null
|State Idle
|Accepting Yes
|JobSheets none none
|</Printer>
|<Printer wifi_HP_Deskjet_F300_series at MacBook250Go-2.local>
|Type 16822286
|BrowseTime 1239210060
|Info wifi HP Deskjet F300 series
|MakeModel HP Deskjet F2100 series on MacBook250Go-2.local
|Location Base Station 0968e5
|DeviceURI
|ipp://MacBook250Go-2.local:631/printers/wifi_HP_Deskjet_F300_series
|State Idle
|Accepting Yes
|JobSheets none none
|Option job-sheets none,none
|Option lease-duration 300
|</Printer>

Note that stale entries do not have a "Option lease-duration 300", so they
will not expire on the next cupsd start.

My cupsd.conf:
|#
|#
|#   Sample configuration file for the Common UNIX Printing System (CUPS)
|#   scheduler.  See "man cupsd.conf" for a complete description of this
|#   file.
|#
|
|# Log general information in error_log - change "info" to "debug" for
|# troubleshooting...
|LogLevel warning
|
|# Administrator user group...
|SystemGroup lpadmin
|
|
|# Only listen for connections from the local machine.
|Listen localhost:631
|Listen /var/run/cups/cups.sock
|
|# Show shared printers on the local network.
|Browsing On
|BrowseOrder allow,deny
|BrowseAllow all
|
|# Default authentication type, when authentication is required...
|DefaultAuthType Basic
|
|# Restrict access to the server...
|<Location />
|  Order allow,deny
|</Location>
|
|# Restrict access to the admin pages...
|<Location /admin>
|  Order allow,deny
|</Location>
|
|# Restrict access to configuration files...
|<Location /admin/conf>
|  AuthType Default
|  Require user @SYSTEM
|  Order allow,deny
|</Location>
|
|# Set the default printer/job policies...
|<Policy default>
|  # Job-related operations must be done by the owner or an administrator...
|  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs
|Set-Job-Attributes Create-Job-Subscription Renew-Subscription
|Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job
|Suspend-Current-Job Resume-Job CUPS-Move-Job>
|    Require user @OWNER @SYSTEM
|    Order deny,allow
|  </Limit>
|
|  # All administration operations require an administrator to
|  # authenticate...
|  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class
|CUPS-Delete-Class CUPS-Set-Default>
|    AuthType Default
|    Require user @SYSTEM
|    Order deny,allow
|  </Limit>
|
|  # All printer operations require a printer operator to authenticate...
|  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer
|Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs
|Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer
|Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs
|CUPS-Reject-Jobs>
|    AuthType Default
|    Require user @SYSTEM
|    Order deny,allow
|  </Limit>
|
|  # Only the owner or an administrator can cancel or authenticate a job...
|  <Limit Cancel-Job CUPS-Authenticate-Job>
|    Require user @OWNER @SYSTEM
|    Order deny,allow
|  </Limit>
|
|  <Limit All>
|    Order deny,allow
|  </Limit>
|</Policy>
|
|#
|#

My printers.conf:
|# Printer configuration file for CUPS v1.3.8
|# Written by cupsd on 2009-03-30 18:21
|<Printer SONA>
|Info HP laserjet 4350
|Location LIAFA
|DeviceURI ipp://sona/ipp/
|State Idle
|StateTime 1238430050
|Accepting Yes
|Shared No
|JobSheets none none
|QuotaPeriod 0
|PageLimit 0
|KLimit 0
|OpPolicy default
|ErrorPolicy stop-printer
|</Printer>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 447 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-cups-devel/attachments/20090408/b00df527/attachment.pgp>


More information about the Pkg-cups-devel mailing list