diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/proto.h | 8 | ||||
-rw-r--r-- | source3/locking/locking.c | 15 | ||||
-rw-r--r-- | source3/smbd/open.c | 15 | ||||
-rw-r--r-- | source3/smbd/smb2_create.c | 3 |
4 files changed, 26 insertions, 15 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index 98edb55951..2374c2660d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -3348,9 +3348,10 @@ void set_share_mode(struct share_mode_lock *lck, files_struct *fsp, uid_t uid, uint64_t mid, uint16 op_type); void add_deferred_open(struct share_mode_lock *lck, uint64_t mid, struct timeval request_time, - struct file_id id); + struct server_id pid, struct file_id id); bool del_share_mode(struct share_mode_lock *lck, files_struct *fsp); -void del_deferred_open_entry(struct share_mode_lock *lck, uint64_t mid); +void del_deferred_open_entry(struct share_mode_lock *lck, uint64_t mid, + struct server_id pid); bool remove_share_oplock(struct share_mode_lock *lck, files_struct *fsp); bool downgrade_share_oplock(struct share_mode_lock *lck, files_struct *fsp); NTSTATUS can_set_delete_on_close(files_struct *fsp, uint32 dosmode); @@ -5839,7 +5840,8 @@ bool map_open_params_to_ntcreate(const struct smb_filename *smb_fname, uint32 *pcreate_disposition, uint32 *pcreate_options, uint32_t *pprivate_flags); -void remove_deferred_open_entry(struct file_id id, uint64_t mid); +void remove_deferred_open_entry(struct file_id id, uint64_t mid, + struct server_id pid); NTSTATUS open_file_fchmod(struct smb_request *req, connection_struct *conn, struct smb_filename *smb_fname, files_struct **result); diff --git a/source3/locking/locking.c b/source3/locking/locking.c index b17bf9e059..a9b13d61a1 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -1127,10 +1127,12 @@ static void fill_share_mode_entry(struct share_mode_entry *e, static void fill_deferred_open_entry(struct share_mode_entry *e, const struct timeval request_time, - struct file_id id, uint64_t mid) + struct file_id id, + struct server_id pid, + uint64_t mid) { ZERO_STRUCTP(e); - e->pid = procid_self(); + e->pid = pid; e->op_mid = mid; e->op_type = DEFERRED_OPEN_ENTRY; e->time.tv_sec = request_time.tv_sec; @@ -1171,10 +1173,10 @@ void set_share_mode(struct share_mode_lock *lck, files_struct *fsp, void add_deferred_open(struct share_mode_lock *lck, uint64_t mid, struct timeval request_time, - struct file_id id) + struct server_id pid, struct file_id id) { struct share_mode_entry entry; - fill_deferred_open_entry(&entry, request_time, id, mid); + fill_deferred_open_entry(&entry, request_time, id, pid, mid); add_share_mode_entry(lck, &entry); } @@ -1248,12 +1250,13 @@ bool del_share_mode(struct share_mode_lock *lck, files_struct *fsp) return True; } -void del_deferred_open_entry(struct share_mode_lock *lck, uint64_t mid) +void del_deferred_open_entry(struct share_mode_lock *lck, uint64_t mid, + struct server_id pid) { struct share_mode_entry entry, *e; fill_deferred_open_entry(&entry, timeval_zero(), - lck->id, mid); + lck->id, pid, mid); e = find_share_mode_entry(lck, &entry); if (e == NULL) { diff --git a/source3/smbd/open.c b/source3/smbd/open.c index e0fcfb9679..f1c32e0585 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -1090,7 +1090,8 @@ static void defer_open(struct share_mode_lock *lck, state->id, (char *)state, sizeof(*state))) { exit_server("push_deferred_open_message_smb failed"); } - add_deferred_open(lck, req->mid, request_time, state->id); + add_deferred_open(lck, req->mid, request_time, + sconn_server_id(req->sconn), state->id); } @@ -1454,14 +1455,15 @@ static NTSTATUS calculate_access_mask(connection_struct *conn, Remove the deferred open entry under lock. ****************************************************************************/ -void remove_deferred_open_entry(struct file_id id, uint64_t mid) +void remove_deferred_open_entry(struct file_id id, uint64_t mid, + struct server_id pid) { struct share_mode_lock *lck = get_share_mode_lock(talloc_tos(), id, NULL, NULL, NULL); if (lck == NULL) { DEBUG(0, ("could not get share mode lock\n")); } else { - del_deferred_open_entry(lck, mid); + del_deferred_open_entry(lck, mid, pid); TALLOC_FREE(lck); } } @@ -1574,7 +1576,9 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, see if this has timed out. */ /* Remove the deferred open entry under lock. */ - remove_deferred_open_entry(state->id, req->mid); + remove_deferred_open_entry( + state->id, req->mid, + sconn_server_id(req->sconn)); /* Ensure we don't reprocess this message. */ remove_deferred_open_message_smb(req->mid); @@ -2271,7 +2275,8 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, /* If this is a successful open, we must remove any deferred open * records. */ if (req != NULL) { - del_deferred_open_entry(lck, req->mid); + del_deferred_open_entry(lck, req->mid, + sconn_server_id(req->sconn)); } TALLOC_FREE(lck); diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c index 60bbde215d..47a85f8cf3 100644 --- a/source3/smbd/smb2_create.c +++ b/source3/smbd/smb2_create.c @@ -1155,7 +1155,8 @@ static bool smbd_smb2_create_cancel(struct tevent_req *req) smb2req = state->smb2req; mid = get_mid_from_smb2req(smb2req); - remove_deferred_open_entry(state->id, mid); + remove_deferred_open_entry(state->id, mid, + sconn_server_id(smb2req->sconn)); remove_deferred_open_message_smb2_internal(smb2req, mid); smb2req->cancelled = true; |