From 48d18f451ec2521b8af9883feff965b6c523438e Mon Sep 17 00:00:00 2001 From: Noel Power Date: Wed, 10 Mar 2021 09:24:04 +0000 Subject: [PATCH] s3/modules: snapper: Add missing fsetxattr_fn impl Signed-off-by: Noel Power Reviewed-by: Jeremy Allison --- source3/modules/vfs_snapper.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/source3/modules/vfs_snapper.c b/source3/modules/vfs_snapper.c index 20de30249cf..a9d88e6fcd6 100644 --- a/source3/modules/vfs_snapper.c +++ b/source3/modules/vfs_snapper.c @@ -2553,6 +2553,31 @@ static int snapper_gmt_setxattr(struct vfs_handle_struct *handle, aname, value, size, flags); } +static int snapper_gmt_fsetxattr(struct vfs_handle_struct *handle, + struct files_struct *fsp, + const char *aname, const void *value, + size_t size, int flags) +{ + time_t timestamp = 0; + const struct smb_filename *smb_fname = NULL; + + smb_fname = fsp->fsp_name; + + if (!snapper_gmt_strip_snapshot(talloc_tos(), + handle, + smb_fname, + ×tamp, + NULL)) { + return -1; + } + if (timestamp != 0) { + errno = EROFS; + return -1; + } + return SMB_VFS_NEXT_FSETXATTR(handle, fsp, + aname, value, size, flags); +} + static int snapper_gmt_get_real_filename(struct vfs_handle_struct *handle, const struct smb_filename *fpath, const char *name, @@ -2755,6 +2780,7 @@ static struct vfs_fn_pointers snapper_fns = { .getxattrat_recv_fn = vfs_not_implemented_getxattrat_recv, .removexattr_fn = snapper_gmt_removexattr, .setxattr_fn = snapper_gmt_setxattr, + .fsetxattr_fn = snapper_gmt_fsetxattr, .chflags_fn = snapper_gmt_chflags, .get_real_filename_fn = snapper_gmt_get_real_filename, }; -- 2.47.3