From: Ralph Boehme Date: Sat, 2 May 2020 09:45:11 +0000 (+0200) Subject: vfs_ceph_snapshots: use struct smb_filename.twrp instead of @GMT string token X-Git-Tag: ldb-2.2.0~663 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8632f7eaba6665c9feb970e38b8979a6741abea4;p=thirdparty%2Fsamba.git vfs_ceph_snapshots: 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_ceph_snapshots.c b/source3/modules/vfs_ceph_snapshots.c index 43e2b78d027..8e004f0435a 100644 --- a/source3/modules/vfs_ceph_snapshots.c +++ b/source3/modules/vfs_ceph_snapshots.c @@ -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;