From: Volker Lendecke Date: Tue, 15 Jul 2014 09:52:07 +0000 (+0000) Subject: smbd: "err" is no longer set in get_lock_offset X-Git-Tag: tdb-1.3.1~664 X-Git-Url: https://repo.or.cz/w/Samba.git/commitdiff_plain/823215bf98754c5438c055475a56afec2bddcf22 smbd: "err" is no longer set in get_lock_offset This was only referenced in the !HAVE_LONGLONG section Signed-off-by: Volker Lendecke Reviewed-by: Stefan Metzmacher --- diff --git a/source3/smbd/blocking.c b/source3/smbd/blocking.c index 47ac4cc4021..5d3672e7836 100644 --- a/source3/smbd/blocking.c +++ b/source3/smbd/blocking.c @@ -357,11 +357,10 @@ static void undo_locks_obtained(struct blocking_lock_record *blr) */ for(i = blr->lock_num - 1; i >= 0; i--) { - bool err; smblctx = get_lock_pid( data, i, large_file_format); count = get_lock_count( data, i, large_file_format); - offset = get_lock_offset( data, i, large_file_format, &err); + offset = get_lock_offset( data, i, large_file_format); /* * We know err cannot be set as if it was the lock @@ -469,7 +468,6 @@ static bool process_lockingX(struct blocking_lock_record *blr) for(; blr->lock_num < num_locks; blr->lock_num++) { struct byte_range_lock *br_lck = NULL; - bool err; /* * Ensure the blr record gets updated with @@ -478,7 +476,7 @@ static bool process_lockingX(struct blocking_lock_record *blr) blr->smblctx = get_lock_pid( data, blr->lock_num, large_file_format); blr->count = get_lock_count( data, blr->lock_num, large_file_format); - blr->offset = get_lock_offset( data, blr->lock_num, large_file_format, &err); + blr->offset = get_lock_offset( data, blr->lock_num, large_file_format); /* * We know err cannot be set as if it was the lock diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index 902c2cadb20..eab05c2e2cb 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -914,7 +914,7 @@ uint64_t get_lock_pid(const uint8_t *data, int data_offset, uint64_t get_lock_count(const uint8_t *data, int data_offset, bool large_file_format); uint64_t get_lock_offset(const uint8_t *data, int data_offset, - bool large_file_format, bool *err); + bool large_file_format); void reply_lockingX(struct smb_request *req); void reply_readbmpx(struct smb_request *req); void reply_readbs(struct smb_request *req); diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 7455da320d3..1bb606f52b3 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -7595,12 +7595,10 @@ uint64_t get_lock_count(const uint8_t *data, int data_offset, ****************************************************************************/ uint64_t get_lock_offset(const uint8_t *data, int data_offset, - bool large_file_format, bool *err) + bool large_file_format) { uint64_t offset = 0; - *err = False; - if(!large_file_format) { offset = (uint64_t)IVAL(data,SMB_LKOFF_OFFSET(data_offset)); } else { @@ -7868,7 +7866,6 @@ void reply_lockingX(struct smb_request *req) int i; const uint8_t *data; bool large_file_format; - bool err; NTSTATUS status = NT_STATUS_UNSUCCESSFUL; struct smbd_lock_element *ulocks; struct smbd_lock_element *locks; @@ -8003,17 +8000,8 @@ void reply_lockingX(struct smb_request *req) for(i = 0; i < (int)num_ulocks; i++) { ulocks[i].smblctx = get_lock_pid(data, i, large_file_format); ulocks[i].count = get_lock_count(data, i, large_file_format); - ulocks[i].offset = get_lock_offset(data, i, large_file_format, &err); + ulocks[i].offset = get_lock_offset(data, i, large_file_format); ulocks[i].brltype = UNLOCK_LOCK; - - /* - * There is no error code marked "stupid client bug".... :-). - */ - if(err) { - reply_nterror(req, NT_STATUS_ACCESS_DENIED); - END_PROFILE(SMBlockingX); - return; - } } /* Now do any requested locks */ @@ -8025,7 +8013,7 @@ void reply_lockingX(struct smb_request *req) for(i = 0; i < (int)num_locks; i++) { locks[i].smblctx = get_lock_pid(data, i, large_file_format); locks[i].count = get_lock_count(data, i, large_file_format); - locks[i].offset = get_lock_offset(data, i, large_file_format, &err); + locks[i].offset = get_lock_offset(data, i, large_file_format); if (locktype & LOCKING_ANDX_SHARED_LOCK) { if (locktype & LOCKING_ANDX_CANCEL_LOCK) { @@ -8040,15 +8028,6 @@ void reply_lockingX(struct smb_request *req) locks[i].brltype = WRITE_LOCK; } } - - /* - * There is no error code marked "stupid client bug".... :-). - */ - if(err) { - reply_nterror(req, NT_STATUS_ACCESS_DENIED); - END_PROFILE(SMBlockingX); - return; - } } status = smbd_do_unlocking(req, fsp, num_ulocks, ulocks);