summaryrefslogtreecommitdiff
path: root/source3/smbd/process.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-03-28 16:14:09 +0200
committerStefan Metzmacher <metze@samba.org>2012-06-25 20:55:06 +0200
commitfaa8edccef556fb281d24b76b9739c994128f6ef (patch)
tree451ed88a7e676adc61fafd51c75637855507de78 /source3/smbd/process.c
parent463b308f16733b5a0bd896c46347d39064cee170 (diff)
downloadsamba-faa8edccef556fb281d24b76b9739c994128f6ef.tar.gz
samba-faa8edccef556fb281d24b76b9739c994128f6ef.tar.bz2
samba-faa8edccef556fb281d24b76b9739c994128f6ef.zip
s3:smbd: make use of smbXsrv_tcon for smb1
Pair-Programmed-With: Michael Adam <obnox@samba.org> metze
Diffstat (limited to 'source3/smbd/process.c')
-rw-r--r--source3/smbd/process.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index e25fbc77c1..311ef9dd2d 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -516,6 +516,9 @@ static bool init_smb_request(struct smb_request *req,
size_t unread_bytes, bool encrypted,
uint32_t seqnum)
{
+ struct smbXsrv_tcon *tcon;
+ NTSTATUS status;
+ NTTIME now;
size_t req_size = smb_len(inbuf) + 4;
/* Ensure we have at least smb_size bytes. */
@@ -526,6 +529,7 @@ static bool init_smb_request(struct smb_request *req,
}
req->request_time = timeval_current();
+ now = timeval_to_nttime(&req->request_time);
req->cmd = CVAL(inbuf, smb_com);
req->flags2 = SVAL(inbuf, smb_flg2);
@@ -541,7 +545,12 @@ static bool init_smb_request(struct smb_request *req,
req->unread_bytes = unread_bytes;
req->encrypted = encrypted;
req->sconn = sconn;
- req->conn = conn_find(sconn,req->tid);
+ status = smb1srv_tcon_lookup(sconn->conn, req->tid, now, &tcon);
+ if (NT_STATUS_IS_OK(status)) {
+ req->conn = tcon->compat;
+ } else {
+ req->conn = NULL;
+ }
req->chain_fsp = NULL;
req->smb2req = NULL;
req->priv_paths = NULL;
@@ -1643,10 +1652,18 @@ void smb_request_done(struct smb_request *req)
while ((next_index < num_reqs) && (IVAL(req->outbuf, smb_rcls) == 0)) {
struct smb_request *next = reqs[next_index];
+ struct smbXsrv_tcon *tcon;
+ NTTIME now = timeval_to_nttime(&req->request_time);
next->vuid = SVAL(req->outbuf, smb_uid);
next->tid = SVAL(req->outbuf, smb_tid);
- next->conn = conn_find(req->sconn, req->tid);
+ status = smb1srv_tcon_lookup(req->sconn->conn, req->tid,
+ now, &tcon);
+ if (NT_STATUS_IS_OK(status)) {
+ req->conn = tcon->compat;
+ } else {
+ req->conn = NULL;
+ }
next->chain_fsp = req->chain_fsp;
next->inbuf = (uint8_t *)req->inbuf;
@@ -3167,6 +3184,11 @@ NTSTATUS smbXsrv_connection_init_tables(struct smbXsrv_connection *conn,
if (!NT_STATUS_IS_OK(status)) {
return status;
}
+ } else {
+ status = smb1srv_tcon_table_init(conn);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
}
return NT_STATUS_OK;
@@ -3509,7 +3531,6 @@ void smbd_process(struct tevent_context *ev_ctx,
/* this holds info on user ids that are already validated for this VC */
sconn->smb1.sessions.next_vuid = VUID_OFFSET;
- conn_init(sconn);
if (!init_dptrs(sconn)) {
exit_server("init_dptrs() failed");
}