bug 7836: fix printcap cache race conditions

David Disseldorp ddiss at suse.de
Wed Dec 29 06:29:09 MST 2010


Hi,

Lars and I have been investigating a couple of race conditions present
in the existing printcap cache code, as outlined in bug 7836.

Since commit eada8f8a, updates to the cups pcap cache are performed
asynchronously.
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.

Since commit 7022554, smbds share a printcap cache (printer_list.tdb).
smbd processes skip printer_list.tdb updates while another smbd awaits
async cups completion. This behaviour can also result in stale print
shares.

Reviews, comments and feedback welcome.

Cheers, David


The following changes since commit b222615b5978aa78e82af79359b7cc3baec0bc87:

  tdb: add ABI/tdb-1.2.9.sigs (2010-12-29 11:26:12 +0100)

are available in the git repository at:
  git://oss.sgi.com/ddiss/samba bso7836_fix_pcap_races

David Disseldorp (4):
      s3-printing: reload shares after pcap cache fill
      s3-printing: Initiate pcap reload from parent smbd
      s3-printing: remove old entries in pcap_cache_replace
      s3-printing: remove printer_list_need_refresh

 docs-xml/smbdotconf/printing/printcapcachetime.xml |    4 +-
 source3/include/local.h                            |    1 +
 source3/include/proto.h                            |    9 +++-
 source3/librpc/idl/messaging.idl                   |    1 +
 source3/printing/load.c                            |    6 +--
 source3/printing/pcap.c                            |   40 +++++++++++----
 source3/printing/pcap.h                            |    6 ++-
 source3/printing/print_cups.c                      |   49 +++++++++++++-----
 source3/printing/printer_list.c                    |   26 ----------
 source3/printing/printer_list.h                    |    9 ---
 source3/smbd/globals.c                             |    1 -
 source3/smbd/globals.h                             |    1 -
 source3/smbd/process.c                             |   42 +++-------------
 source3/smbd/server.c                              |   53 +++++++++++++++++++-
 source3/smbd/server_reload.c                       |   22 ++++++--
 source3/web/swat.c                                 |   11 +++-
 16 files changed, 165 insertions(+), 116 deletions(-)


More information about the samba-technical mailing list