s3:smbd/open: pass smbd_server_connection as private_data to msg_file_was_renamed()
authorStefan Metzmacher <metze@samba.org>
Tue, 13 Dec 2011 07:11:58 +0000 (08:11 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 13 Dec 2011 11:36:35 +0000 (12:36 +0100)
metze

source3/smbd/open.c
source3/smbd/process.c

index fceebcb6dddca5e3b6ecf3d0501e63c0feaa3fa5..a697ee86b5a4fb07c186c8d3bdac33162235bf27 100644 (file)
@@ -2992,7 +2992,6 @@ void msg_file_was_renamed(struct messaging_context *msg,
                          struct server_id server_id,
                          DATA_BLOB *data)
 {
-       struct smbd_server_connection *sconn;
        files_struct *fsp;
        char *frm = (char *)data->data;
        struct file_id id;
@@ -3002,10 +3001,11 @@ void msg_file_was_renamed(struct messaging_context *msg,
        struct smb_filename *smb_fname = NULL;
        size_t sp_len, bn_len;
        NTSTATUS status;
+       struct smbd_server_connection *sconn =
+               talloc_get_type(private_data,
+               struct smbd_server_connection);
 
-       sconn = msg_ctx_to_sconn(msg);
        if (sconn == NULL) {
-               DEBUG(1, ("could not find sconn\n"));
                return;
        }
 
index 51783fa67c7926eb6133fd330221d84a69913fcb..ad5c096e05d51924dd7ae81b5da304bd9fb14df6 100644 (file)
@@ -3139,7 +3139,7 @@ void smbd_process(struct tevent_context *ev_ctx,
                           MSG_SMB_FORCE_TDIS, msg_force_tdis);
        messaging_register(sconn->msg_ctx, sconn,
                           MSG_SMB_CLOSE_FILE, msg_close_file);
-       messaging_register(sconn->msg_ctx, NULL,
+       messaging_register(sconn->msg_ctx, sconn,
                           MSG_SMB_FILE_RENAME, msg_file_was_renamed);
 
        /*