Fix bug #9733 - smbcontrol close-share is not working.
commit1df61789ca466923a7a252244888bd1b7cfbc79e
authorJeremy Allison <jra@samba.org>
Thu, 21 Mar 2013 20:59:20 +0000 (21 13:59 -0700)
committerKarolin Seeger <kseeger@samba.org>
Sun, 7 Apr 2013 19:44:59 +0000 (7 21:44 +0200)
treede1ca8b7b66996645e0f40d16cab898b9f216807
parent57db33599589b06a60cb7cbb454f87bf40c542e0
Fix bug #9733 - smbcontrol close-share is not working.

As part of forcibly disconnecting a client from a share,
smbd must atomically call reload_services() to ensure that
the entry in the ServicePtrs[] array corresponding to
that share is removed if the share was removed from
the smb.conf or registry entries.

Otherwise the ServicePtrs[] array entry for the share
remains active and the client races to auto-reconnect to
the share before a second message to reload the smb.conf
file can be sent.

This has to be done as part of the close-share message
processing, as removing the share from the smb.conf file
first, then telling the smbd to reload followed by the
forcible disconnect message doesn't work as in this
sequence of events when the reload message is received
the client is still connected to the share, so the
ServicePtrs[] entry is still left active.

The forcible-disconnect + service reload has to be done
together as an atomic operation in order for this to work.

Signed-off-by: Jeremy Allison <jra@samba.org>
source3/smbd/conn.c