diff options
author | Ralph Boehme <slow@samba.org> | 2018-08-30 15:50:02 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2018-09-05 13:35:27 +0200 |
commit | 51253045e827c14b14d527d1c48d037d8002588f (patch) | |
tree | 8dad18a0a4abe31a8c18e9399c455e852afaa90c | |
parent | 6a179a5a9a8d790260c0285aaf4b5faed65a5aa3 (diff) | |
download | samba-51253045e827c14b14d527d1c48d037d8002588f.tar.gz |
s3:smbd: reorder tcon global record deletion and closing files of a tcon
As such, this doesn't change overall behaviour, but in case we ever add
semantics acting on tcon record changes via an API like
dbwrap_watch_send(), this will make a difference as it enforces
ordering.
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>
(backported from commit b70b8503faded81b10859131f08486349876d132)
-rw-r--r-- | source3/smbd/smbXsrv_tcon.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/source3/smbd/smbXsrv_tcon.c b/source3/smbd/smbXsrv_tcon.c index 82c880adc0b..00513301893 100644 --- a/source3/smbd/smbXsrv_tcon.c +++ b/source3/smbd/smbXsrv_tcon.c @@ -904,6 +904,25 @@ NTSTATUS smbXsrv_tcon_disconnect(struct smbXsrv_tcon *tcon, uint64_t vuid) table = tcon->table; tcon->table = NULL; + if (tcon->compat) { + bool ok; + + ok = set_current_service(tcon->compat, 0, true); + if (!ok) { + status = NT_STATUS_INTERNAL_ERROR; + DEBUG(0, ("smbXsrv_tcon_disconnect(0x%08x, '%s'): " + "set_current_service() failed: %s\n", + tcon->global->tcon_global_id, + tcon->global->share_name, + nt_errstr(status))); + tcon->compat = NULL; + return status; + } + + close_cnum(tcon->compat, vuid); + tcon->compat = NULL; + } + tcon->status = NT_STATUS_NETWORK_NAME_DELETED; global_rec = tcon->global->db_rec; @@ -966,25 +985,6 @@ NTSTATUS smbXsrv_tcon_disconnect(struct smbXsrv_tcon *tcon, uint64_t vuid) } tcon->db_rec = NULL; - if (tcon->compat) { - bool ok; - - ok = set_current_service(tcon->compat, 0, true); - if (!ok) { - status = NT_STATUS_INTERNAL_ERROR; - DEBUG(0, ("smbXsrv_tcon_disconnect(0x%08x, '%s'): " - "set_current_service() failed: %s\n", - tcon->global->tcon_global_id, - tcon->global->share_name, - nt_errstr(status))); - tcon->compat = NULL; - return status; - } - - close_cnum(tcon->compat, vuid); - tcon->compat = NULL; - } - return error; } |