s3-printing: an empty cups printer list is treated as an error
authorDavid Disseldorp <ddiss@suse.de>
Tue, 24 May 2011 09:34:59 +0000 (11:34 +0200)
committerKarolin Seeger <kseeger@samba.org>
Thu, 18 Aug 2011 19:14:52 +0000 (21:14 +0200)
commit15942c91032c2722a0f15c3eb953f6fe30b4ae5d
tree52212f79489a6c10792b205ee0b94c3b3ab9a1c0
parent4bfaf8cb4702f77bb546d3739bbacd5ac5187e33
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 52bac5ffeea8ecbd2a5ecca023b3e2014c1350da)
source3/printing/print_cups.c