[SCM] Samba Shared Repository - branch master updated
Michael Adam
obnox at samba.org
Fri Sep 19 03:41:06 MDT 2014
The branch, master has been updated
via fe670be s3:torture: use cli_state_client_guid in run_smb2_multi_channel()
via 44b3fa6 s3:libsmb: add 'cli_state_client_guid'
via 89c6d67 s3:smb2_sesssetup: we don't need to do a 2nd smb2srv_session_lookup()
via 5003232 s3:smb2_server: add smbd_smb2_signing_key() helper function
via 6ed4eeb s3:smbXsrv_session: add smbXsrv_session_find_channel()
via cd7c24a s3:smbXsrv_session: remember the smbXsrv_connection on channel attached to a session
via e773851 s3:smbd: split out a smbd_add_connection() helper function.
via 7a45ddb s3:smbd: remove now unused smbd_server_connection->conn
via 0944797f s3:smb2_lock: iterate over all sconn->client->connections
via 1d53557 s3:smb2_lock: always use tevent_req_defer_callback() if we go async
via 04a9b0a s3:smb2_glue: remove chained fsps from all connections in remove_smb2_chained_fsp()
via 6e28bf1 s3:smb2_break: use fsp->conn->sconn->client->connections to send SMB2 oplock breaks
via 33bffc3 s3:smb2_break: pass smbXsrv_connection to smbd_smb2_send_oplock_break()
via a6ff17f s3:smb2_create: pass smbXsrv_connection to *deferred*_smb2
via 56d454b s3:smbd: pass smbXsrv_connection to schedule_deferred_open_message_smb()
via b05ae37 s3:smbd: pass smbXsrv_connection to remove_deferred_open_message_smb()
via d8cffad s3:smbd: pass smbXsrv_connection to open_was_deferred()
via 333707f s3:smbd: move smbXsrv_{session,tcon,open} tables to smbXsrv_client
via 1d615ee s3:smbd: use tevent_loop_wait() in the parent smbd process.
via 9afc37b s3:smbd: use tevent_loop_wait() in the child process event loop
via 80e226d s3:smbXsrv_session: change smbXsrv_session->connection to smbXsrv_session->client
via d7e66e5 s3:smbd: use fsp->conn->sconn->client->connections to send SMB1 oplock breaks
via 555b3d1 s3:smbd: use sconn->client->connections in keepalive_fn()
via bf22882 s3:smbd: use sconn->client->connections in reload_services()
via 7012008 s3:smbd: remove now unused smbXsrv_connection->sconn
via 4a5ca44 s3:smbXsrv_open: use xconn->client->sconn in smb1srv_open_table_init()
via f9d65d4 s3:smbXsrv_session: use xconn->client->sconn in smbXsrv_session_logoff()
via e2af19a s3:smb2_server: use xconn->client->sconn in smbd_smb2_request_next_incoming()
via 4bece82 s3:smb2_server: use xconn->client->sconn in smbd_smb2_request_create()
via fe00c8e s3:smb2_server: use xconn->client->sconn in smbd_smb2_first_negprot()
via b970db1 s3:smb2_server: use xconn->client->sconn in smbd_smb2_io_handler()
via f3fa664 s3:smbd: use xconn->client->sconn in make_connection_snum()
via 981fb26 s3:smbd: use xconn->client->sconn in smb1_parse_chain()
via d83ecf5 s3:smbd: use xconn->client->sconn in construct_reply()
via fda21db s3:smbd: use xconn->client->sconn in reply_special()
via 78951fb s3:smbd: use xconn->client->sconn in process_smb()
via e23785a s3:smbd: introduce 'struct smbXsrv_client' in order to prepare multi-channel support
via d27ae4a s3:smbd: pass smbXsrv_connection to make_connection_snum()
via 2405415 s3:smbd: pass smb_request to make_connection_smb1()
via 2dd2159 s3:smbd: pass smbd_smb2_request to make_connection_smb2()
via 21eee0e s3:smbd: pass smb_request to make_connection()
via 7408736 s3:smbd: pass smbXsrv_connection to construct_reply*()
via 3a26bd1 s3:smbd: pass smbXsrv_connection to smb1_parse_chain()
via 7c1553f s3:smbd: support xconn=NULL in init_smb_request()
via 0b99a8a s3:smbd: only pass smbXsrv_connection to fork_echo_handler()
via 92d2748 s3:smbd: use req->sconn in reply.c where possible
via 47f00fe s3:smbd: use req->sconn in sesssetup.c
via 20bcbb0 s3:smbd: use req->sconn in reply_ntcancel()
via f253314 s3:smbd: use req->sconn in reply_negprot()
via 4b9f17e s3:smbd: pass smbXsrv_connection to srv_send_smb()
via e3ab0a0 s3:smbd: pass smbXsrv_connection to receive_smb*()
via 9fe6665 s3:smbd: use smbXsrv_connection_dbg() in receive_smb_talloc()
via 93f7e62 s3:smbd: use smbXsrv_connection_dbg() inreceive_smb_raw_talloc_partial_read()
via 7f649f9 s3:smb2_sesssetup: use smb2req->sconn in smbd_smb2_reauth_generic_return()
via 7e006d1 s3:smb2_server: use the global signing key to check if signing is required
via 17f8729 s4:torture/smb2/lock: Add Lock Replay detection test case.
via bb21243 s4:torture: Add Replay tests to examine server behaviour when Multiple Channels are utilized.
via 6975ff0 s3:selftest: run the smb2.replay test against the //$SERVER_IP/durable share
via 4c64d41 libcli/smb: Add routines to enable/disable SMB2_HDR_FLAG_REPLAY_OPERATION flag.
via 2a8a6ed libcli/smb: Add routine to reset the Channel Sequence number.
via dfcc683 libcli/smb: correctly report disconnect errors after getting STATUS_PENDING
via 4b6febc s4:libcli/composite: correctly finish composite smb and smb2 requests
from 5d1aecf ctdb-build: Add missing configure checks for backtrace
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit fe670be5c45e636788934fc45d45ee3c4c52bb50
Author: Stefan Metzmacher <metze at samba.org>
Date: Fri Jun 20 01:03:38 2014 +0200
s3:torture: use cli_state_client_guid in run_smb2_multi_channel()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
Autobuild-User(master): Michael Adam <obnox at samba.org>
Autobuild-Date(master): Fri Sep 19 11:40:15 CEST 2014 on sn-devel-104
commit 44b3fa6ff86a328ffcd2d98312c81aebaeacdbb1
Author: Stefan Metzmacher <metze at samba.org>
Date: Fri Jun 20 01:03:08 2014 +0200
s3:libsmb: add 'cli_state_client_guid'
This can be used by tests to use the same client guid for multiple connections.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 89c6d6712488c8258536756f0e60ae61d09c8565
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Sep 15 00:10:11 2014 +0200
s3:smb2_sesssetup: we don't need to do a 2nd smb2srv_session_lookup()
For the continuation of a SMB2 SessionSetup we already have the
smb2req->session (with NT_STATUS_MORE_PROCESSING_REQUIRED).
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 5003232c44826297838e9716158880380f197cb9
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Jun 12 15:31:25 2014 +0200
s3:smb2_server: add smbd_smb2_signing_key() helper function
This will find the correct signing key for the connection.
If there's already a channel session key, we need to use that
otherwise we need to use the global session key.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 6ed4eebe19bce7c5fcda9a136a494e467f7fa286
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Jun 12 13:04:40 2014 +0200
s3:smbXsrv_session: add smbXsrv_session_find_channel()
This function can check if a smbXsrv_connection is already bound to
a smbXsrv_session.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit cd7c24a9b186b5f8eb5c12e098a7fd7c306349c9
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Jun 12 09:51:18 2014 +0200
s3:smbXsrv_session: remember the smbXsrv_connection on channel attached to a session
A session will be usable from multiple connections in future.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit e773851c73b4dd2d29d69a7e42e069ebd7171455
Author: Stefan Metzmacher <metze at samba.org>
Date: Fri Jun 20 00:31:31 2014 +0200
s3:smbd: split out a smbd_add_connection() helper function.
This attaches a smbXsrv_connection to a smbXsrv_client structure.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 7a45ddbaca2c193efe85d244216a8217673079a5
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Jun 12 08:43:26 2014 +0200
s3:smbd: remove now unused smbd_server_connection->conn
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 0944797fef63123f0a984a05adcfe15a827661a9
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Sep 16 09:03:39 2014 +0200
s3:smb2_lock: iterate over all sconn->client->connections
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 1d53557df59adc691d726aa2094e877409a7f92c
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Sep 16 08:05:31 2014 +0200
s3:smb2_lock: always use tevent_req_defer_callback() if we go async
process_blocking_lock_queue_smb2() can call reprocess_blocked_smb2_lock()
multiple times, which results in multiple tevent_req_done() calls.
As we could disconnect the connection from there,
process_blocking_lock_queue_smb2() could crash as the local state might be
destroyed.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 04a9b0a7b23c2256b782bfc5800cf81f7c73c953
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Sep 16 07:50:41 2014 +0200
s3:smb2_glue: remove chained fsps from all connections in remove_smb2_chained_fsp()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 6e28bf174b4670b47a3a4d402b935da3c7cbf421
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Sep 16 09:23:54 2014 +0200
s3:smb2_break: use fsp->conn->sconn->client->connections to send SMB2 oplock breaks
This means we use the first connection for now.
TODO: we may need to use the connection on which the SMB2 create was done
and fallback to other connections.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 33bffc3258ecc4f318a9915d3613ef11fb4ce886
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Sep 16 06:52:26 2014 +0200
s3:smb2_break: pass smbXsrv_connection to smbd_smb2_send_oplock_break()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit a6ff17f978fe0d0e053603da09f602bc8bc5d74c
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Sep 16 07:49:44 2014 +0200
s3:smb2_create: pass smbXsrv_connection to *deferred*_smb2
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 56d454b4ae40afeeb90182f37aeb812f8a93c0e4
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Sep 16 07:38:44 2014 +0200
s3:smbd: pass smbXsrv_connection to schedule_deferred_open_message_smb()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit b05ae37da68c73cfc14b2ce8ef1ac08cd188cb8a
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Sep 16 07:32:14 2014 +0200
s3:smbd: pass smbXsrv_connection to remove_deferred_open_message_smb()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit d8cffad8e00e7c6bd6727e00b247bc5443ea053d
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Sep 16 06:55:39 2014 +0200
s3:smbd: pass smbXsrv_connection to open_was_deferred()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 333707fa376cc27476d1fef2d291c6ae6482b1d6
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Jun 12 20:22:54 2014 +0200
s3:smbd: move smbXsrv_{session,tcon,open} tables to smbXsrv_client
These should be per client (based on the SMB >= 2.1 client_guid),
this is a preparation for multi-channel support.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 1d615ee923a2b46ffd7f943a9ba9e362b6322e5e
Author: Michael Adam <obnox at samba.org>
Date: Tue Feb 26 16:39:46 2013 +0100
s3:smbd: use tevent_loop_wait() in the parent smbd process.
Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
Signed-off-by: Michael Adam <obnox at samba.org>
Signed-off-by: Stefan Metzmacher <metze at samba.org>
commit 9afc37bef4e60ea4a13db8ae68ba30d73b5b719c
Author: Michael Adam <obnox at samba.org>
Date: Tue Feb 26 16:18:09 2013 +0100
s3:smbd: use tevent_loop_wait() in the child process event loop
Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
Signed-off-by: Michael Adam <obnox at samba.org>
Signed-off-by: Stefan Metzmacher <metze at samba.org>
commit 80e226ddae0d7f4a8a0d55cd3389620dba556307
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Jun 12 09:30:24 2014 +0200
s3:smbXsrv_session: change smbXsrv_session->connection to smbXsrv_session->client
A session will be usable from multiple connections in future.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit d7e66e59b080f7e29e46a469d1f63ca6183be501
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Sep 16 09:23:54 2014 +0200
s3:smbd: use fsp->conn->sconn->client->connections to send SMB1 oplock breaks
This means we use the first and only connection.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 555b3d18d224a210907682ac1561bd91f9596810
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Sep 15 04:07:43 2014 +0200
s3:smbd: use sconn->client->connections in keepalive_fn()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit bf22882ed31784d1fddee0c96ede35a4d5d34b24
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Jun 10 15:47:26 2014 +0200
s3:smbd: use sconn->client->connections in reload_services()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 7012008eb657f0b1691e1a776761619a24267d29
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Jun 12 08:57:22 2014 +0200
s3:smbd: remove now unused smbXsrv_connection->sconn
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 4a5ca44770618de6c1b680847f530eeebcb71807
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Jun 12 08:57:22 2014 +0200
s3:smbXsrv_open: use xconn->client->sconn in smb1srv_open_table_init()
conn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit f9d65d4764b466186d3abd3a7efefac6ac46bcb3
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Jun 12 08:57:22 2014 +0200
s3:smbXsrv_session: use xconn->client->sconn in smbXsrv_session_logoff()
conn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit e2af19a5d8d317b3b9703dbec9730842c1ed5f36
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Jun 11 10:59:00 2014 +0200
s3:smb2_server: use xconn->client->sconn in smbd_smb2_request_next_incoming()
xconn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 4bece82dd6ebbd63ae5d14c5d85132eab8f89e58
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Jun 11 10:51:04 2014 +0200
s3:smb2_server: use xconn->client->sconn in smbd_smb2_request_create()
xconn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit fe00c8e436c1d1f93d76dcb96e568d8e21e407f0
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Jun 11 10:42:01 2014 +0200
s3:smb2_server: use xconn->client->sconn in smbd_smb2_first_negprot()
xconn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit b970db154af3e8e1fa749fad7cadff578d03f87e
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Jun 10 20:20:58 2014 +0200
s3:smb2_server: use xconn->client->sconn in smbd_smb2_io_handler()
xconn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit f3fa664ea58b1b7b0f6c26697222f477ac18c5f1
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Sep 16 01:03:31 2014 +0200
s3:smbd: use xconn->client->sconn in make_connection_snum()
xconn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 981fb261c91a35c31214993019f56953b6308cdc
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Jun 11 12:54:47 2014 +0200
s3:smbd: use xconn->client->sconn in smb1_parse_chain()
xconn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit d83ecf5b1d74445a63d7327e8b1a91ac19e65152
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Jun 11 12:54:47 2014 +0200
s3:smbd: use xconn->client->sconn in construct_reply()
xconn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit fda21db35186cd259d3f96da7a3f5c1102f8b246
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Jun 11 12:54:47 2014 +0200
s3:smbd: use xconn->client->sconn in reply_special()
xconn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 78951fb099124fcb5c46a1e5506915107f89ed7f
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Jun 11 10:40:42 2014 +0200
s3:smbd: use xconn->client->sconn in process_smb()
xconn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit e23785ae37bae80d3e356e44a00b21a0037c860e
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue May 20 19:47:13 2014 +0200
s3:smbd: introduce 'struct smbXsrv_client' in order to prepare multi-channel support
This structure is supposed to hold the global state shared between
multiple connections from the same client.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit d27ae4a14a1944ea522431a419d45c3036a15eeb
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Sep 15 03:47:41 2014 +0200
s3:smbd: pass smbXsrv_connection to make_connection_snum()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 2405415583f51479b29b44ab5eb578ecda18a28e
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Sep 15 03:47:41 2014 +0200
s3:smbd: pass smb_request to make_connection_smb1()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 2dd215919dff3085a532b32d5da45a629a6924c1
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Sep 15 03:47:41 2014 +0200
s3:smbd: pass smbd_smb2_request to make_connection_smb2()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 21eee0ea054d5963c58901ec272b01425f525ba5
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Sep 15 03:47:41 2014 +0200
s3:smbd: pass smb_request to make_connection()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 7408736d9d59be990f771239f3d57b45d49798ec
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Jun 12 08:43:26 2014 +0200
s3:smbd: pass smbXsrv_connection to construct_reply*()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 3a26bd1a3d7f0525bbed1b23a28a2a11d43973a8
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Jun 12 08:43:26 2014 +0200
s3:smbd: pass smbXsrv_connection to smb1_parse_chain()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 7c1553fe89ac9ba1844b8680320911dcacc0ba67
Author: Michael Adam <obnox at samba.org>
Date: Thu Sep 18 21:46:22 2014 +0200
s3:smbd: support xconn=NULL in init_smb_request()
Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
Signed-off-by: Michael Adam <obnox at samba.org>
Signed-off-by: Stefan Metzmacher <metze at samba.org>
commit 0b99a8ac451d6aaf0200c364b9ea605f9667c5cb
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Jun 12 08:43:26 2014 +0200
s3:smbd: only pass smbXsrv_connection to fork_echo_handler()
We don't need smbd_server_connection there.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 92d27483033276203a4d0d5133e535eb721b165c
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Jun 11 15:12:32 2014 +0200
s3:smbd: use req->sconn in reply.c where possible
xconn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 47f00fee35fac3be81db734db8ff100d6c1418b8
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Jun 11 15:11:05 2014 +0200
s3:smbd: use req->sconn in sesssetup.c
xconn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 20bcbb09e1e3c08fe506946e7ff8e81c5acdb6c0
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Jun 11 14:26:57 2014 +0200
s3:smbd: use req->sconn in reply_ntcancel()
xconn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit f25331499ec5f3e52c9bb6030af686a1b82d9dd8
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Jun 11 12:42:56 2014 +0200
s3:smbd: use req->sconn in reply_negprot()
xconn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 4b9f17eca73120a1741250d2d55382921e4dea3c
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Jun 11 12:55:24 2014 +0200
s3:smbd: pass smbXsrv_connection to srv_send_smb()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit e3ab0a0569db3a63a05deae1c372b88eabf2bea2
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Jun 12 08:43:26 2014 +0200
s3:smbd: pass smbXsrv_connection to receive_smb*()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 9fe66659684cd730ef39a9bb399be29a0f02e215
Author: Michael Adam <obnox at samba.org>
Date: Thu Sep 18 21:25:44 2014 +0200
s3:smbd: use smbXsrv_connection_dbg() in receive_smb_talloc()
instead of manually assembling the address string
Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
Signed-off-by: Michael Adam <obnox at samba.org>
Signed-off-by: Stefan Metzmacher <metze at samba.org>
commit 93f7e6251b854c93a4fa9cb133217b7780309c55
Author: Michael Adam <obnox at samba.org>
Date: Thu Sep 18 21:23:31 2014 +0200
s3:smbd: use smbXsrv_connection_dbg() inreceive_smb_raw_talloc_partial_read()
instead of manually assembling the address string
Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
Signed-off-by: Michael Adam <obnox at samba.org>
Signed-off-by: Stefan Metzmacher <metze at samba.org>
commit 7f649f9e22da48711ff1622ea6cc737daffc8fa5
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Aug 6 17:05:26 2014 +0200
s3:smb2_sesssetup: use smb2req->sconn in smbd_smb2_reauth_generic_return()
xconn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 7e006d11134cdc37ea0fc13110fe5bbfb9de3f14
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Jun 12 15:10:11 2014 +0200
s3:smb2_server: use the global signing key to check if signing is required
If we have a channel session key, we also always have a global session key.
For multi-channel it's possible that the channel session key is not in place
yet, in that case the global session key needs to be used.
In both cases (reauth or session bind) we session setup requests need to be
signed.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 17f87297cd51b0910c3f1b26258ca0ec828a1ced
Author: Anubhav Rakshit <anubhav.rakshit at gmail.com>
Date: Fri Sep 5 16:16:57 2014 +0530
s4:torture/smb2/lock: Add Lock Replay detection test case.
Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
Signed-off-by: Anubhav Rakshit <anubhav.rakshit at gmail.com>
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit bb2124332ccb5a3640ac3c23e088fe133272e3a0
Author: Anubhav Rakshit <anubhav.rakshit at gmail.com>
Date: Thu Aug 7 12:52:50 2014 +0530
s4:torture: Add Replay tests to examine server behaviour when Multiple Channels are utilized.
Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Signed-off-by: Anubhav Rakshit <anubhav.rakshit at gmail.com>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 6975ff05ab952ddde9dd9044663e434b35b56fe0
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Aug 28 13:26:44 2014 +0200
s3:selftest: run the smb2.replay test against the //$SERVER_IP/durable share
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 4c64d41cfcb7b0bb30929aefd8bcd735449c83c3
Author: Anubhav Rakshit <anubhav.rakshit at gmail.com>
Date: Thu Jul 10 16:46:04 2014 +0530
libcli/smb: Add routines to enable/disable SMB2_HDR_FLAG_REPLAY_OPERATION flag.
Signed-off-by: Anubhav Rakshit <anubhav.rakshit at gmail.com>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 2a8a6edfef9fc56c8b002dcc615a4666fc476a49
Author: Anubhav Rakshit <anubhav.rakshit at gmail.com>
Date: Thu Jul 10 14:30:10 2014 +0530
libcli/smb: Add routine to reset the Channel Sequence number.
Signed-off-by: Anubhav Rakshit <anubhav.rakshit at gmail.com>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit dfcc683e38e18da0ce7140d729cf7eb285347681
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Aug 28 10:20:36 2014 +0200
libcli/smb: correctly report disconnect errors after getting STATUS_PENDING
smb2cli_req_recv() should not report STATUS_PENDING if the
request isn't pending anymore (e.g. the connection was disconnected)
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit 4b6febc670812d688ce6b6edd3fa24e671959b5c
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Aug 28 11:05:23 2014 +0200
s4:libcli/composite: correctly finish composite smb and smb2 requests
Without this we would hang forever if the connection was already disconnected,
instead of directly propagating NT_STATUS_CONNECTION_DISCONNECTED;
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
-----------------------------------------------------------------------
Summary of changes:
libcli/smb/smbXcli_base.c | 42 ++-
libcli/smb/smbXcli_base.h | 4 +
selftest/knownfail | 5 +
source3/librpc/idl/smbXsrv.idl | 40 ++-
source3/libsmb/clientgen.c | 10 +-
source3/libsmb/proto.h | 1 +
source3/selftest/tests.py | 2 +-
source3/smbd/aio.c | 6 +-
source3/smbd/blocking.c | 6 +-
source3/smbd/globals.c | 2 +-
source3/smbd/globals.h | 46 +--
source3/smbd/ipc.c | 9 +-
source3/smbd/negprot.c | 4 +-
source3/smbd/nttrans.c | 13 +-
source3/smbd/open.c | 8 +-
source3/smbd/oplock.c | 8 +-
source3/smbd/pipes.c | 2 +-
source3/smbd/process.c | 571 ++++++++++++++----------
source3/smbd/proto.h | 16 +-
source3/smbd/reply.c | 35 +-
source3/smbd/server.c | 50 ++-
source3/smbd/server_exit.c | 43 ++-
source3/smbd/server_reload.c | 9 +-
source3/smbd/service.c | 26 +-
source3/smbd/sesssetup.c | 4 +-
source3/smbd/smb2_break.c | 11 +-
source3/smbd/smb2_create.c | 17 +-
source3/smbd/smb2_glue.c | 23 +-
source3/smbd/smb2_lock.c | 192 +++++----
source3/smbd/smb2_server.c | 46 ++-
source3/smbd/smb2_sesssetup.c | 13 +-
source3/smbd/smb2_tcon.c | 2 +-
source3/smbd/smbXsrv_open.c | 17 +-
source3/smbd/smbXsrv_session.c | 94 +++--
source3/smbd/smbXsrv_tcon.c | 18 +-
source3/smbd/trans2.c | 9 +-
source3/torture/test_smb2.c | 6 +
source3/torture/vfstest_chain.c | 4 +-
source4/libcli/composite/composite.c | 8 +
source4/torture/smb2/lock.c | 181 ++++++++-
source4/torture/smb2/replay.c | 824 ++++++++++++++++++++++++++++++++++
source4/torture/smb2/smb2.c | 13 +-
source4/torture/smb2/wscript_build | 2 +-
43 files changed, 1902 insertions(+), 540 deletions(-)
create mode 100644 source4/torture/smb2/replay.c
Changeset truncated at 500 lines:
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index 43dd994..6c367ae 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -140,6 +140,7 @@ struct smb2cli_session {
uint64_t nonce_high;
uint64_t nonce_low;
uint16_t channel_sequence;
+ bool replay_active;
};
struct smbXcli_session {
@@ -2632,6 +2633,7 @@ struct tevent_req *smb2cli_req_create(TALLOC_CTX *mem_ctx,
uint64_t uid = 0;
bool use_channel_sequence = false;
uint16_t channel_sequence = 0;
+ bool use_replay_flag = false;
req = tevent_req_create(mem_ctx, &state,
struct smbXcli_req_state);
@@ -2650,6 +2652,10 @@ struct tevent_req *smb2cli_req_create(TALLOC_CTX *mem_ctx,
use_channel_sequence = true;
}
+ if (smbXcli_conn_protocol(conn) >= PROTOCOL_SMB3_00) {
+ use_replay_flag = true;
+ }
+
if (session) {
uid = session->smb2->session_id;
@@ -2657,6 +2663,10 @@ struct tevent_req *smb2cli_req_create(TALLOC_CTX *mem_ctx,
channel_sequence = session->smb2->channel_sequence;
}
+ if (use_replay_flag && session->smb2->replay_active) {
+ additional_flags |= SMB2_HDR_FLAG_REPLAY_OPERATION;
+ }
+
state->smb2.should_sign = session->smb2->should_sign;
state->smb2.should_encrypt = session->smb2->should_encrypt;
@@ -3349,8 +3359,6 @@ static NTSTATUS smb2cli_conn_dispatch_incoming(struct smbXcli_conn *conn,
}
state = tevent_req_data(req, struct smbXcli_req_state);
- state->smb2.got_async = false;
-
req_opcode = SVAL(state->smb2.hdr, SMB2_HDR_OPCODE);
if (opcode != req_opcode) {
return NT_STATUS_INVALID_NETWORK_RESPONSE;
@@ -3366,6 +3374,12 @@ static NTSTATUS smb2cli_conn_dispatch_incoming(struct smbXcli_conn *conn,
NT_STATUS_EQUAL(status, STATUS_PENDING)) {
uint64_t async_id = BVAL(inhdr, SMB2_HDR_ASYNC_ID);
+ if (state->smb2.got_async) {
+ /* We only expect one STATUS_PENDING response */
+ return NT_STATUS_INVALID_NETWORK_RESPONSE;
+ }
+ state->smb2.got_async = true;
+
/*
* async interim responses are not signed,
* even if the SMB2_HDR_FLAG_SIGNED flag
@@ -3376,7 +3390,6 @@ static NTSTATUS smb2cli_conn_dispatch_incoming(struct smbXcli_conn *conn,
SBVAL(state->smb2.hdr, SMB2_HDR_ASYNC_ID, async_id);
if (state->smb2.notify_async) {
- state->smb2.got_async = true;
tevent_req_defer_callback(req, state->ev);
tevent_req_notify_callback(req);
}
@@ -3621,7 +3634,7 @@ NTSTATUS smb2cli_req_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
*piov = NULL;
}
- if (state->smb2.got_async) {
+ if (tevent_req_is_in_progress(req) && state->smb2.got_async) {
return STATUS_PENDING;
}
@@ -4766,6 +4779,27 @@ void smb2cli_session_increment_channel_sequence(struct smbXcli_session *session)
session->smb2->channel_sequence += 1;
}
+uint16_t smb2cli_session_reset_channel_sequence(struct smbXcli_session *session,
+ uint16_t channel_sequence)
+{
+ uint16_t prev_cs;
+
+ prev_cs = session->smb2->channel_sequence;
+ session->smb2->channel_sequence = channel_sequence;
+
+ return prev_cs;
+}
+
+void smb2cli_session_start_replay(struct smbXcli_session *session)
+{
+ session->smb2->replay_active = true;
+}
+
+void smb2cli_session_stop_replay(struct smbXcli_session *session)
+{
+ session->smb2->replay_active = false;
+}
+
NTSTATUS smb2cli_session_set_session_key(struct smbXcli_session *session,
const DATA_BLOB _session_key,
const struct iovec *recv_iov)
diff --git a/libcli/smb/smbXcli_base.h b/libcli/smb/smbXcli_base.h
index 06015b1..e0c90b5 100644
--- a/libcli/smb/smbXcli_base.h
+++ b/libcli/smb/smbXcli_base.h
@@ -380,6 +380,10 @@ void smb2cli_session_set_id_and_flags(struct smbXcli_session *session,
uint64_t session_id,
uint16_t session_flags);
void smb2cli_session_increment_channel_sequence(struct smbXcli_session *session);
+uint16_t smb2cli_session_reset_channel_sequence(struct smbXcli_session *session,
+ uint16_t channel_sequence);
+void smb2cli_session_start_replay(struct smbXcli_session *session);
+void smb2cli_session_stop_replay(struct smbXcli_session *session);
NTSTATUS smb2cli_session_set_session_key(struct smbXcli_session *session,
const DATA_BLOB session_key,
const struct iovec *recv_iov);
diff --git a/selftest/knownfail b/selftest/knownfail
index 0b789c9..3d73495 100644
--- a/selftest/knownfail
+++ b/selftest/knownfail
@@ -216,6 +216,11 @@
^samba3.smb2.setinfo.setinfo
^samba3.smb2.session.*reauth5 # some special anonymous checks?
^samba3.smb2.compound.interim2 # wrong return code (STATUS_CANCELLED)
+^samba3.smb2.replay.replay1
+^samba3.smb2.replay.replay2
+^samba3.smb2.replay.replay3
+^samba3.smb2.replay.replay4
+^samba3.smb2.lock.*replay
^samba3.raw.session.*reauth2 # maybe fix this?
^samba3.rpc.samr.passwords.badpwdcount.samr.badPwdCount\(s3dc\) # We fail this test currently
^samba3.rpc.samr.passwords.lockout.*\(s3dc\)$ # We fail this test currently
diff --git a/source3/librpc/idl/smbXsrv.idl b/source3/librpc/idl/smbXsrv.idl
index ca5c3f3..0035442 100644
--- a/source3/librpc/idl/smbXsrv.idl
+++ b/source3/librpc/idl/smbXsrv.idl
@@ -77,6 +77,43 @@ interface smbXsrv
[in] smbXsrv_version_globalB blob
);
+ /* client */
+
+ typedef struct {
+ [ignore] struct tevent_context *ev_ctx;
+ [ignore] struct messaging_context *msg_ctx;
+
+ /*
+ * There's just one 'sconn' per client.
+ * It holds the FSA layer details, which are global
+ * per client (process).
+ */
+ [ignore] struct smbd_server_connection *sconn;
+
+ /*
+ * this session_table is used for SMB1 and SMB2,
+ */
+ [ignore] struct smbXsrv_session_table *session_table;
+ [ignore] hyper last_session_id;
+ /*
+ * this tcon_table is only used for SMB1.
+ */
+ [ignore] struct smbXsrv_tcon_table *tcon_table;
+ /*
+ * this open_table is used for SMB1 and SMB2,
+ * because we have a global sconn->real_max_open_files
+ * limit.
+ */
+ [ignore] struct smbXsrv_open_table *open_table;
+
+ /*
+ * For now this is only one connection!
+ * With multi-channel support we'll get more than
+ * one in future.
+ */
+ [ignore] struct smbXsrv_connection *connections;
+ } smbXsrv_client;
+
/* sessions */
typedef struct {
@@ -86,6 +123,7 @@ interface smbXsrv
[charset(UTF8),string] char remote_name[];
[noprint] DATA_BLOB signing_key;
uint32 auth_session_info_seqnum;
+ [ignore] smbXsrv_connection *connection;
} smbXsrv_channel_global0;
typedef struct {
@@ -142,7 +180,7 @@ interface smbXsrv
typedef struct {
[ignore] smbXsrv_session_table *table;
[ignore] db_record *db_rec;
- [ignore] smbXsrv_connection *connection;
+ [ignore] smbXsrv_client *client;
uint32 local_id;
[ref] smbXsrv_session_global0 *global;
NTSTATUS status;
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index 8a38810..71ec1dc 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -131,6 +131,8 @@ NTSTATUS cli_init_creds(struct cli_state *cli, const char *username, const char
Set the signing state (used from the command line).
****************************************************************************/
+struct GUID cli_state_client_guid;
+
struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
int fd,
const char *remote_name,
@@ -144,7 +146,13 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
bool use_level_II_oplocks = false;
uint32_t smb1_capabilities = 0;
uint32_t smb2_capabilities = 0;
- struct GUID client_guid = GUID_random();
+ struct GUID client_guid;
+
+ if (!GUID_all_zero(&cli_state_client_guid)) {
+ client_guid = cli_state_client_guid;
+ } else {
+ client_guid = GUID_random();
+ }
/* Check the effective uid - make sure we are not setuid */
if (is_setuid_root()) {
diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h
index 63d2df4..2efb208 100644
--- a/source3/libsmb/proto.h
+++ b/source3/libsmb/proto.h
@@ -165,6 +165,7 @@ NTSTATUS cli_set_domain(struct cli_state *cli, const char *domain);
NTSTATUS cli_set_username(struct cli_state *cli, const char *username);
NTSTATUS cli_set_password(struct cli_state *cli, const char *password);
NTSTATUS cli_init_creds(struct cli_state *cli, const char *username, const char *domain, const char *password);
+extern struct GUID cli_state_client_guid;
struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
int fd,
const char *remote_name,
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index 97d0538..126c26c 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -334,7 +334,7 @@ for t in tests:
elif t == "rpc.samr.passwords.validate":
plansmbtorture4testsuite(t, "s3dc", 'ncacn_ip_tcp:$SERVER_IP -U$USERNAME%$PASSWORD', 'over ncacn_ip_tcp ')
plansmbtorture4testsuite(t, "plugin_s4_dc", 'ncacn_ip_tcp:$SERVER_IP -U$USERNAME%$PASSWORD', 'over ncacn_ip_tcp ')
- elif t == "smb2.durable-open" or t == "smb2.durable-v2-open":
+ elif t == "smb2.durable-open" or t == "smb2.durable-v2-open" or t == "smb2.replay":
plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/durable -U$USERNAME%$PASSWORD')
plansmbtorture4testsuite(t, "plugin_s4_dc", '//$SERVER_IP/durable -U$USERNAME%$PASSWORD')
elif t == "base.rw1":
diff --git a/source3/smbd/aio.c b/source3/smbd/aio.c
index f5e4cc6..56b4cfc 100644
--- a/source3/smbd/aio.c
+++ b/source3/smbd/aio.c
@@ -305,7 +305,7 @@ static void aio_pread_smb1_done(struct tevent_req *req)
}
smb_setlen(outbuf, outsize - 4);
show_msg(outbuf);
- if (!srv_send_smb(aio_ex->smbreq->sconn, outbuf,
+ if (!srv_send_smb(aio_ex->smbreq->xconn, outbuf,
true, aio_ex->smbreq->seqnum+1,
IS_CONN_ENCRYPTED(fsp->conn), NULL)) {
exit_server_cleanly("handle_aio_read_complete: srv_send_smb "
@@ -522,7 +522,7 @@ NTSTATUS schedule_aio_write_and_X(connection_struct *conn,
SSVAL(aio_ex->outbuf.data,smb_vwv2,numtowrite);
SSVAL(aio_ex->outbuf.data,smb_vwv4,(numtowrite>>16)&1);
show_msg((char *)aio_ex->outbuf.data);
- if (!srv_send_smb(aio_ex->smbreq->sconn,
+ if (!srv_send_smb(aio_ex->smbreq->xconn,
(char *)aio_ex->outbuf.data,
true, aio_ex->smbreq->seqnum+1,
IS_CONN_ENCRYPTED(fsp->conn),
@@ -624,7 +624,7 @@ static void aio_pwrite_smb1_done(struct tevent_req *req)
}
show_msg(outbuf);
- if (!srv_send_smb(aio_ex->smbreq->sconn, outbuf,
+ if (!srv_send_smb(aio_ex->smbreq->xconn, outbuf,
true, aio_ex->smbreq->seqnum+1,
IS_CONN_ENCRYPTED(fsp->conn),
NULL)) {
diff --git a/source3/smbd/blocking.c b/source3/smbd/blocking.c
index 5d3672e..942c4b3 100644
--- a/source3/smbd/blocking.c
+++ b/source3/smbd/blocking.c
@@ -277,7 +277,7 @@ static void reply_lockingX_success(struct blocking_lock_record *blr)
* that here and must set up the chain info manually.
*/
- if (!srv_send_smb(req->sconn,
+ if (!srv_send_smb(req->xconn,
(char *)req->outbuf,
true, req->seqnum+1,
IS_CONN_ENCRYPTED(req->conn)||req->encrypted,
@@ -318,7 +318,7 @@ static void generic_blocking_lock_error(struct blocking_lock_record *blr, NTSTAT
}
reply_nterror(blr->req, status);
- if (!srv_send_smb(blr->req->sconn, (char *)blr->req->outbuf,
+ if (!srv_send_smb(blr->req->xconn, (char *)blr->req->outbuf,
true, blr->req->seqnum+1,
blr->req->encrypted, NULL)) {
exit_server_cleanly("generic_blocking_lock_error: srv_send_smb failed.");
@@ -407,7 +407,7 @@ static void blocking_lock_reply_error(struct blocking_lock_record *blr, NTSTATUS
*/
SCVAL(blr->req->outbuf,smb_com,SMBtrans2);
- if (!srv_send_smb(blr->req->sconn,
+ if (!srv_send_smb(blr->req->xconn,
(char *)blr->req->outbuf,
true, blr->req->seqnum+1,
IS_CONN_ENCRYPTED(blr->fsp->conn),
diff --git a/source3/smbd/globals.c b/source3/smbd/globals.c
index e03c7c4..c9da6db 100644
--- a/source3/smbd/globals.c
+++ b/source3/smbd/globals.c
@@ -90,7 +90,7 @@ struct smbd_parent_context *am_parent = NULL;
struct memcache *smbd_memcache_ctx = NULL;
bool exit_firsttime = true;
-struct smbXsrv_connection *global_smbXsrv_connection = NULL;
+struct smbXsrv_client *global_smbXsrv_client = NULL;
struct memcache *smbd_memcache(void)
{
diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h
index 5a8e3bd..d0015d5 100644
--- a/source3/smbd/globals.h
+++ b/source3/smbd/globals.h
@@ -222,6 +222,9 @@ void smbd_server_connection_terminate_ex(struct smbXsrv_connection *xconn,
const char *smb2_opcode_name(uint16_t opcode);
bool smbd_is_smb2_header(const uint8_t *inbuf, size_t size);
+NTSTATUS smbd_add_connection(struct smbXsrv_client *client, int sock_fd,
+ struct smbXsrv_connection **_xconn);
+
void reply_smb2002(struct smb_request *req, uint16_t choice);
void reply_smb20ff(struct smb_request *req, uint16_t choice);
void smbd_smb2_first_negprot(struct smbXsrv_connection *xconn,
@@ -242,7 +245,7 @@ NTSTATUS smbd_smb2_request_done_ex(struct smbd_smb2_request *req,
#define smbd_smb2_request_done(req, body, dyn) \
smbd_smb2_request_done_ex(req, NT_STATUS_OK, body, dyn, __location__)
-NTSTATUS smbd_smb2_send_oplock_break(struct smbd_server_connection *sconn,
+NTSTATUS smbd_smb2_send_oplock_break(struct smbXsrv_connection *xconn,
struct smbXsrv_session *session,
struct smbXsrv_tcon *tcon,
struct smbXsrv_open *op,
@@ -318,20 +321,25 @@ int map_smb2_oplock_levels_to_samba(uint8_t in_oplock_level);
bool get_deferred_open_message_state_smb2(struct smbd_smb2_request *smb2req,
struct timeval *p_request_time,
struct deferred_open_record **open_rec);
-bool open_was_deferred_smb2(struct smbd_server_connection *sconn,
- uint64_t mid);
+bool open_was_deferred_smb2(
+ struct smbXsrv_connection *xconn, uint64_t mid);
void remove_deferred_open_message_smb2(
- struct smbd_server_connection *sconn, uint64_t mid);
+ struct smbXsrv_connection *xconn, uint64_t mid);
bool schedule_deferred_open_message_smb2(
- struct smbd_server_connection *sconn, uint64_t mid);
+ struct smbXsrv_connection *xconn, uint64_t mid);
bool push_deferred_open_message_smb2(struct smbd_smb2_request *smb2req,
struct timeval request_time,
struct timeval timeout,
struct file_id id,
struct deferred_open_record *open_rec);
+struct smbXsrv_client;
+
struct smbXsrv_connection {
- struct smbd_server_connection *sconn;
+ struct smbXsrv_connection *prev, *next;
+
+ struct smbXsrv_client *client;
+
const struct tsocket_address *local_address;
const struct tsocket_address *remote_address;
@@ -500,24 +508,6 @@ struct smbXsrv_connection {
struct smbd_smb2_request *requests;
} smb2;
-
- uint64_t smbd_idle_profstamp;
-
- /*
- * this session_table is used for SMB1 and SMB2,
- */
- struct smbXsrv_session_table *session_table;
- uint64_t last_session_id;
- /*
- * this tcon_table is only used for SMB1.
- */
- struct smbXsrv_tcon_table *tcon_table;
- /*
- * this open_table is used for SMB1 and SMB2,
- * because we have a global sconn->real_max_open_files
- * limit.
- */
- struct smbXsrv_open_table *open_table;
};
const char *smbXsrv_connection_dbg(const struct smbXsrv_connection *xconn);
@@ -533,6 +523,10 @@ NTSTATUS smbXsrv_session_create(struct smbXsrv_connection *conn,
NTTIME now,
struct smbXsrv_session **_session);
NTSTATUS smbXsrv_session_update(struct smbXsrv_session *session);
+struct smbXsrv_channel_global0;
+NTSTATUS smbXsrv_session_find_channel(const struct smbXsrv_session *session,
+ const struct smbXsrv_connection *conn,
+ struct smbXsrv_channel_global0 **_c);
NTSTATUS smbXsrv_session_logoff(struct smbXsrv_session *session);
NTSTATUS smbXsrv_session_logoff_all(struct smbXsrv_connection *conn);
NTSTATUS smb1srv_session_table_init(struct smbXsrv_connection *conn);
@@ -853,9 +847,9 @@ struct smbd_server_connection {
struct asys_context *asys_ctx;
struct tevent_fd *asys_fde;
- struct smbXsrv_connection *conn;
+ struct smbXsrv_client *client;
};
-extern struct smbXsrv_connection *global_smbXsrv_connection;
+extern struct smbXsrv_client *global_smbXsrv_client;
void smbd_init_globals(void);
diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c
index 9a07ba0..6f4c7e0 100644
--- a/source3/smbd/ipc.c
+++ b/source3/smbd/ipc.c
@@ -108,7 +108,6 @@ void send_trans_reply(connection_struct *conn,
int ldata = rdata ? rdata_len : 0;
int lparam = rparam ? rparam_len : 0;
struct smbXsrv_connection *xconn = req->xconn;
- struct smbd_server_connection *sconn = xconn->sconn;
int max_send = xconn->smb1.sessions.max_send;
/* HACK: make sure we send at least 128 byte in one go */
int hdr_overhead = SMB_BUFFER_SIZE_MIN - 128;
@@ -152,7 +151,7 @@ void send_trans_reply(connection_struct *conn,
}
show_msg((char *)req->outbuf);
- if (!srv_send_smb(sconn, (char *)req->outbuf,
+ if (!srv_send_smb(xconn, (char *)req->outbuf,
true, req->seqnum+1,
IS_CONN_ENCRYPTED(conn), &req->pcd)) {
exit_server_cleanly("send_trans_reply: srv_send_smb failed.");
@@ -212,7 +211,7 @@ void send_trans_reply(connection_struct *conn,
}
show_msg((char *)req->outbuf);
- if (!srv_send_smb(sconn, (char *)req->outbuf,
+ if (!srv_send_smb(xconn, (char *)req->outbuf,
true, req->seqnum+1,
IS_CONN_ENCRYPTED(conn), &req->pcd))
exit_server_cleanly("send_trans_reply: srv_send_smb "
@@ -342,7 +341,7 @@ static void api_dcerpc_cmd_write_done(struct tevent_req *subreq)
send:
if (!srv_send_smb(
- req->sconn, (char *)req->outbuf,
+ req->xconn, (char *)req->outbuf,
true, req->seqnum+1,
IS_CONN_ENCRYPTED(req->conn) || req->encrypted,
&req->pcd)) {
@@ -375,7 +374,7 @@ static void api_dcerpc_cmd_read_done(struct tevent_req *subreq)
NT_STATUS_EQUAL(old, status)?"":nt_errstr(status)));
reply_nterror(req, status);
- if (!srv_send_smb(req->sconn, (char *)req->outbuf,
+ if (!srv_send_smb(req->xconn, (char *)req->outbuf,
true, req->seqnum+1,
IS_CONN_ENCRYPTED(req->conn)
||req->encrypted, &req->pcd)) {
diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c
index 86a4acd..e6a9bde 100644
--- a/source3/smbd/negprot.c
+++ b/source3/smbd/negprot.c
@@ -517,7 +517,7 @@ void reply_negprot(struct smb_request *req)
int i;
size_t converted_size;
struct smbXsrv_connection *xconn = req->xconn;
- struct smbd_server_connection *sconn = xconn->sconn;
+ struct smbd_server_connection *sconn = req->sconn;
START_PROFILE(SMBnegprot);
@@ -698,7 +698,7 @@ void reply_negprot(struct smb_request *req)
TALLOC_FREE(cliprotos);
if (lp_async_smb_echo_handler() && (chosen_level < PROTOCOL_SMB2_02) &&
--
Samba Shared Repository
More information about the samba-cvs
mailing list