summaryrefslogtreecommitdiff
path: root/source3/libsmb/clientgen.c
diff options
context:
space:
mode:
authorAlexander Bokovoy <ab@samba.org>2004-04-06 11:45:02 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:51:07 -0500
commitc4255df992d6ec6bb892bf0d39a32a00d4d570ae (patch)
tree4eca87d04c33b9c2e1fc0c11b5d234fb90feea58 /source3/libsmb/clientgen.c
parentd4f815731d58db302856abcdac9835a8c2fe2168 (diff)
downloadsamba-c4255df992d6ec6bb892bf0d39a32a00d4d570ae.tar.gz
samba-c4255df992d6ec6bb892bf0d39a32a00d4d570ae.tar.bz2
samba-c4255df992d6ec6bb892bf0d39a32a00d4d570ae.zip
r76: Fix smbfs problem with Tree Disconnect issued before smbfs starts its work.
We use cli_state.smb_rw_error to pass this specific case into cli_close_connection() from smbmount as smb_rw_error can have only selected number of states and it is ignored in cli_close_connection(). Compiled and tested by Lars Mueller from SuSE on x86, x86_64, ppc, ppc64, s390 and s390x. (This used to be commit 738666ce0a310fae14476020fd6dac027b0e3ec5)
Diffstat (limited to 'source3/libsmb/clientgen.c')
-rw-r--r--source3/libsmb/clientgen.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index 66edc3ce38..6edc83c9d7 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -374,8 +374,12 @@ void cli_close_connection(struct cli_state *cli)
* can remain active on the peer end, until some (long) timeout period
* later. This tree disconnect forces the peer to clean up, since the
* connection will be going away.
+ *
+ * Also, do not do tree disconnect when cli->smb_rw_error is DO_NOT_DO_TDIS
+ * the only user for this so far is smbmount which passes opened connection
+ * down to kernel's smbfs module.
*/
- if ( cli->cnum != (uint16)-1 )
+ if ( (cli->cnum != (uint16)-1) && (cli->smb_rw_error != DO_NOT_DO_TDIS ) )
cli_tdis(cli);
cli_nt_session_close(cli);