s3:smb2_lock: pass smbd_server_connection as private_data to received_unlock_msg()
authorStefan Metzmacher <metze@samba.org>
Mon, 12 Dec 2011 14:45:07 +0000 (15:45 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 12 Dec 2011 19:14:41 +0000 (20:14 +0100)
metze

source3/smbd/smb2_lock.c

index 8f4df3d25ab851f63254c632cedbb81e8adcc9d8..57bcbe6806eeddef73a84c42806913e984bc1f79 100644 (file)
@@ -450,15 +450,16 @@ static void received_unlock_msg(struct messaging_context *msg,
                                struct server_id server_id,
                                DATA_BLOB *data)
 {
-       struct smbd_server_connection *sconn;
+       struct smbd_server_connection *sconn =
+               talloc_get_type(private_data,
+               struct smbd_server_connection);
 
-       DEBUG(10,("received_unlock_msg (SMB2)\n"));
-
-       sconn = msg_ctx_to_sconn(msg);
        if (sconn == NULL) {
-               DEBUG(1, ("could not find sconn\n"));
                return;
        }
+
+       DEBUG(10,("received_unlock_msg (SMB2)\n"));
+
        process_blocking_lock_queue_smb2(sconn, timeval_current());
 }
 
@@ -665,7 +666,7 @@ bool push_blocking_lock_request_smb2( struct byte_range_lock *br_lck,
 
        /* Ensure we'll receive messages when this is unlocked. */
        if (!sconn->smb2.locks.blocking_lock_unlock_state) {
-               messaging_register(sconn->msg_ctx, NULL,
+               messaging_register(sconn->msg_ctx, sconn,
                                MSG_SMB_UNLOCK, received_unlock_msg);
                sconn->smb2.locks.blocking_lock_unlock_state = true;
         }