smbd: fix cups printcap cache updates on startup
commitd7286bb6520ebe03355e98e3311e1d79e2746791
authorDavid Disseldorp <ddiss@samba.org>
Tue, 12 Feb 2013 17:57:53 +0000 (12 18:57 +0100)
committerKarolin Seeger <kseeger@samba.org>
Sun, 7 Apr 2013 19:27:19 +0000 (7 21:27 +0200)
treeb06014b008252001f1f4327516f91efe48a15d28
parent93bca1881e3a8993c76fec408d7c0c369556683d
smbd: fix cups printcap cache updates on startup

On startup the parent smbd process currently calls pcap_cache_reload(),
which is done immediately before the background queue process is forked.

pcap_cache_reload() is asynchronous with cups, in that it forks a
separate process to obtain the printer listing. The cache_fd_event
print_cups.c global variable is used to track when a cups printer
listing is in progress.

cache_fd_event is set when the background queue process is forked, due
to smbd's pcap_cache_reload() call immediately prior. As a result, the
background queue process assumes an existing pcap_cache_reload() call is
indefinitely outstanding, causing the printcap cache to remain stale
thereafter.
source3/printing/printing.c
source3/smbd/server.c