s3:smbd: let session logoff close files and tcons before deleting the session
commit71b7745111551e0076ac33b81c1c8eef3b4594cd
authorRalph Boehme <slow@samba.org>
Wed, 29 Aug 2018 15:19:29 +0000 (29 17:19 +0200)
committerKarolin Seeger <kseeger@samba.org>
Tue, 4 Sep 2018 10:14:43 +0000 (4 12:14 +0200)
tree6684d575a4d17448af54f46849a16bdc75c5842d
parentb5d78343fb26ade4783e214c877ea837910e5d8e
s3:smbd: let session logoff close files and tcons before deleting the session

This avoids a race in durable handle reconnects if the reconnect comes
in while the old session is still in the tear-down phase.

The new session is supposed to rendezvous with and wait for destruction
of the old session, which is internally implemented with
dbwrap_watch_send() on the old session record.

If the old session deletes the session record before calling
file_close_user() which marks all file handles as disconnected, the
durable handle reconnect in the new session will fail as the records are
not yet marked as disconnected which is a prerequisite.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13549

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 8f6edcc1645e0ed35eaec914bd0b672500ce986c)
selftest/knownfail.d/samba3.blackbox [deleted file]
source3/smbd/smbXsrv_session.c