From 9aa1d259070e93b3890933c932cbf6a2c84bc6fa Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 7 Aug 2009 15:21:07 +0200 Subject: s3:smbd: rename conn => sconn for smbd_server_connection structs This should avoid confusion between smbd_server_connection and connection_struct variables. metze --- source3/smbd/globals.h | 6 +-- source3/smbd/smb2_break.c | 8 +-- source3/smbd/smb2_create.c | 8 +-- source3/smbd/smb2_find.c | 8 +-- source3/smbd/smb2_flush.c | 8 +-- source3/smbd/smb2_getinfo.c | 8 +-- source3/smbd/smb2_ioctl.c | 10 ++-- source3/smbd/smb2_lock.c | 8 +-- source3/smbd/smb2_notify.c | 10 ++-- source3/smbd/smb2_read.c | 8 +-- source3/smbd/smb2_server.c | 112 +++++++++++++++++++++--------------------- source3/smbd/smb2_sesssetup.c | 24 ++++----- source3/smbd/smb2_setinfo.c | 8 +-- source3/smbd/smb2_tcon.c | 2 +- source3/smbd/smb2_write.c | 8 +-- 15 files changed, 118 insertions(+), 118 deletions(-) diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h index 338398968a..58c92de576 100644 --- a/source3/smbd/globals.h +++ b/source3/smbd/globals.h @@ -243,7 +243,7 @@ void smbd_server_connection_terminate_ex(struct smbd_server_connection *sconn, bool smbd_is_smb2_header(const uint8_t *inbuf, size_t size); void reply_smb2002(struct smb_request *req, uint16_t choice); -void smbd_smb2_first_negprot(struct smbd_server_connection *conn, +void smbd_smb2_first_negprot(struct smbd_server_connection *sconn, const uint8_t *inbuf, size_t size); NTSTATUS smbd_smb2_request_error_ex(struct smbd_smb2_request *req, @@ -296,7 +296,7 @@ struct smbd_smb2_request { TALLOC_CTX *mem_pool; struct smbd_smb2_request **parent; - struct smbd_server_connection *conn; + struct smbd_server_connection *sconn; /* the session the request operates on, maybe NULL */ struct smbd_smb2_session *session; @@ -361,7 +361,7 @@ struct smbd_server_connection; struct smbd_smb2_session { struct smbd_smb2_session *prev, *next; - struct smbd_server_connection *conn; + struct smbd_server_connection *sconn; NTSTATUS status; uint64_t vuid; AUTH_NTLMSSP_STATE *auth_ntlmssp_state; diff --git a/source3/smbd/smb2_break.c b/source3/smbd/smb2_break.c index ba02dad62f..29c55fccf6 100644 --- a/source3/smbd/smb2_break.c +++ b/source3/smbd/smb2_break.c @@ -68,7 +68,7 @@ NTSTATUS smbd_smb2_request_process_break(struct smbd_smb2_request *req) } subreq = smbd_smb2_oplock_break_send(req, - req->conn->smb2.event_ctx, + req->sconn->smb2.event_ctx, req, in_oplock_level, in_file_id_volatile); @@ -102,7 +102,7 @@ static void smbd_smb2_request_oplock_break_done(struct tevent_req *subreq) if (!NT_STATUS_IS_OK(status)) { error = smbd_smb2_request_error(req, status); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } @@ -118,7 +118,7 @@ static void smbd_smb2_request_oplock_break_done(struct tevent_req *subreq) if (outbody.data == NULL) { error = smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } @@ -137,7 +137,7 @@ static void smbd_smb2_request_oplock_break_done(struct tevent_req *subreq) error = smbd_smb2_request_done(req, outbody, NULL); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c index 5e744f98f4..e185434d31 100644 --- a/source3/smbd/smb2_create.c +++ b/source3/smbd/smb2_create.c @@ -111,7 +111,7 @@ NTSTATUS smbd_smb2_request_process_create(struct smbd_smb2_request *req) } subreq = smbd_smb2_create_send(req, - req->conn->smb2.event_ctx, + req->sconn->smb2.event_ctx, req, in_oplock_level, in_impersonation_level, @@ -169,7 +169,7 @@ static void smbd_smb2_request_create_done(struct tevent_req *subreq) if (!NT_STATUS_IS_OK(status)) { error = smbd_smb2_request_error(req, status); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } @@ -182,7 +182,7 @@ static void smbd_smb2_request_create_done(struct tevent_req *subreq) if (outbody.data == NULL) { error = smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } @@ -220,7 +220,7 @@ static void smbd_smb2_request_create_done(struct tevent_req *subreq) error = smbd_smb2_request_done(req, outbody, &outdyn); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } diff --git a/source3/smbd/smb2_find.c b/source3/smbd/smb2_find.c index 89ba54c7e1..59c0a67ceb 100644 --- a/source3/smbd/smb2_find.c +++ b/source3/smbd/smb2_find.c @@ -108,7 +108,7 @@ NTSTATUS smbd_smb2_request_process_find(struct smbd_smb2_request *req) } subreq = smbd_smb2_find_send(req, - req->conn->smb2.event_ctx, + req->sconn->smb2.event_ctx, req, in_file_info_class, in_flags, @@ -148,7 +148,7 @@ static void smbd_smb2_request_find_done(struct tevent_req *subreq) if (!NT_STATUS_IS_OK(status)) { error = smbd_smb2_request_error(req, status); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } @@ -163,7 +163,7 @@ static void smbd_smb2_request_find_done(struct tevent_req *subreq) if (outbody.data == NULL) { error = smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } @@ -180,7 +180,7 @@ static void smbd_smb2_request_find_done(struct tevent_req *subreq) error = smbd_smb2_request_done(req, outbody, &outdyn); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } diff --git a/source3/smbd/smb2_flush.c b/source3/smbd/smb2_flush.c index 1d3ae2eb06..e0538529cf 100644 --- a/source3/smbd/smb2_flush.c +++ b/source3/smbd/smb2_flush.c @@ -62,7 +62,7 @@ NTSTATUS smbd_smb2_request_process_flush(struct smbd_smb2_request *req) } subreq = smbd_smb2_flush_send(req, - req->conn->smb2.event_ctx, + req->sconn->smb2.event_ctx, req, in_file_id_volatile); if (subreq == NULL) { @@ -90,7 +90,7 @@ static void smbd_smb2_request_flush_done(struct tevent_req *subreq) if (!NT_STATUS_IS_OK(status)) { error = smbd_smb2_request_error(req, status); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } @@ -101,7 +101,7 @@ static void smbd_smb2_request_flush_done(struct tevent_req *subreq) if (outbody.data == NULL) { error = smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } @@ -113,7 +113,7 @@ static void smbd_smb2_request_flush_done(struct tevent_req *subreq) error = smbd_smb2_request_done(req, outbody, NULL); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } diff --git a/source3/smbd/smb2_getinfo.c b/source3/smbd/smb2_getinfo.c index b3cf892217..cd612d1085 100644 --- a/source3/smbd/smb2_getinfo.c +++ b/source3/smbd/smb2_getinfo.c @@ -100,7 +100,7 @@ NTSTATUS smbd_smb2_request_process_getinfo(struct smbd_smb2_request *req) } subreq = smbd_smb2_getinfo_send(req, - req->conn->smb2.event_ctx, + req->sconn->smb2.event_ctx, req, in_info_type, in_file_info_class, @@ -141,7 +141,7 @@ static void smbd_smb2_request_getinfo_done(struct tevent_req *subreq) if (!NT_STATUS_IS_OK(status)) { error = smbd_smb2_request_error(req, status); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } @@ -156,7 +156,7 @@ static void smbd_smb2_request_getinfo_done(struct tevent_req *subreq) if (outbody.data == NULL) { error = smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } @@ -173,7 +173,7 @@ static void smbd_smb2_request_getinfo_done(struct tevent_req *subreq) error = smbd_smb2_request_done(req, outbody, &outdyn); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } diff --git a/source3/smbd/smb2_ioctl.c b/source3/smbd/smb2_ioctl.c index e1e26f1c59..aa93ca38ce 100644 --- a/source3/smbd/smb2_ioctl.c +++ b/source3/smbd/smb2_ioctl.c @@ -93,7 +93,7 @@ NTSTATUS smbd_smb2_request_process_ioctl(struct smbd_smb2_request *req) } subreq = smbd_smb2_ioctl_send(req, - req->conn->smb2.event_ctx, + req->sconn->smb2.event_ctx, req, in_ctl_code, in_file_id_volatile, @@ -137,7 +137,7 @@ static void smbd_smb2_request_ioctl_done(struct tevent_req *subreq) } else if (!NT_STATUS_IS_OK(status)) { error = smbd_smb2_request_error(req, status); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } @@ -159,7 +159,7 @@ static void smbd_smb2_request_ioctl_done(struct tevent_req *subreq) if (outbody.data == NULL) { error = smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } @@ -194,7 +194,7 @@ static void smbd_smb2_request_ioctl_done(struct tevent_req *subreq) error = smbd_smb2_request_done_ex(req, status, outbody, &outdyn, __location__); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } @@ -410,7 +410,7 @@ static void smbd_smb2_ioctl_pipe_write_done(struct tevent_req *subreq) } subreq = np_read_send(state->smbreq->conn, - state->smb2req->conn->smb2.event_ctx, + state->smb2req->sconn->smb2.event_ctx, state->fsp->fake_file_handle, state->out_output.data, state->out_output.length); diff --git a/source3/smbd/smb2_lock.c b/source3/smbd/smb2_lock.c index 121b4eb24d..d515f18eda 100644 --- a/source3/smbd/smb2_lock.c +++ b/source3/smbd/smb2_lock.c @@ -113,7 +113,7 @@ NTSTATUS smbd_smb2_request_process_lock(struct smbd_smb2_request *req) } subreq = smbd_smb2_lock_send(req, - req->conn->smb2.event_ctx, + req->sconn->smb2.event_ctx, req, in_smbpid, in_file_id_volatile, @@ -144,7 +144,7 @@ static void smbd_smb2_request_lock_done(struct tevent_req *subreq) if (!NT_STATUS_IS_OK(status)) { error = smbd_smb2_request_error(req, status); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } @@ -155,7 +155,7 @@ static void smbd_smb2_request_lock_done(struct tevent_req *subreq) if (outbody.data == NULL) { error = smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } @@ -167,7 +167,7 @@ static void smbd_smb2_request_lock_done(struct tevent_req *subreq) error = smbd_smb2_request_done(req, outbody, NULL); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } diff --git a/source3/smbd/smb2_notify.c b/source3/smbd/smb2_notify.c index 4b9cbc495b..dbcdbac99a 100644 --- a/source3/smbd/smb2_notify.c +++ b/source3/smbd/smb2_notify.c @@ -81,7 +81,7 @@ NTSTATUS smbd_smb2_request_process_notify(struct smbd_smb2_request *req) } subreq = smbd_smb2_notify_send(req, - req->conn->smb2.event_ctx, + req->sconn->smb2.event_ctx, req, in_flags, in_output_buffer_length, @@ -119,7 +119,7 @@ static void smbd_smb2_request_notify_done(struct tevent_req *subreq) if (!NT_STATUS_IS_OK(status)) { error = smbd_smb2_request_error(req, status); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } @@ -134,7 +134,7 @@ static void smbd_smb2_request_notify_done(struct tevent_req *subreq) if (outbody.data == NULL) { error = smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } @@ -151,7 +151,7 @@ static void smbd_smb2_request_notify_done(struct tevent_req *subreq) error = smbd_smb2_request_done(req, outbody, &outdyn); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } @@ -332,7 +332,7 @@ static void smbd_smb2_notify_reply(struct smb_request *smbreq, * being arround after calling this function */ tevent_schedule_immediate(state->im, - state->smb2req->conn->smb2.event_ctx, + state->smb2req->sconn->smb2.event_ctx, smbd_smb2_notify_reply_trigger, req); } diff --git a/source3/smbd/smb2_read.c b/source3/smbd/smb2_read.c index c0521253d3..1756c15872 100644 --- a/source3/smbd/smb2_read.c +++ b/source3/smbd/smb2_read.c @@ -88,7 +88,7 @@ NTSTATUS smbd_smb2_request_process_read(struct smbd_smb2_request *req) } subreq = smbd_smb2_read_send(req, - req->conn->smb2.event_ctx, + req->sconn->smb2.event_ctx, req, in_smbpid, in_file_id_volatile, @@ -130,7 +130,7 @@ static void smbd_smb2_request_read_done(struct tevent_req *subreq) if (!NT_STATUS_IS_OK(status)) { error = smbd_smb2_request_error(req, status); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } @@ -145,7 +145,7 @@ static void smbd_smb2_request_read_done(struct tevent_req *subreq) if (outbody.data == NULL) { error = smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } @@ -166,7 +166,7 @@ static void smbd_smb2_request_read_done(struct tevent_req *subreq) error = smbd_smb2_request_done(req, outbody, &outdyn); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c index 2ae2ed29f7..85b3573eb0 100644 --- a/source3/smbd/smb2_server.c +++ b/source3/smbd/smb2_server.c @@ -36,34 +36,34 @@ bool smbd_is_smb2_header(const uint8_t *inbuf, size_t size) return true; } -static NTSTATUS smbd_initialize_smb2(struct smbd_server_connection *conn) +static NTSTATUS smbd_initialize_smb2(struct smbd_server_connection *sconn) { NTSTATUS status; int ret; - TALLOC_FREE(conn->smb1.fde); + TALLOC_FREE(sconn->smb1.fde); - conn->smb2.event_ctx = smbd_event_context(); + sconn->smb2.event_ctx = smbd_event_context(); - conn->smb2.recv_queue = tevent_queue_create(conn, "smb2 recv queue"); - if (conn->smb2.recv_queue == NULL) { + sconn->smb2.recv_queue = tevent_queue_create(sconn, "smb2 recv queue"); + if (sconn->smb2.recv_queue == NULL) { return NT_STATUS_NO_MEMORY; } - conn->smb2.send_queue = tevent_queue_create(conn, "smb2 send queue"); - if (conn->smb2.send_queue == NULL) { + sconn->smb2.send_queue = tevent_queue_create(sconn, "smb2 send queue"); + if (sconn->smb2.send_queue == NULL) { return NT_STATUS_NO_MEMORY; } - conn->smb2.sessions.idtree = idr_init(conn); - if (conn->smb2.sessions.idtree == NULL) { + sconn->smb2.sessions.idtree = idr_init(sconn); + if (sconn->smb2.sessions.idtree == NULL) { return NT_STATUS_NO_MEMORY; } - conn->smb2.sessions.limit = 0x0000FFFE; - conn->smb2.sessions.list = NULL; + sconn->smb2.sessions.limit = 0x0000FFFE; + sconn->smb2.sessions.list = NULL; - ret = tstream_bsd_existing_socket(conn, smbd_server_fd(), - &conn->smb2.stream); + ret = tstream_bsd_existing_socket(sconn, smbd_server_fd(), + &sconn->smb2.stream); if (ret == -1) { status = map_nt_error_from_unix(errno); return status; @@ -108,7 +108,7 @@ static int smbd_smb2_request_parent_destructor(struct smbd_smb2_request **req) static int smbd_smb2_request_destructor(struct smbd_smb2_request *req) { if (req->out.vector) { - DLIST_REMOVE(req->conn->smb2.requests, req); + DLIST_REMOVE(req->sconn->smb2.requests, req); } if (req->parent) { @@ -151,7 +151,7 @@ static struct smbd_smb2_request *smbd_smb2_request_allocate(TALLOC_CTX *mem_ctx) return req; } -static NTSTATUS smbd_smb2_request_create(struct smbd_server_connection *conn, +static NTSTATUS smbd_smb2_request_create(struct smbd_server_connection *sconn, const uint8_t *inbuf, size_t size, struct smbd_smb2_request **_req) { @@ -190,11 +190,11 @@ static NTSTATUS smbd_smb2_request_create(struct smbd_server_connection *conn, return NT_STATUS_INVALID_PARAMETER; } - req = smbd_smb2_request_allocate(conn); + req = smbd_smb2_request_allocate(sconn); if (req == NULL) { return NT_STATUS_NO_MEMORY; } - req->conn = conn; + req->sconn = sconn; talloc_steal(req, inbuf); @@ -398,7 +398,7 @@ static NTSTATUS smbd_smb2_request_setup_out(struct smbd_smb2_request *req) /* setup the length of the NBT packet */ smb2_setup_nbt_length(req->out.vector, req->out.vector_count); - DLIST_ADD_END(req->conn->smb2.requests, req, struct smbd_smb2_request *); + DLIST_ADD_END(req->sconn->smb2.requests, req, struct smbd_smb2_request *); return NT_STATUS_OK; } @@ -442,11 +442,11 @@ NTSTATUS smbd_smb2_request_pending_queue(struct smbd_smb2_request *req) SBVAL(outhdr, SMB2_HDR_PID, async_id); /* TODO: add a paramter to delay this */ - state = talloc(req->conn, struct smbd_smb2_request_pending_state); + state = talloc(req->sconn, struct smbd_smb2_request_pending_state); if (state == NULL) { return NT_STATUS_NO_MEMORY; } - state->sconn = req->conn; + state->sconn = req->sconn; state->vector.iov_base = (void *)state->buf; state->vector.iov_len = sizeof(state->buf); @@ -480,9 +480,9 @@ NTSTATUS smbd_smb2_request_pending_queue(struct smbd_smb2_request *req) SIVAL(body, 0x04, 0); subreq = tstream_writev_queue_send(state, - req->conn->smb2.event_ctx, - req->conn->smb2.stream, - req->conn->smb2.send_queue, + req->sconn->smb2.event_ctx, + req->sconn->smb2.stream, + req->sconn->smb2.send_queue, &state->vector, 1); if (subreq == NULL) { return NT_STATUS_NO_MEMORY; @@ -516,7 +516,7 @@ static void smbd_smb2_request_pending_writev_done(struct tevent_req *subreq) static NTSTATUS smbd_smb2_request_process_cancel(struct smbd_smb2_request *req) { - struct smbd_server_connection *sconn = req->conn; + struct smbd_server_connection *sconn = req->sconn; struct smbd_smb2_request *cur; const uint8_t *inhdr; int i = req->current_idx; @@ -812,7 +812,7 @@ static NTSTATUS smbd_smb2_request_reply(struct smbd_smb2_request *req) if (req->current_idx < req->out.vector_count) { struct timeval zero = timeval_zero(); subreq = tevent_wakeup_send(req, - req->conn->smb2.event_ctx, + req->sconn->smb2.event_ctx, zero); if (subreq == NULL) { return NT_STATUS_NO_MEMORY; @@ -825,9 +825,9 @@ static NTSTATUS smbd_smb2_request_reply(struct smbd_smb2_request *req) } subreq = tstream_writev_queue_send(req, - req->conn->smb2.event_ctx, - req->conn->smb2.stream, - req->conn->smb2.send_queue, + req->sconn->smb2.event_ctx, + req->sconn->smb2.stream, + req->sconn->smb2.send_queue, req->out.vector, req->out.vector_count); if (subreq == NULL) { @@ -842,7 +842,7 @@ static void smbd_smb2_request_dispatch_compound(struct tevent_req *subreq) { struct smbd_smb2_request *req = tevent_req_callback_data(subreq, struct smbd_smb2_request); - struct smbd_server_connection *conn = req->conn; + struct smbd_server_connection *sconn = req->sconn; NTSTATUS status; tevent_wakeup_recv(subreq); @@ -853,7 +853,7 @@ static void smbd_smb2_request_dispatch_compound(struct tevent_req *subreq) status = smbd_smb2_request_dispatch(req); if (!NT_STATUS_IS_OK(status)) { - smbd_server_connection_terminate(conn, nt_errstr(status)); + smbd_server_connection_terminate(sconn, nt_errstr(status)); return; } } @@ -862,7 +862,7 @@ static void smbd_smb2_request_writev_done(struct tevent_req *subreq) { struct smbd_smb2_request *req = tevent_req_callback_data(subreq, struct smbd_smb2_request); - struct smbd_server_connection *conn = req->conn; + struct smbd_server_connection *sconn = req->sconn; int ret; int sys_errno; @@ -871,7 +871,7 @@ static void smbd_smb2_request_writev_done(struct tevent_req *subreq) TALLOC_FREE(req); if (ret == -1) { NTSTATUS status = map_nt_error_from_unix(sys_errno); - smbd_server_connection_terminate(conn, nt_errstr(status)); + smbd_server_connection_terminate(sconn, nt_errstr(status)); return; } } @@ -1124,7 +1124,7 @@ static void smbd_smb2_request_read_done(struct tevent_req *subreq); static struct tevent_req *smbd_smb2_request_read_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, - struct smbd_server_connection *conn) + struct smbd_server_connection *sconn) { struct tevent_req *req; struct smbd_smb2_request_read_state *state; @@ -1142,10 +1142,10 @@ static struct tevent_req *smbd_smb2_request_read_send(TALLOC_CTX *mem_ctx, if (tevent_req_nomem(state->smb2_req, req)) { return tevent_req_post(req, ev); } - state->smb2_req->conn = conn; + state->smb2_req->sconn = sconn; - subreq = tstream_readv_pdu_queue_send(state, ev, conn->smb2.stream, - conn->smb2.recv_queue, + subreq = tstream_readv_pdu_queue_send(state, ev, sconn->smb2.stream, + sconn->smb2.recv_queue, smbd_smb2_request_next_vector, state); if (tevent_req_nomem(subreq, req)) { @@ -1475,7 +1475,7 @@ static NTSTATUS smbd_smb2_request_read_recv(struct tevent_req *req, static void smbd_smb2_request_incoming(struct tevent_req *subreq); -void smbd_smb2_first_negprot(struct smbd_server_connection *conn, +void smbd_smb2_first_negprot(struct smbd_server_connection *sconn, const uint8_t *inbuf, size_t size) { NTSTATUS status; @@ -1485,50 +1485,50 @@ void smbd_smb2_first_negprot(struct smbd_server_connection *conn, DEBUG(10,("smbd_smb2_first_negprot: packet length %u\n", (unsigned int)size)); - status = smbd_initialize_smb2(conn); + status = smbd_initialize_smb2(sconn); if (!NT_STATUS_IS_OK(status)) { - smbd_server_connection_terminate(conn, nt_errstr(status)); + smbd_server_connection_terminate(sconn, nt_errstr(status)); return; } - status = smbd_smb2_request_create(conn, inbuf, size, &req); + status = smbd_smb2_request_create(sconn, inbuf, size, &req); if (!NT_STATUS_IS_OK(status)) { - smbd_server_connection_terminate(conn, nt_errstr(status)); + smbd_server_connection_terminate(sconn, nt_errstr(status)); return; } status = smbd_smb2_request_setup_out(req); if (!NT_STATUS_IS_OK(status)) { - smbd_server_connection_terminate(conn, nt_errstr(status)); + smbd_server_connection_terminate(sconn, nt_errstr(status)); return; } status = smbd_smb2_request_dispatch(req); if (!NT_STATUS_IS_OK(status)) { - smbd_server_connection_terminate(conn, nt_errstr(status)); + smbd_server_connection_terminate(sconn, nt_errstr(status)); return; } /* ask for the next request */ - subreq = smbd_smb2_request_read_send(conn,conn->smb2.event_ctx, conn); + subreq = smbd_smb2_request_read_send(sconn, sconn->smb2.event_ctx, sconn); if (subreq == NULL) { - smbd_server_connection_terminate(conn, "no memory for reading"); + smbd_server_connection_terminate(sconn, "no memory for reading"); return; } - tevent_req_set_callback(subreq, smbd_smb2_request_incoming, conn); + tevent_req_set_callback(subreq, smbd_smb2_request_incoming, sconn); } static void smbd_smb2_request_incoming(struct tevent_req *subreq) { - struct smbd_server_connection *conn = tevent_req_callback_data(subreq, - struct smbd_server_connection); + struct smbd_server_connection *sconn = tevent_req_callback_data(subreq, + struct smbd_server_connection); NTSTATUS status; struct smbd_smb2_request *req = NULL; - status = smbd_smb2_request_read_recv(subreq, conn, &req); + status = smbd_smb2_request_read_recv(subreq, sconn, &req); TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - smbd_server_connection_terminate(conn, nt_errstr(status)); + smbd_server_connection_terminate(sconn, nt_errstr(status)); return; } @@ -1546,28 +1546,28 @@ static void smbd_smb2_request_incoming(struct tevent_req *subreq) status = smbd_smb2_request_validate(req); if (!NT_STATUS_IS_OK(status)) { - smbd_server_connection_terminate(conn, nt_errstr(status)); + smbd_server_connection_terminate(sconn, nt_errstr(status)); return; } status = smbd_smb2_request_setup_out(req); if (!NT_STATUS_IS_OK(status)) { - smbd_server_connection_terminate(conn, nt_errstr(status)); + smbd_server_connection_terminate(sconn, nt_errstr(status)); return; } status = smbd_smb2_request_dispatch(req); if (!NT_STATUS_IS_OK(status)) { - smbd_server_connection_terminate(conn, nt_errstr(status)); + smbd_server_connection_terminate(sconn, nt_errstr(status)); return; } next: /* ask for the next request (this constructs the main loop) */ - subreq = smbd_smb2_request_read_send(conn,conn->smb2.event_ctx, conn); + subreq = smbd_smb2_request_read_send(sconn, sconn->smb2.event_ctx, sconn); if (subreq == NULL) { - smbd_server_connection_terminate(conn, "no memory for reading"); + smbd_server_connection_terminate(sconn, "no memory for reading"); return; } - tevent_req_set_callback(subreq, smbd_smb2_request_incoming, conn); + tevent_req_set_callback(subreq, smbd_smb2_request_incoming, sconn); } diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c index b56f8bd5f6..eae26ed06c 100644 --- a/source3/smbd/smb2_sesssetup.c +++ b/source3/smbd/smb2_sesssetup.c @@ -120,7 +120,7 @@ NTSTATUS smbd_smb2_request_process_sesssetup(struct smbd_smb2_request *req) static int smbd_smb2_session_destructor(struct smbd_smb2_session *session) { - if (session->conn == NULL) { + if (session->sconn == NULL) { return 0; } @@ -129,12 +129,12 @@ static int smbd_smb2_session_destructor(struct smbd_smb2_session *session) talloc_free(session->tcons.list); } - idr_remove(session->conn->smb2.sessions.idtree, session->vuid); - DLIST_REMOVE(session->conn->smb2.sessions.list, session); + idr_remove(session->sconn->smb2.sessions.idtree, session->vuid); + DLIST_REMOVE(session->sconn->smb2.sessions.list, session); session->vuid = 0; session->status = NT_STATUS_USER_SESSION_DELETED; - session->conn = NULL; + session->sconn = NULL; return 0; } @@ -157,14 +157,14 @@ static NTSTATUS smbd_smb2_session_setup(struct smbd_smb2_request *req, int id; /* create a new session */ - session = talloc_zero(req->conn, struct smbd_smb2_session); + session = talloc_zero(req->sconn, struct smbd_smb2_session); if (session == NULL) { return NT_STATUS_NO_MEMORY; } session->status = NT_STATUS_MORE_PROCESSING_REQUIRED; - id = idr_get_new_random(req->conn->smb2.sessions.idtree, + id = idr_get_new_random(req->sconn->smb2.sessions.idtree, session, - req->conn->smb2.sessions.limit); + req->sconn->smb2.sessions.limit); if (id == -1) { return NT_STATUS_INSUFFICIENT_RESOURCES; } @@ -177,15 +177,15 @@ static NTSTATUS smbd_smb2_session_setup(struct smbd_smb2_request *req, session->tcons.limit = 0x0000FFFE; session->tcons.list = NULL; - DLIST_ADD_END(req->conn->smb2.sessions.list, session, + DLIST_ADD_END(req->sconn->smb2.sessions.list, session, struct smbd_smb2_session *); - session->conn = req->conn; + session->sconn = req->sconn; talloc_set_destructor(session, smbd_smb2_session_destructor); } else { void *p; /* lookup an existing session */ - p = idr_find(req->conn->smb2.sessions.idtree, in_session_id); + p = idr_find(req->sconn->smb2.sessions.idtree, in_session_id); if (p == NULL) { return NT_STATUS_USER_SESSION_DELETED; } @@ -315,7 +315,7 @@ static NTSTATUS smbd_smb2_session_setup(struct smbd_smb2_request *req, session->compat_vuser->server_info = session->server_info; session->compat_vuser->session_keystr = NULL; session->compat_vuser->vuid = session->vuid; - DLIST_ADD(session->conn->smb1.sessions.validated_users, session->compat_vuser); + DLIST_ADD(session->sconn->smb1.sessions.validated_users, session->compat_vuser); session->status = NT_STATUS_OK; @@ -345,7 +345,7 @@ NTSTATUS smbd_smb2_request_check_session(struct smbd_smb2_request *req) in_session_id = BVAL(inhdr, SMB2_HDR_SESSION_ID); /* lookup an existing session */ - p = idr_find(req->conn->smb2.sessions.idtree, in_session_id); + p = idr_find(req->sconn->smb2.sessions.idtree, in_session_id); if (p == NULL) { return NT_STATUS_USER_SESSION_DELETED; } diff --git a/source3/smbd/smb2_setinfo.c b/source3/smbd/smb2_setinfo.c index 08c4a7f5bf..996b190ffd 100644 --- a/source3/smbd/smb2_setinfo.c +++ b/source3/smbd/smb2_setinfo.c @@ -92,7 +92,7 @@ NTSTATUS smbd_smb2_request_process_setinfo(struct smbd_smb2_request *req) } subreq = smbd_smb2_setinfo_send(req, - req->conn->smb2.event_ctx, + req->sconn->smb2.event_ctx, req, in_info_type, in_file_info_class, @@ -124,7 +124,7 @@ static void smbd_smb2_request_setinfo_done(struct tevent_req *subreq) if (!NT_STATUS_IS_OK(status)) { error = smbd_smb2_request_error(req, status); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } @@ -135,7 +135,7 @@ static void smbd_smb2_request_setinfo_done(struct tevent_req *subreq) if (outbody.data == NULL) { error = smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } @@ -146,7 +146,7 @@ static void smbd_smb2_request_setinfo_done(struct tevent_req *subreq) error = smbd_smb2_request_done(req, outbody, NULL); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } diff --git a/source3/smbd/smb2_tcon.c b/source3/smbd/smb2_tcon.c index 090f9b7908..5137f5c270 100644 --- a/source3/smbd/smb2_tcon.c +++ b/source3/smbd/smb2_tcon.c @@ -194,7 +194,7 @@ static NTSTATUS smbd_smb2_tree_connect(struct smbd_smb2_request *req, tcon->session = req->session; talloc_set_destructor(tcon, smbd_smb2_tcon_destructor); - tcon->compat_conn = make_connection_snum(req->conn, + tcon->compat_conn = make_connection_snum(req->sconn, snum, req->session->compat_vuser, data_blob_null, "???", &status); diff --git a/source3/smbd/smb2_write.c b/source3/smbd/smb2_write.c index 9f26f333c1..2151d22e9f 100644 --- a/source3/smbd/smb2_write.c +++ b/source3/smbd/smb2_write.c @@ -97,7 +97,7 @@ NTSTATUS smbd_smb2_request_process_write(struct smbd_smb2_request *req) } subreq = smbd_smb2_write_send(req, - req->conn->smb2.event_ctx, + req->sconn->smb2.event_ctx, req, in_smbpid, in_file_id_volatile, @@ -133,7 +133,7 @@ static void smbd_smb2_request_write_done(struct tevent_req *subreq) if (!NT_STATUS_IS_OK(status)) { error = smbd_smb2_request_error(req, status); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } @@ -146,7 +146,7 @@ static void smbd_smb2_request_write_done(struct tevent_req *subreq) if (outbody.data == NULL) { error = smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } @@ -164,7 +164,7 @@ static void smbd_smb2_request_write_done(struct tevent_req *subreq) error = smbd_smb2_request_done(req, outbody, &outdyn); if (!NT_STATUS_IS_OK(error)) { - smbd_server_connection_terminate(req->conn, nt_errstr(error)); + smbd_server_connection_terminate(req->sconn, nt_errstr(error)); return; } } -- cgit