]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_snapper: use struct smb_filename.twrp instead of @GMT string token
authorRalph Boehme <slow@samba.org>
Sat, 2 May 2020 09:45:11 +0000 (11:45 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 5 May 2020 19:18:42 +0000 (19:18 +0000)
@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 <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_snapper.c

index def6afe7bdc0c224625894662b0e8c5d5ea7b21d..193cbaca5b9e927b667ca55d859e6b4e87c59da0 100644 (file)
@@ -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;