From: Ralph Boehme Date: Sat, 2 May 2020 09:45:11 +0000 (+0200) Subject: vfs_snapper: use struct smb_filename.twrp instead of @GMT string token X-Git-Tag: ldb-2.2.0~665 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a2e800d83567b5cd0cd8c0ebea19d86d40d23fa1;p=thirdparty%2Fsamba.git vfs_snapper: use struct smb_filename.twrp instead of @GMT string token @GMT tokens are still validated and stripped, but the previous version timestamp is taken from the struct smb_filename twrp member. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_snapper.c b/source3/modules/vfs_snapper.c index def6afe7bdc..193cbaca5b9 100644 --- a/source3/modules/vfs_snapper.c +++ b/source3/modules/vfs_snapper.c @@ -1732,6 +1732,10 @@ static bool snapper_gmt_strip_snapshot(TALLOC_CTX *mem_ctx, size_t rest_len, dst_len; ptrdiff_t len_before_gmt; + if (smb_fname->twrp == 0) { + goto no_snapshot; + } + p = strstr_m(name, "@GMT-"); if (p == NULL) { goto no_snapshot; @@ -1801,7 +1805,7 @@ static bool snapper_gmt_strip_snapshot(TALLOC_CTX *mem_ctx, stripped[dst_len] = '\0'; *pstripped = stripped; } - *ptimestamp = timestamp; + *ptimestamp = nt_time_to_unix(smb_fname->twrp); return true; no_snapshot: *ptimestamp = 0;