summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/oplock.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index 3f809b0812..8a43ea00bc 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -479,7 +479,7 @@ static void process_oplock_break_message(struct messaging_context *msg_ctx,
struct server_id src,
DATA_BLOB *data)
{
- struct smbd_server_connection *sconn = smbd_server_conn;
+ struct smbd_server_connection *sconn;
struct share_mode_entry msg;
files_struct *fsp;
bool break_to_level2 = False;
@@ -489,6 +489,12 @@ static void process_oplock_break_message(struct messaging_context *msg_ctx,
return;
}
+ sconn = msg_ctx_to_sconn(msg_ctx);
+ if (sconn == NULL) {
+ DEBUG(1, ("could not find sconn\n"));
+ return;
+ }
+
if (data->length != MSG_SMB_SHARE_MODE_ENTRY_SIZE) {
DEBUG(0, ("Got invalid msg len %d\n", (int)data->length));
return;
@@ -501,8 +507,7 @@ static void process_oplock_break_message(struct messaging_context *msg_ctx,
procid_str(talloc_tos(), &src), file_id_string_tos(&msg.id),
msg.share_file_id));
- fsp = initial_break_processing(smbd_server_conn, msg.id,
- msg.share_file_id);
+ fsp = initial_break_processing(sconn, msg.id, msg.share_file_id);
if (fsp == NULL) {
/* We hit a race here. Break messages are sent, and before we