From a2e800d83567b5cd0cd8c0ebea19d86d40d23fa1 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Sat, 2 May 2020 11:45:11 +0200 Subject: [PATCH] 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 --- source3/modules/vfs_snapper.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; -- 2.47.3