]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Simplify smb_set_posix_lock()
authorVolker Lendecke <vl@samba.org>
Sat, 23 Nov 2024 15:38:53 +0000 (16:38 +0100)
committerMartin Schwenke <martins@samba.org>
Mon, 2 Dec 2024 04:53:33 +0000 (04:53 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
source3/smbd/smb1_trans2.c

index 3bb957348cc8abbb6dfa5f97c40818cc23db3a33..c6186648a4c21f469aa76c2c49dc8975f6ee8320 100644 (file)
@@ -347,10 +347,8 @@ static NTSTATUS smb_set_posix_lock(connection_struct *conn,
        }
 
        smblctx = (uint64_t)IVAL(pdata, POSIX_LOCK_PID_OFFSET);
-       offset = (((uint64_t) IVAL(pdata,(POSIX_LOCK_START_OFFSET+4))) << 32) |
-                       ((uint64_t) IVAL(pdata,POSIX_LOCK_START_OFFSET));
-       count = (((uint64_t) IVAL(pdata,(POSIX_LOCK_LEN_OFFSET+4))) << 32) |
-                       ((uint64_t) IVAL(pdata,POSIX_LOCK_LEN_OFFSET));
+       offset = PULL_LE_U64(pdata, POSIX_LOCK_START_OFFSET);
+       count = PULL_LE_U64(pdata, POSIX_LOCK_LEN_OFFSET);
 
        DBG_DEBUG("file %s, lock_type = %u, smblctx = %"PRIu64", "
                  "count = %"PRIu64", offset = %"PRIu64"\n",