From 04248c2cfaa5a1728ef58fc8ca231fd1309ca694 Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Sun, 19 Dec 2010 19:52:08 +0100 Subject: s3-printing: reload shares after pcap cache fill MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since commit eada8f8a, updates to the cups pcap cache are performed asynchronously - cups_cache_reload() forks a child process to request cups printer information and notify the parent smbd on completion. Currently printer shares are reloaded immediately following the call to cups_cache_reload(), this occurs prior to smbd receiving new cups pcap information from the child process. Such behaviour can result in stale print shares as outlined in bug 7836. This fix ensures print shares are only reloaded after new pcap data has been received. Pair-Programmed-With: Lars Müller --- source3/include/proto.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 0775acd21d..91d3ef165e 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -4062,7 +4062,9 @@ void notify_printer_sepfile(struct tevent_context *ev, /* The following definitions come from printing/pcap.c */ void pcap_cache_reload(struct tevent_context *ev, - struct messaging_context *msg_ctx); + struct messaging_context *msg_ctx, + void (*post_cache_fill_fn)(struct tevent_context *, + struct messaging_context *)); bool pcap_printername_ok(const char *printername); /* The following definitions come from printing/printing.c */ @@ -5399,7 +5401,8 @@ void server_messaging_context_free(void); struct event_context *smbd_event_context(void); struct messaging_context *smbd_messaging_context(void); struct memcache *smbd_memcache(void); -void reload_printers(struct messaging_context *msg_ctx); +void reload_printers(struct tevent_context *ev, + struct messaging_context *msg_ctx); bool reload_services(struct messaging_context *msg_ctx, int smb_sock, bool test); void exit_server(const char *const explanation); -- cgit