]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_ceph_snapshots: 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_ceph_snapshots.c

index 43e2b78d027fe20028f24b34d3c85202ed1c8fec..8e004f0435aa1af97c2653b5c41ae23ec17f5dc4 100644 (file)
@@ -449,6 +449,10 @@ static bool ceph_snap_gmt_strip_snapshot(struct vfs_handle_struct *handle,
        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;
@@ -518,7 +522,7 @@ static bool ceph_snap_gmt_strip_snapshot(struct vfs_handle_struct *handle,
                DBG_DEBUG("GMT token in %s stripped to %s\n",
                          name, _stripped_buf);
        }
-       *_timestamp = timestamp;
+       *_timestamp = nt_time_to_unix(smb_fname->twrp);
        return 0;
 no_snapshot:
        *_timestamp = 0;