]> git.ipfire.org Git - thirdparty/samba.git/commit
smbd: always flush pending write time update when setting filesize
authorRalph Boehme <slow@samba.org>
Thu, 12 Mar 2020 15:52:34 +0000 (16:52 +0100)
committerKarolin Seeger <kseeger@samba.org>
Tue, 7 Apr 2020 09:37:25 +0000 (09:37 +0000)
commit5f4a49bd9f658370a9516233a63e66e241990f2e
treeaa614f3424035229a45e58a7ad9bdd1d3633ae59
parent16d837cb233fca641943d0194a3e0cb379275ec4
smbd: always flush pending write time update when setting filesize

We need to flush a pending write time update even when we're setting the
filesize to current filesize.

Note that we're already doing it this way in the relevant places listed my
dochelp@MS in

https://lists.samba.org/archive/cifs-protocol/2019-December/003364.html

  Cleanup (= Close)
  SetBasicInfo
  SetAllocationInfo
  SetEndOfFileInfo
  SetValidDataLengthInfo
  Flush
  FSCTL_SET_ENCRYPTION
  FSCTL_OFFLOAD_WRITE

Cleanup (= Close):

  Already implemented by update_write_time_on_close() and friends.

SetBasicInfo:

  Currently doesn't flush pending updates. Fixed by a subsequent commit.

SetAllocationInfo:

  smb_set_file_allocation_info() when setting a file's allocation size.

SetEndOfFileInfo:

  Currently doesn't flush pending updates. Fixed by a subsequent commit.

SetValidDataLengthInfo:

  Not implemented, returns NT_STATUS_NOT_SUPPORTED which seems wrong btw, as
  SetValidDataLengthInfo IS listed in MS-SMB2 2.2.39.

Flush:

  Currently doesn't flush pending updates. Fixed by subsequent commit.

FSCTL_SET_ENCRYPTION:

  Windows 2016 doesn't flush a pending writetime update, verified with a
  smbtorture test.

FSCTL_OFFLOAD_WRITE:

  NT_STATUS_NOT_IMPLEMENTED

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14150

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(back-ported from commit 79d7d6b9d01b8547f16b74a62926d0b471f18c39)
source3/smbd/trans2.c