1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

libcli/smb: ignore lease_flags and lease_duration for leasev1 in smb2_lease_pull()

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>
This commit is contained in:
Ralph Boehme 2024-10-21 12:51:20 +02:00
parent 2b1ef2d894
commit f30cdb0c52

View 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;
}