summaryrefslogtreecommitdiff
path: root/source3/smbd/process.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-12-15 14:45:56 +0100
committerStefan Metzmacher <metze@samba.org>2012-05-12 01:01:34 +0200
commitb3235d483da924a41ca9cecf72e1c62bab7fedd5 (patch)
tree9d34739a9e01e7d9176613a71ce68727e1ecf79d /source3/smbd/process.c
parentc8a3c0e0f793c622e071953b25a70a3fd8a0da65 (diff)
downloadsamba-b3235d483da924a41ca9cecf72e1c62bab7fedd5.tar.gz
samba-b3235d483da924a41ca9cecf72e1c62bab7fedd5.tar.bz2
samba-b3235d483da924a41ca9cecf72e1c62bab7fedd5.zip
s3:smbd: introduce struct smbXsrv_connection
This will represent a transport connection for SMB 1 or 2 in the server. smbd_server_connection will slowly be moved to the SMB_VFS layer to satisfy the existing modules, but it will hopefully be protocol independend in future. metze
Diffstat (limited to 'source3/smbd/process.c')
-rw-r--r--source3/smbd/process.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 7b12315fc3..087326205c 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -3149,6 +3149,17 @@ static void smbd_id_cache_kill(struct messaging_context *msg_ctx,
id_cache_delete_from_cache(&id);
}
+NTSTATUS smbXsrv_connection_init_tables(struct smbXsrv_connection *conn,
+ enum protocol_types protocol)
+{
+ NTSTATUS status;
+
+ set_Protocol(protocol);
+ conn->protocol = protocol;
+
+ return NT_STATUS_OK;
+}
+
/****************************************************************************
Process commands from the client
****************************************************************************/
@@ -3167,6 +3178,12 @@ void smbd_process(struct tevent_context *ev_ctx,
char *rhost;
int ret;
+ sconn->conn = talloc_zero(sconn, struct smbXsrv_connection);
+ if (sconn->conn == NULL) {
+ DEBUG(0,("talloc_zero(struct smbXsrv_connection)\n"));
+ exit_server_cleanly("talloc_zero(struct smbXsrv_connection).\n");
+ }
+
if (lp_srv_maxprotocol() >= PROTOCOL_SMB2_02) {
/*
* We're not making the decision here,
@@ -3430,6 +3447,14 @@ void smbd_process(struct tevent_context *ev_ctx,
exit_server("failed to create smbd_server_connection fde");
}
+ sconn->conn->sconn = sconn;
+ sconn->conn->ev_ctx = sconn->ev_ctx;
+ sconn->conn->msg_ctx = sconn->msg_ctx;
+ sconn->conn->local_address = sconn->local_address;
+ sconn->conn->remote_address = sconn->remote_address;
+ sconn->conn->remote_hostname = sconn->remote_hostname;
+ sconn->conn->protocol = PROTOCOL_NONE;
+
TALLOC_FREE(frame);
while (True) {