s3-printing: an empty cups printer list is treated as an error
commit683b0652e23b787c5038ff5d7466fdc2a8b3c07f
authorDavid Disseldorp <ddiss@suse.de>
Tue, 24 May 2011 09:34:59 +0000 (24 11:34 +0200)
committerKarolin Seeger <kseeger@samba.org>
Thu, 26 May 2011 18:24:09 +0000 (26 20:24 +0200)
tree288cbe612d235435af44f57193d0fe70ac0c9390
parentd210395a50b5d5043bdcfb75f670f8abab91f974
s3-printing: an empty cups printer list is treated as an error

cups_async_callback() is called to receive new printcap data from a
child process which requests the information from cupsd.
Newly received printcap information is stored in a temporary printcap
cache (tmp_pcap_cache). Once the child process closes the printcap IPC
file descriptor, the system printcap cache is replaced with the newly
populated tmp_pcap_cache, however this only occurs if tmp_pcap_cache is
non null (has at least one printer).

If the printcap cache is empty, which is the case when cups is not
exporting any printers, the printcap cache is not replaced resulting in
stale data.

Signed-off-by: Günther Deschner <gd@samba.org>
source3/printing/print_cups.c