smbd: "err" is no longer set in get_lock_offset
authorVolker Lendecke <vl@samba.org>
Tue, 15 Jul 2014 09:52:07 +0000 (15 09:52 +0000)
committerStefan Metzmacher <metze@samba.org>
Tue, 22 Jul 2014 13:32:39 +0000 (22 15:32 +0200)
This was only referenced in the !HAVE_LONGLONG section

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/smbd/blocking.c
source3/smbd/proto.h
source3/smbd/reply.c

index 47ac4cc..5d3672e 100644 (file)
@@ -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
index 902c2ca..eab05c2 100644 (file)
@@ -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);
index 7455da3..1bb606f 100644 (file)
@@ -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);