1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s3:smb2_*: make use of smb2req->xconn where possible

We need to use the connection that is used by the current request.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
Stefan Metzmacher 2014-06-12 08:38:48 +02:00 committed by Michael Adam
parent b7eeb658e7
commit c9e171ff72
11 changed files with 18 additions and 18 deletions

View File

@ -820,7 +820,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
DATA_BLOB new_cookie = data_blob_null;
NTTIME now = timeval_to_nttime(&smb2req->request_time);
status = smb2srv_open_recreate(smb2req->sconn->conn,
status = smb2srv_open_recreate(smb2req->xconn,
smb1req->conn->session_info,
persistent_id, create_guid,
now, &op);

View File

@ -207,7 +207,7 @@ static struct tevent_req *smbd_smb2_find_send(TALLOC_CTX *mem_ctx,
uint32_t in_output_buffer_length,
const char *in_file_name)
{
struct smbXsrv_connection *xconn = smb2req->sconn->conn;
struct smbXsrv_connection *xconn = smb2req->xconn;
struct tevent_req *req;
struct smbd_smb2_find_state *state;
struct smb_request *smbreq;

View File

@ -44,7 +44,7 @@ static NTSTATUS smbd_smb2_getinfo_recv(struct tevent_req *req,
static void smbd_smb2_request_getinfo_done(struct tevent_req *subreq);
NTSTATUS smbd_smb2_request_process_getinfo(struct smbd_smb2_request *req)
{
struct smbXsrv_connection *xconn = req->sconn->conn;
struct smbXsrv_connection *xconn = req->xconn;
NTSTATUS status;
const uint8_t *inbody;
uint8_t in_info_type;

View File

@ -506,7 +506,7 @@ struct tevent_req *smb2_ioctl_network_fs(uint32_t ctl_code,
break;
case FSCTL_VALIDATE_NEGOTIATE_INFO:
status = fsctl_validate_neg_info(state, ev,
state->smbreq->sconn->conn,
state->smbreq->xconn,
&state->in_input,
state->in_max_output,
&state->out_output,

View File

@ -78,7 +78,7 @@ void reply_smb2002(struct smb_request *req, uint16_t choice)
*/
void reply_smb20ff(struct smb_request *req, uint16_t choice)
{
struct smbXsrv_connection *xconn = req->sconn->conn;
struct smbXsrv_connection *xconn = req->xconn;
xconn->smb2.allow_2ff = true;
reply_smb20xx(req, SMB2_DIALECT_REVISION_2FF);
}
@ -170,7 +170,7 @@ enum protocol_types smbd_smb2_protocol_dialect_match(const uint8_t *indyn,
NTSTATUS smbd_smb2_request_process_negprot(struct smbd_smb2_request *req)
{
struct smbXsrv_connection *xconn = req->sconn->conn;
struct smbXsrv_connection *xconn = req->xconn;
NTSTATUS status;
const uint8_t *inbody;
const uint8_t *indyn = NULL;

View File

@ -48,7 +48,7 @@ static NTSTATUS smbd_smb2_notify_recv(struct tevent_req *req,
static void smbd_smb2_request_notify_done(struct tevent_req *subreq);
NTSTATUS smbd_smb2_request_process_notify(struct smbd_smb2_request *req)
{
struct smbXsrv_connection *xconn = req->sconn->conn;
struct smbXsrv_connection *xconn = req->xconn;
NTSTATUS status;
const uint8_t *inbody;
uint16_t in_flags;

View File

@ -43,7 +43,7 @@ static NTSTATUS smbd_smb2_read_recv(struct tevent_req *req,
static void smbd_smb2_request_read_done(struct tevent_req *subreq);
NTSTATUS smbd_smb2_request_process_read(struct smbd_smb2_request *req)
{
struct smbXsrv_connection *xconn = req->sconn->conn;
struct smbXsrv_connection *xconn = req->xconn;
NTSTATUS status;
const uint8_t *inbody;
uint32_t in_length;
@ -186,7 +186,7 @@ static int smb2_sendfile_send_data(struct smbd_smb2_read_state *state)
uint64_t in_offset = state->in_offset;
files_struct *fsp = state->fsp;
const DATA_BLOB *hdr = state->smb2req->queue_entry.sendfile_header;
struct smbXsrv_connection *xconn = state->smb2req->sconn->conn;
struct smbXsrv_connection *xconn = state->smb2req->xconn;
ssize_t nread;
ssize_t ret;
int saved_errno;

View File

@ -479,7 +479,7 @@ static int smbd_smb2_session_setup_state_destructor(struct smbd_smb2_session_set
* Ensure that any outstanding requests don't also refer
* to it.
*/
xconn = state->smb2req->sconn->conn;
xconn = state->smb2req->xconn;
for (preq = xconn->smb2.requests; preq != NULL; preq = preq->next) {
if (preq == state->smb2req) {
@ -549,7 +549,7 @@ static struct tevent_req *smbd_smb2_session_setup_send(TALLOC_CTX *mem_ctx,
state->in_security_buffer = in_security_buffer;
if (in_flags & SMB2_SESSION_FLAG_BINDING) {
if (smb2req->sconn->conn->protocol < PROTOCOL_SMB2_22) {
if (smb2req->xconn->protocol < PROTOCOL_SMB2_22) {
tevent_req_nterror(req, NT_STATUS_REQUEST_NOT_ACCEPTED);
return tevent_req_post(req, ev);
}
@ -565,13 +565,13 @@ static struct tevent_req *smbd_smb2_session_setup_send(TALLOC_CTX *mem_ctx,
if (state->in_session_id == 0) {
/* create a new session */
status = smbXsrv_session_create(state->smb2req->sconn->conn,
status = smbXsrv_session_create(state->smb2req->xconn,
now, &state->session);
if (tevent_req_nterror(req, status)) {
return tevent_req_post(req, ev);
}
} else {
status = smb2srv_session_lookup(state->smb2req->sconn->conn,
status = smb2srv_session_lookup(state->smb2req->xconn,
state->in_session_id, now,
&state->session);
if (NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_SESSION_EXPIRED)) {
@ -877,7 +877,7 @@ static struct tevent_req *smbd_smb2_logoff_send(TALLOC_CTX *mem_ctx,
struct smbd_smb2_logout_state *state;
struct tevent_req *subreq;
struct smbd_smb2_request *preq;
struct smbXsrv_connection *xconn = smb2req->sconn->conn;
struct smbXsrv_connection *xconn = smb2req->xconn;
req = tevent_req_create(mem_ctx, &state,
struct smbd_smb2_logout_state);

View File

@ -39,7 +39,7 @@ static NTSTATUS smbd_smb2_setinfo_recv(struct tevent_req *req);
static void smbd_smb2_request_setinfo_done(struct tevent_req *subreq);
NTSTATUS smbd_smb2_request_process_setinfo(struct smbd_smb2_request *req)
{
struct smbXsrv_connection *xconn = req->sconn->conn;
struct smbXsrv_connection *xconn = req->xconn;
NTSTATUS status;
const uint8_t *inbody;
uint8_t in_info_type;

View File

@ -175,7 +175,7 @@ static NTSTATUS smbd_smb2_tree_connect(struct smbd_smb2_request *req,
uint32_t *out_maximal_access,
uint32_t *out_tree_id)
{
struct smbXsrv_connection *conn = req->sconn->conn;
struct smbXsrv_connection *conn = req->xconn;
const char *share = in_path;
char *service = NULL;
int snum = -1;
@ -498,7 +498,7 @@ static struct tevent_req *smbd_smb2_tdis_send(TALLOC_CTX *mem_ctx,
struct smbd_smb2_tdis_state *state;
struct tevent_req *subreq;
struct smbd_smb2_request *preq;
struct smbXsrv_connection *xconn = smb2req->sconn->conn;
struct smbXsrv_connection *xconn = smb2req->xconn;
req = tevent_req_create(mem_ctx, &state,
struct smbd_smb2_tdis_state);

View File

@ -38,7 +38,7 @@ static NTSTATUS smbd_smb2_write_recv(struct tevent_req *req,
static void smbd_smb2_request_write_done(struct tevent_req *subreq);
NTSTATUS smbd_smb2_request_process_write(struct smbd_smb2_request *req)
{
struct smbXsrv_connection *xconn = req->sconn->conn;
struct smbXsrv_connection *xconn = req->xconn;
NTSTATUS status;
const uint8_t *inbody;
uint16_t in_data_offset;