From 502fdae7f134bda53e6c95e3a336e7b2fcda77f2 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 2 Aug 2011 16:58:46 +0200 Subject: s3: Pass sconn explicitly to schedule_deferred_open_message_smb --- source3/smbd/close.c | 7 ++++++- source3/smbd/oplock.c | 12 ++++++++++-- source3/smbd/process.c | 7 ++++--- source3/smbd/proto.h | 3 ++- 4 files changed, 22 insertions(+), 7 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/close.c b/source3/smbd/close.c index b31daf366f..a1b6fd8f25 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -176,13 +176,18 @@ static void notify_deferred_opens(struct messaging_context *msg_ctx, } if (procid_is_me(&e->pid)) { + struct smbd_server_connection *sconn; /* * We need to notify ourself to retry the open. Do * this by finding the queued SMB record, moving it to * the head of the queue and changing the wait time to * zero. */ - schedule_deferred_open_message_smb(e->op_mid); + sconn = msg_ctx_to_sconn(msg_ctx); + if (sconn != NULL) { + schedule_deferred_open_message_smb( + sconn, e->op_mid); + } } else { char msg[MSG_SMB_SHARE_MODE_ENTRY_SIZE]; diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index 69a4dbb6c6..bba2e356f5 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -688,6 +688,7 @@ static void process_oplock_break_response(struct messaging_context *msg_ctx, DATA_BLOB *data) { struct share_mode_entry msg; + struct smbd_server_connection *sconn; if (data->data == NULL) { DEBUG(0, ("Got NULL buffer\n")); @@ -707,7 +708,10 @@ static void process_oplock_break_response(struct messaging_context *msg_ctx, server_id_str(talloc_tos(), &src), file_id_string_tos(&msg.id), msg.share_file_id, (unsigned long long)msg.op_mid)); - schedule_deferred_open_message_smb(msg.op_mid); + sconn = msg_ctx_to_sconn(msg_ctx); + if (sconn != NULL) { + schedule_deferred_open_message_smb(sconn, msg.op_mid); + } } static void process_open_retry_message(struct messaging_context *msg_ctx, @@ -717,6 +721,7 @@ static void process_open_retry_message(struct messaging_context *msg_ctx, DATA_BLOB *data) { struct share_mode_entry msg; + struct smbd_server_connection *sconn; if (data->data == NULL) { DEBUG(0, ("Got NULL buffer\n")); @@ -735,7 +740,10 @@ static void process_open_retry_message(struct messaging_context *msg_ctx, server_id_str(talloc_tos(), &src), file_id_string_tos(&msg.id), (unsigned long long)msg.op_mid)); - schedule_deferred_open_message_smb(msg.op_mid); + sconn = msg_ctx_to_sconn(msg_ctx); + if (sconn != NULL) { + schedule_deferred_open_message_smb(sconn, msg.op_mid); + } } /**************************************************************************** diff --git a/source3/smbd/process.c b/source3/smbd/process.c index a2678e5e0c..bb0b85a20e 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -680,13 +680,14 @@ void remove_deferred_open_message_smb(struct smbd_server_connection *sconn, schedule it for immediate processing. ****************************************************************************/ -void schedule_deferred_open_message_smb(uint64_t mid) +void schedule_deferred_open_message_smb(struct smbd_server_connection *sconn, + uint64_t mid) { struct pending_message_list *pml; int i = 0; - if (smbd_server_conn->using_smb2) { - schedule_deferred_open_message_smb2(smbd_server_conn, mid); + if (sconn->using_smb2) { + schedule_deferred_open_message_smb2(sconn, mid); return; } diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index c12d92b901..5eced3df9b 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -773,7 +773,8 @@ int srv_set_message(char *buf, bool zero); void remove_deferred_open_message_smb(struct smbd_server_connection *sconn, uint64_t mid); -void schedule_deferred_open_message_smb(uint64_t mid); +void schedule_deferred_open_message_smb(struct smbd_server_connection *sconn, + uint64_t mid); bool open_was_deferred(uint64_t mid); bool get_deferred_open_message_state(struct smb_request *smbreq, struct timeval *p_request_time, -- cgit