s3-printing: an empty cups printer list is treated as an error
commit52bac5ffeea8ecbd2a5ecca023b3e2014c1350da
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:25:13 +0000 (26 20:25 +0200)
tree651d908f26655a672e9ca448308f7096e519366e
parentda9b2d9d58193ed3da36c2f8ff1e41a1e743ba07
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