From: Samuel Cabrero Date: Tue, 13 Apr 2021 11:48:36 +0000 (+0200) Subject: s3: VFS: shadow_copy2: Implement VFS_SMB_FNTIMES() X-Git-Tag: tevent-0.11.0~1141 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6d9fc8de56b883c868881237937be7ad2823216e;p=thirdparty%2Fsamba.git s3: VFS: shadow_copy2: Implement VFS_SMB_FNTIMES() Signed-off-by: Samuel Cabrero Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c index 6843e409d8a..3042727e512 100644 --- a/source3/modules/vfs_shadow_copy2.c +++ b/source3/modules/vfs_shadow_copy2.c @@ -1570,6 +1570,26 @@ static int shadow_copy2_ntimes(vfs_handle_struct *handle, return SMB_VFS_NEXT_NTIMES(handle, smb_fname, ft); } +static int shadow_copy2_fntimes(vfs_handle_struct *handle, + files_struct *fsp, + struct smb_file_time *ft) +{ + time_t timestamp = 0; + + if (!shadow_copy2_strip_snapshot(talloc_tos(), + handle, + fsp->fsp_name, + ×tamp, + NULL)) { + return -1; + } + if (timestamp != 0) { + errno = EROFS; + return -1; + } + return SMB_VFS_NEXT_FNTIMES(handle, fsp, ft); +} + static int shadow_copy2_readlinkat(vfs_handle_struct *handle, const struct files_struct *dirfsp, const struct smb_filename *smb_fname, @@ -3175,6 +3195,7 @@ static struct vfs_fn_pointers vfs_shadow_copy2_fns = { .fchmod_fn = shadow_copy2_fchmod, .chdir_fn = shadow_copy2_chdir, .ntimes_fn = shadow_copy2_ntimes, + .fntimes_fn = shadow_copy2_fntimes, .readlinkat_fn = shadow_copy2_readlinkat, .mknodat_fn = shadow_copy2_mknodat, .realpath_fn = shadow_copy2_realpath,