Stefan Metzmacher
cd7c24a9b1
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@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:13 +02:00
Stefan Metzmacher
e773851c73
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@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:13 +02:00
Stefan Metzmacher
7a45ddbaca
s3:smbd: remove now unused smbd_server_connection->conn
...
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:13 +02:00
Stefan Metzmacher
0944797fef
s3:smb2_lock: iterate over all sconn->client->connections
...
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:12 +02:00
Stefan Metzmacher
1d53557df5
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@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:12 +02:00
Stefan Metzmacher
04a9b0a7b2
s3:smb2_glue: remove chained fsps from all connections in remove_smb2_chained_fsp()
...
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:12 +02:00
Stefan Metzmacher
6e28bf174b
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@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:12 +02:00
Stefan Metzmacher
33bffc3258
s3:smb2_break: pass smbXsrv_connection to smbd_smb2_send_oplock_break()
...
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:12 +02:00
Stefan Metzmacher
a6ff17f978
s3:smb2_create: pass smbXsrv_connection to *deferred*_smb2
...
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:12 +02:00
Stefan Metzmacher
56d454b4ae
s3:smbd: pass smbXsrv_connection to schedule_deferred_open_message_smb()
...
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:12 +02:00
Stefan Metzmacher
b05ae37da6
s3:smbd: pass smbXsrv_connection to remove_deferred_open_message_smb()
...
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:12 +02:00
Stefan Metzmacher
d8cffad8e0
s3:smbd: pass smbXsrv_connection to open_was_deferred()
...
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:12 +02:00
Stefan Metzmacher
333707fa37
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@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:12 +02:00
Michael Adam
1d615ee923
s3:smbd: use tevent_loop_wait() in the parent smbd process.
...
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2014-09-19 09:15:12 +02:00
Michael Adam
9afc37bef4
s3:smbd: use tevent_loop_wait() in the child process event loop
...
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2014-09-19 09:15:12 +02:00
Stefan Metzmacher
80e226ddae
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@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:12 +02:00
Stefan Metzmacher
d7e66e59b0
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@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:12 +02:00
Stefan Metzmacher
555b3d18d2
s3:smbd: use sconn->client->connections in keepalive_fn()
...
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:12 +02:00
Stefan Metzmacher
bf22882ed3
s3:smbd: use sconn->client->connections in reload_services()
...
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:12 +02:00
Stefan Metzmacher
7012008eb6
s3:smbd: remove now unused smbXsrv_connection->sconn
...
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:12 +02:00
Stefan Metzmacher
4a5ca44770
s3:smbXsrv_open: use xconn->client->sconn in smb1srv_open_table_init()
...
conn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:12 +02:00
Stefan Metzmacher
f9d65d4764
s3:smbXsrv_session: use xconn->client->sconn in smbXsrv_session_logoff()
...
conn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:12 +02:00
Stefan Metzmacher
e2af19a5d8
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@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:12 +02:00
Stefan Metzmacher
4bece82dd6
s3:smb2_server: use xconn->client->sconn in smbd_smb2_request_create()
...
xconn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:12 +02:00
Stefan Metzmacher
fe00c8e436
s3:smb2_server: use xconn->client->sconn in smbd_smb2_first_negprot()
...
xconn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:12 +02:00
Stefan Metzmacher
b970db154a
s3:smb2_server: use xconn->client->sconn in smbd_smb2_io_handler()
...
xconn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:12 +02:00
Stefan Metzmacher
f3fa664ea5
s3:smbd: use xconn->client->sconn in make_connection_snum()
...
xconn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:12 +02:00
Stefan Metzmacher
981fb261c9
s3:smbd: use xconn->client->sconn in smb1_parse_chain()
...
xconn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:11 +02:00
Stefan Metzmacher
d83ecf5b1d
s3:smbd: use xconn->client->sconn in construct_reply()
...
xconn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:11 +02:00
Stefan Metzmacher
fda21db351
s3:smbd: use xconn->client->sconn in reply_special()
...
xconn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:11 +02:00
Stefan Metzmacher
78951fb099
s3:smbd: use xconn->client->sconn in process_smb()
...
xconn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:11 +02:00
Stefan Metzmacher
e23785ae37
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@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:11 +02:00
Stefan Metzmacher
d27ae4a14a
s3:smbd: pass smbXsrv_connection to make_connection_snum()
...
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:11 +02:00
Stefan Metzmacher
2405415583
s3:smbd: pass smb_request to make_connection_smb1()
...
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:11 +02:00
Stefan Metzmacher
2dd215919d
s3:smbd: pass smbd_smb2_request to make_connection_smb2()
...
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:11 +02:00
Stefan Metzmacher
21eee0ea05
s3:smbd: pass smb_request to make_connection()
...
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:11 +02:00
Stefan Metzmacher
7408736d9d
s3:smbd: pass smbXsrv_connection to construct_reply*()
...
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:11 +02:00
Stefan Metzmacher
3a26bd1a3d
s3:smbd: pass smbXsrv_connection to smb1_parse_chain()
...
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:11 +02:00
Michael Adam
7c1553fe89
s3:smbd: support xconn=NULL in init_smb_request()
...
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2014-09-19 09:15:11 +02:00
Stefan Metzmacher
0b99a8ac45
s3:smbd: only pass smbXsrv_connection to fork_echo_handler()
...
We don't need smbd_server_connection there.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:11 +02:00
Stefan Metzmacher
92d2748303
s3:smbd: use req->sconn in reply.c where possible
...
xconn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:11 +02:00
Stefan Metzmacher
47f00fee35
s3:smbd: use req->sconn in sesssetup.c
...
xconn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:11 +02:00
Stefan Metzmacher
20bcbb09e1
s3:smbd: use req->sconn in reply_ntcancel()
...
xconn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:11 +02:00
Stefan Metzmacher
f25331499e
s3:smbd: use req->sconn in reply_negprot()
...
xconn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:11 +02:00
Stefan Metzmacher
4b9f17eca7
s3:smbd: pass smbXsrv_connection to srv_send_smb()
...
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:11 +02:00
Stefan Metzmacher
e3ab0a0569
s3:smbd: pass smbXsrv_connection to receive_smb*()
...
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:11 +02:00
Michael Adam
9fe6665968
s3:smbd: use smbXsrv_connection_dbg() in receive_smb_talloc()
...
instead of manually assembling the address string
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2014-09-19 09:15:11 +02:00
Michael Adam
93f7e6251b
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@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2014-09-19 09:15:11 +02:00
Stefan Metzmacher
7f649f9e22
s3:smb2_sesssetup: use smb2req->sconn in smbd_smb2_reauth_generic_return()
...
xconn->sconn will go away soon.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:11 +02:00
Stefan Metzmacher
7e006d1113
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@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:10 +02:00