From: Ralph Boehme Date: Fri, 1 May 2020 14:36:09 +0000 (+0200) Subject: vfs_shadow_copy2: use smb_fname->twrp in shadow_copy2_strip_snapshot_internal() X-Git-Tag: ldb-2.2.0~668 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9fb491797e2a419457c6bba9ac96e6726e995eae;p=thirdparty%2Fsamba.git vfs_shadow_copy2: use smb_fname->twrp in shadow_copy2_strip_snapshot_internal() Use smb_fname->twrp instead if the @GMT token and assert both the twrp value and the converted @GMT string token have the same value. With this commit passing CI (which it did), we can somewhat safely assume that anything that calls into the VFS stack is correctly passing struct smb_filename.twrp from unix_convert() to the VFS without loosing the twrp value in one of the myriad places where we copy the original struct smb_filename value one way or another. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c index 0d52dd398a9..c50688c0d5f 100644 --- a/source3/modules/vfs_shadow_copy2.c +++ b/source3/modules/vfs_shadow_copy2.c @@ -751,6 +751,13 @@ static bool shadow_copy2_strip_snapshot_internal(TALLOC_CTX *mem_ctx, } *pstripped = stripped; } + if (timestamp != 0) { + time_t smb_fname_timestamp; + + SMB_ASSERT(smb_fname->twrp != 0); + smb_fname_timestamp = nt_time_to_unix(smb_fname->twrp); + SMB_ASSERT(smb_fname_timestamp == timestamp); + } *ptimestamp = timestamp; ret = true;