]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libcli/smb: ignore lease_flags and lease_duration for leasev1 in smb2_lease_pull()
authorRalph Boehme <slow@samba.org>
Mon, 21 Oct 2024 10:51:20 +0000 (12:51 +0200)
committerRalph Boehme <slow@samba.org>
Tue, 5 Nov 2024 14:39:30 +0000 (14:39 +0000)
MS-SMB2 2.2.13.2.8 SMB2_CREATE_REQUEST_LEASE:

  LeaseFlags (4 bytes): This field MUST NOT be used and MUST be reserved.
  The client MUST set this to 0, and the server MUST ignore it on receipt.

  LeaseDuration (8 bytes): This field MUST NOT be used and MUST be reserved.
  The client MUST set this to 0, and the server MUST ignore it on receipt.

So let's really, really ignore it.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
libcli/smb/smb2_lease.c

index d3d6a4926b929e3f61a8a5d1e8cb22b64cded101..630fd3943cc3c5b320a5e4c988f723d08206113f 100644 (file)
@@ -46,8 +46,6 @@ ssize_t smb2_lease_pull(const uint8_t *buf, size_t len,
 
        memcpy(&lease->lease_key, buf, 16);
        lease->lease_state = IVAL(buf, 16);
-       lease->lease_flags = IVAL(buf, 20);
-       lease->lease_duration = BVAL(buf, 24);
        lease->lease_version = version;
 
        switch (version) {
@@ -55,6 +53,8 @@ ssize_t smb2_lease_pull(const uint8_t *buf, size_t len,
                break;
        case 2:
                memcpy(&lease->parent_lease_key, buf+32, 16);
+               lease->lease_flags = IVAL(buf, 20);
+               lease->lease_duration = BVAL(buf, 24);
                lease->lease_epoch = SVAL(buf, 48);
                break;
        }