s3-printing: an empty cups printer list is treated as an error
commit4cc531cf8ced892f13a6846c756de822385c3c0e
authorDavid Disseldorp <ddiss@suse.de>
Tue, 24 May 2011 09:34:59 +0000 (24 11:34 +0200)
committerKarolin Seeger <kseeger@samba.org>
Tue, 14 Jun 2011 10:58:24 +0000 (14 12:58 +0200)
treec71c5d4e97c36c64bf51a657a6a2fe3b4de0830d
parent0b9937c43e8191e35ff7b0698f18de83b9060c36
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>
(cherry picked from commit 683b0652e23b787c5038ff5d7466fdc2a8b3c07f)
source3/printing/print_cups.c