summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-12-13 08:11:58 +0100
committerStefan Metzmacher <metze@samba.org>2011-12-13 12:36:34 +0100
commitf426eb13c9988d05b948749f379df62c3d5bd0a7 (patch)
treeca5004ae34846dee45df16c9acd2823cb1c94b83
parentfbcdaa6a45f1234e2230acee4cf9d4cc2d41c6e8 (diff)
downloadsamba-f426eb13c9988d05b948749f379df62c3d5bd0a7.tar.gz
samba-f426eb13c9988d05b948749f379df62c3d5bd0a7.tar.bz2
samba-f426eb13c9988d05b948749f379df62c3d5bd0a7.zip
s3:smbd/blocking: pass smbd_server_connection as private_data to process_blocking_lock_cancel_message()
metze
-rw-r--r--source3/smbd/blocking.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source3/smbd/blocking.c b/source3/smbd/blocking.c
index 5520feca5f..ad1bbe3a91 100644
--- a/source3/smbd/blocking.c
+++ b/source3/smbd/blocking.c
@@ -828,10 +828,16 @@ static void process_blocking_lock_cancel_message(struct messaging_context *ctx,
struct server_id server_id,
DATA_BLOB *data)
{
- struct smbd_server_connection *sconn;
NTSTATUS err;
const char *msg = (const char *)data->data;
struct blocking_lock_record *blr;
+ struct smbd_server_connection *sconn =
+ talloc_get_type(private_data,
+ struct smbd_server_connection);
+
+ if (sconn == NULL) {
+ return;
+ }
if (data->data == NULL) {
smb_panic("process_blocking_lock_cancel_message: null msg");
@@ -843,12 +849,6 @@ static void process_blocking_lock_cancel_message(struct messaging_context *ctx,
smb_panic("process_blocking_lock_cancel_message: bad msg");
}
- sconn = msg_ctx_to_sconn(ctx);
- if (sconn == NULL) {
- DEBUG(1, ("could not find sconn\n"));
- return;
- }
-
memcpy(&blr, msg, sizeof(blr));
memcpy(&err, &msg[sizeof(blr)], sizeof(NTSTATUS));
@@ -880,7 +880,7 @@ struct blocking_lock_record *blocking_lock_cancel_smb1(files_struct *fsp,
if (!sconn->smb1.locks.blocking_lock_cancel_state) {
/* Register our message. */
- messaging_register(sconn->msg_ctx, NULL,
+ messaging_register(sconn->msg_ctx, sconn,
MSG_SMB_BLOCKING_LOCK_CANCEL,
process_blocking_lock_cancel_message);