smbd: fix cups printcap cache updates on startup
commit0b7efa6182388eaeeb31bb9a29a244eb150ff852
authorDavid Disseldorp <ddiss@samba.org>
Tue, 12 Feb 2013 17:57:53 +0000 (12 18:57 +0100)
committerKarolin Seeger <kseeger@samba.org>
Fri, 26 Apr 2013 07:25:02 +0000 (26 09:25 +0200)
treeb7e7d3de2ed1fc7eb674f25dafe7e86aebaf1fad
parent264326285d8c1f8694129ee60f83f7140735052d
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.
(cherry picked from commit d7286bb6520ebe03355e98e3311e1d79e2746791)
source3/printing/printing.c
source3/smbd/server.c