Created attachment 13283 [details] Packet capture TreeConnect+IoCtl Looks to me that using the TID from the previous tree connect is just not implemented. /usr/sbin/smbd: smbd_smb2_request_done_ex: idx[1] status[NT_STATUS_OK] body[16] dyn[no:0] at ../source3/smbd/smb2_tcon.c:170 /usr/sbin/smbd: smbd_smb2_request_dispatch: opcode[SMB2_OP_IOCTL] mid = 13 /usr/sbin/smbd: smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[5] status[NT_STATUS_NETWORK_NAME_DELETED] || at ../source3/smbd/smb2_server.c:2449 /usr/sbin/smbd: smbd_smb2_request_done_ex: idx[5] status[NT_STATUS_NETWORK_NAME_DELETED] body[8] dyn[yes:1] at ../source3/smbd/smb2_server.c:3145 Error comes from smbd_smb2_request_check_tcon 1799 in_tid = req->last_tid; (gdb) print req->last_tid $1 = 4294967295 (== 0xFFFFFFFF) which is the unspecified TID from the TREE_CONNECT request. [SMB2] "3.2.4.1.4 Sending Compounded Requests" would suggest this is legal (and it is handled as expected by MS servers): 3.The client MUST construct the subsequent request as it would do normally. For any subsequent requests the client MUST set SMB2_FLAGS_RELATED_OPERATIONS in the Flags field of the SMB2 header to indicate that it is using the SessionId, TreeId, and FileId supplied in the previous request (or generated by the server in processing that request). The client SHOULD<93> set SessionId to 0xFFFFFFFFFFFFFFFF and TreeId to 0xFFFFFFFF, and SHOULD<94> set FileId to { 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF }. For reproduction I could offer some test cases using the java implementation if you like.
Created attachment 13286 [details] Possible patch for master
(In reply to Stefan Metzmacher from comment #1) Does that patch (for tcon) fixes the tcon problem for you?
Yes, looks good.
(In reply to Stefan Metzmacher from comment #2) Patch LGTM. RB+. Only requested change is can you move the hunk to the end of that function: 382 Here please.. + req->last_tid = tcon->global->tcon_wire_id; + 383 *out_tree_id = tcon->global->tcon_wire_id; 384 return NT_STATUS_OK; So it makes it really clear this is a part of setting the outputs on success condition. I know there are no returns in between where you did put it and the end of function, but putting it there makes is much clearer this is where we're returning the tid on success. Cheers, Jeremy.
(In reply to Jeremy Allison from comment #4) I added it after the tcon->status = NT_STATUS_OK; and successful smbXsrv_tcon_update(), before starting to calculating all out_* values. But I don't really mind if you move it to the absolute end of the function after the: *out_tree_id = tcon->global->tcon_wire_id; Then please to the same for the session setup patch of bug #12845. It would also be good to make a test for the tcon change, but I don't have the time to add that currently.
OK, will do (make the changes for the tcon and sessionsetup patches). Once they're in master I'll take a look at what it would take to add tests, but I think this'll be hard as we don't currently have infrastructure for compounding in the generic libsmbclient code. Might be possible to do it in the source4 cli code.
Created attachment 13293 [details] git-am fix for 4.6.next, 4.5.next. Cherry-picked from master.
Karolin please add to 4.6.next, 4.5.next.
(In reply to Jeremy Allison from comment #8) Pushed to autobuild-v4-{6,5}-test.
(In reply to Karolin Seeger from comment #9) Pushed to both branches. Closing out bug report. Thanks!
The patches on bug #13796 are related...