1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

38 Commits

Author SHA1 Message Date
Volker Lendecke
9341c02a89 smbd: Prevent a crash
smb2srv_session_close_previous_check crashes if
ndr_pull_smbXsrv_session_globalB fails for some reason. It depends on "is_free"
to be correctly set. All we can do for an invalid database is to discard the
record and set it free.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Mar 11 00:12:18 CET 2016 on sn-devel-144
2016-03-11 00:12:18 +01:00
Michael Adam
aaddde12d9 smbXsrv_session: factor fetch-locking of local record into function
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-02-28 05:03:22 +01:00
Michael Adam
37eba9006e smbXsrv_session: factor fetch-locking of global record into function
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-02-28 05:03:22 +01:00
Michael Adam
476672b647 dlist: remove unneeded type argument from DLIST_ADD_END()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-02-06 21:48:17 +01:00
Stefan Metzmacher
b7eb725292 smbXsrv_session: factor smbXsrv_session_add_channel() out of smbXsrv_session_create()
This allows to create more than one channel.

Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Sep 10 21:33:47 CEST 2015 on sn-devel-104
2015-09-10 21:33:47 +02:00
Stefan Metzmacher
d391f6daea s3:smb2_sesssetup: use session->pending_auth
Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2015-07-30 21:58:14 +02:00
Stefan Metzmacher
2c39036806 smbXsrv_session: add smbXsrv_session_create_auth()
Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2015-07-30 21:58:14 +02:00
Stefan Metzmacher
e9885cfd0e smbXsrv_session: add smbXsrv_session_find_auth()
Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2015-07-30 21:58:14 +02:00
Michael Adam
a51ee19dc9 s3:smb2_sesssetup: remove now unneeded declaration of smb2srv_session_lookup_raw
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-07-30 16:22:12 +02:00
Michael Adam
19ec5f3474 smbXsrv: use smb2srv_session_lookup_client in smbXsrv_session_close_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>
2015-07-29 18:26:07 +02:00
Michael Adam
f6816ae5bd smbXsrv: add smb2srv_session_lookup_client().
This is a variant of smb2srv_session_lookup_conn() that does
not verify the session on the channel.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-07-29 18:26:07 +02:00
Michael Adam
d6acf950e4 smbXsrv: rename smb2srv_session_lookup -> smb2srv_session_lookup_conn
This is in preparation of adding a variant that operates
on the client and does in particular not verify that the
connection belongs to a session as a channel.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-07-29 18:26:07 +02:00
Michael Adam
c765d11347 smbXsrv: add a smbXsrv_connection argument to smb2srv_session_lookup_raw
This way, we can verify that the session is valid on a channel.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-07-29 18:26:07 +02:00
Stefan Metzmacher
66bf0e51bc smbXsrv: add a smbXsrv_connection argument to smbXsrv_session_local_lookup()
This way, we can verify that a session is valid on the channel.

Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2015-07-29 18:26:07 +02:00
Stefan Metzmacher
4481fea86a s3:smb2_sesssetup.c: For SMB >= 3.1, derive crypto keys from preauth
This protects the full connection setup including
a posteriori verification of the negotiate messages,
by signing the final session setup response with a signing key
derived from the preauth hash and the authentication session key.

Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2015-05-08 13:00:28 +02:00
Michael Adam
c7fcab7999 s3:smbXsrv: refactor duplicate code into smbXsrv_session_clear_and_logoff()
This replaces code in smbXsrv_session_logoff_all_callback()
and smbXsrv_session_clear_and_logoff().

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu May  7 10:43:29 CEST 2015 on sn-devel-104
2015-05-07 10:43:29 +02:00
Stefan Metzmacher
cc9d52e10f s3:smbXsrv_session: cancel pending requests when we logoff a previous session
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11182

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-06 22:33:19 +02:00
Stefan Metzmacher
4fceb4531c s3:smbXsrv_session: add smb2srv_session_shutdown_send/recv helper functions
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11182

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-06 22:33:19 +02:00
Stefan Metzmacher
b6c34a0776 s3:smbXsrv_session: clear smb2req->session of pending requests in smbXsrv_session_logoff_all_callback()
smbXsrv_session_logoff_all_callback() is called when the last transport
connection is gone, which means we won't need to sign any response...

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11182

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-06 22:33:19 +02:00
Stefan Metzmacher
7fea421105 s3:smbXsrv_session: clear smb2req->session of pending requests in smbXsrv_session_destructor()
This won't be needed typically needed as the caller is supposted to cancel
the requests already, but this makes sure we don't keep dangling pointers.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11182

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-06 22:33:19 +02:00
Volker Lendecke
06f4ba3217 lib: Remove server_id_str()
Call server_id_str_buf instead

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Apr 28 20:48:01 CEST 2015 on sn-devel-104
2015-04-28 20:48:01 +02:00
David Disseldorp
c5e241831c smbXsrv: don't leak lock_path onto talloc tos
Also check for allocation failures.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-03 23:46:05 +01:00
Stefan Metzmacher
6ed4eebe19 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@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:13 +02:00
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
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
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
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
4a07b14cea s3:smb2_server: pass smbXsrv_connection to smbd_server_connection_terminate*()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-08-06 09:51:13 +02:00
Michael Adam
cf0cb0add9 dbwrap: add a dbwrap_flags argument to db_open()
This is in preparation to support handing flags to backends,
in particular activating read only record support for ctdb
databases. For a start, this does nothing but adding the
parameter, and all databases use DBWRAP_FLAG_NONE.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-02-07 16:06:06 +01:00
Volker Lendecke
2779e78078 smbd: Use messaging_read_send in smbXsrv_session.c
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-01-21 08:11:05 +01:00
Gregor Beck
93e22bb1c4 s3:smbXsrv_session: pass record in smbXsrv_session_global_traverse()
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-19 12:10:21 +01:00
Gregor Beck
c3a658f595 s3:smbXsrv_session: add smbXsrv_session_global_traverse()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2012-10-19 12:15:00 +02:00
Stefan Metzmacher
9c36781580 s3:smbXsrv_session: pass max_sessions explicitly for smbXsrv_session_table_init()
metze
2012-06-26 12:17:33 +02:00
Stefan Metzmacher
299b63f875 s3:smbXsrv_session: react on MSG_SMBXSRV_SESSION_CLOSE
metze
2012-06-25 20:55:07 +02:00
Stefan Metzmacher
8acf6c90bd s3:smbXsrv_session: add smb2srv_session_close_previous_send/recv
metze
2012-06-25 20:55:07 +02:00
Stefan Metzmacher
1fffd35692 s3:smbXsrv_session: init and disconnect smbXsrv_tcon for SMB2/3
metze
2012-06-25 20:55:06 +02:00
Stefan Metzmacher
f3dce4cc95 sq smbXsrv_session_global_store no connection 2012-06-25 20:55:06 +02:00
Stefan Metzmacher
85f8c14f30 s3:smbd: add smbXsrv_session infrastructure
Pair-Programmed-With: Michael Adam <obnox@samba.org>

metze
2012-06-25 20:55:06 +02:00