diff options
Diffstat (limited to 'source3/locking')
-rw-r--r-- | source3/locking/brlock.c | 8 | ||||
-rw-r--r-- | source3/locking/locking.c | 6 |
2 files changed, 9 insertions, 5 deletions
diff --git a/source3/locking/brlock.c b/source3/locking/brlock.c index d12c4affc3..aa522ac780 100644 --- a/source3/locking/brlock.c +++ b/source3/locking/brlock.c @@ -74,6 +74,7 @@ bool brl_same_context(const struct lock_context *ctx1, static bool brl_overlap(const struct lock_struct *lck1, const struct lock_struct *lck2) { + /* XXX Remove for Win7 compatibility. */ /* this extra check is not redundent - it copes with locks that go beyond the end of 64 bit file space */ if (lck1->size != 0 && @@ -105,8 +106,11 @@ static bool brl_conflict(const struct lock_struct *lck1, return False; } - if (brl_same_context(&lck1->context, &lck2->context) && - lck2->lock_type == READ_LOCK && lck1->fnum == lck2->fnum) { + /* A READ lock can stack on top of a WRITE lock if they have the same + * context & fnum. */ + if (lck1->lock_type == WRITE_LOCK && lck2->lock_type == READ_LOCK && + brl_same_context(&lck1->context, &lck2->context) && + lck1->fnum == lck2->fnum) { return False; } diff --git a/source3/locking/locking.c b/source3/locking/locking.c index cc0295e749..1737eab1c6 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -923,12 +923,12 @@ bool rename_share_filename(struct messaging_context *msg_ctx, return False; } - push_file_id_16(frm, &lck->id); + push_file_id_24(frm, &lck->id); DEBUG(10,("rename_share_filename: msg_len = %u\n", (unsigned int)msg_len )); - safe_strcpy(&frm[16], lck->servicepath, sp_len); - safe_strcpy(&frm[16 + sp_len + 1], lck->filename, fn_len); + safe_strcpy(&frm[24], lck->servicepath, sp_len); + safe_strcpy(&frm[24 + sp_len + 1], lck->filename, fn_len); /* Send the messages. */ for (i=0; i<lck->num_share_modes; i++) { |