s3-printing: fix cups pcap reload with no printers
authorDavid Disseldorp <ddiss@suse.de>
Thu, 30 Dec 2010 14:58:48 +0000 (15:58 +0100)
committerAndreas Schneider <asn@samba.org>
Fri, 4 Mar 2011 14:46:23 +0000 (15:46 +0100)
commit2b635949a210fd1d8d8906f5185581d566064888
treee66a1dcacce50538d39794358ce290ab4dbbda5e
parent624e33f8697a7c9215028d4d70edd70ee49ad005
s3-printing: fix cups pcap reload with no printers

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.

https://bugzilla.samba.org/show_bug.cgi?id=7915
Signed-off-by: Andreas Schneider <asn@samba.org>
source3/printing/print_cups.c