diff options
author | Noel Power <noel.power@suse.com> | 2021-03-10 09:24:04 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2021-03-11 17:50:30 +0000 |
commit | 48d18f451ec2521b8af9883feff965b6c523438e (patch) | |
tree | bb1a1e2ce950b2ed7da044070ff389940273db6f /source3 | |
parent | fabfe6fbe58dc2c3d8c7615165ec7c7933e4e9cd (diff) | |
download | samba-48d18f451ec2521b8af9883feff965b6c523438e.tar.gz |
s3/modules: snapper: Add missing fsetxattr_fn impl
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/modules/vfs_snapper.c | 26 |
1 files changed, 26 insertions, 0 deletions
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, }; |