diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-12-13 13:18:47 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-12-13 20:31:09 +0100 |
commit | 90674f0fce81f3fea1d15a9c2588427dd5e4cd9c (patch) | |
tree | 221f5244715f3ae2c9e1570a99b8ec6f7a5ea452 | |
parent | 7fee41cd39afff925ce9af7793736e2444572b58 (diff) | |
download | samba-90674f0fce81f3fea1d15a9c2588427dd5e4cd9c.tar.gz samba-90674f0fce81f3fea1d15a9c2588427dd5e4cd9c.tar.bz2 samba-90674f0fce81f3fea1d15a9c2588427dd5e4cd9c.zip |
s3:smbd/oplock: pass sconn as private_data to process_kernel_oplock_break()
metze
-rw-r--r-- | source3/smbd/oplock.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index b23df3fdfa..067681e0f9 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -594,10 +594,16 @@ static void process_kernel_oplock_break(struct messaging_context *msg_ctx, struct server_id src, DATA_BLOB *data) { - struct smbd_server_connection *sconn; struct file_id id; unsigned long file_id; files_struct *fsp; + struct smbd_server_connection *sconn = + talloc_get_type(private_data, + struct smbd_server_connection); + + if (sconn == NULL) { + return; + } if (data->data == NULL) { DEBUG(0, ("Got NULL buffer\n")); @@ -609,12 +615,6 @@ static void process_kernel_oplock_break(struct messaging_context *msg_ctx, return; } - sconn = msg_ctx_to_sconn(msg_ctx); - if (sconn == NULL) { - DEBUG(1, ("could not find sconn\n")); - return; - } - /* Pull the data from the message. */ pull_file_id_24((char *)data->data, &id); file_id = (unsigned long)IVAL(data->data, 24); @@ -943,7 +943,7 @@ bool init_oplocks(struct smbd_server_connection *sconn) process_oplock_async_level2_break_message); messaging_register(sconn->msg_ctx, sconn, MSG_SMB_BREAK_RESPONSE, process_oplock_break_response); - messaging_register(sconn->msg_ctx, NULL, MSG_SMB_KERNEL_BREAK, + messaging_register(sconn->msg_ctx, sconn, MSG_SMB_KERNEL_BREAK, process_kernel_oplock_break); messaging_register(sconn->msg_ctx, NULL, MSG_SMB_OPEN_RETRY, process_open_retry_message); |