diff options
author | Jeremy Allison <jra@samba.org> | 2017-05-23 13:12:29 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2017-05-31 22:50:22 +0200 |
commit | 892476b555f57bcbe40883c533e208c81be168c9 (patch) | |
tree | 342b656522a311574e153179e0a236032f2b6143 /source3/modules/vfs_cap.c | |
parent | aada94885dce29334e34c9aae32c22e7acfc1174 (diff) | |
download | samba-892476b555f57bcbe40883c533e208c81be168c9.tar.gz |
s3: VFS: Change SMB_VFS_LISTXATTR to use const struct smb_filename * instead of const char *.
We need to migrate all pathname based VFS calls to use a struct
to finish modernising the VFS with extra timestamp and flags parameters.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'source3/modules/vfs_cap.c')
-rw-r--r-- | source3/modules/vfs_cap.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/source3/modules/vfs_cap.c b/source3/modules/vfs_cap.c index 8d621ccec5e..91f624ee96b 100644 --- a/source3/modules/vfs_cap.c +++ b/source3/modules/vfs_cap.c @@ -675,15 +675,40 @@ static ssize_t cap_fgetxattr(vfs_handle_struct *handle, struct files_struct *fsp return SMB_VFS_NEXT_FGETXATTR(handle, fsp, cappath, value, size); } -static ssize_t cap_listxattr(vfs_handle_struct *handle, const char *path, char *list, size_t size) +static ssize_t cap_listxattr(vfs_handle_struct *handle, + const struct smb_filename *smb_fname, + char *list, + size_t size) { - char *cappath = capencode(talloc_tos(), path); + struct smb_filename *cap_smb_fname = NULL; + char *cappath = capencode(talloc_tos(), smb_fname->base_name); + ssize_t ret; + int saved_errno = 0; if (!cappath) { errno = ENOMEM; return -1; } - return SMB_VFS_NEXT_LISTXATTR(handle, cappath, list, size); + cap_smb_fname = synthetic_smb_fname(talloc_tos(), + cappath, + NULL, + NULL, + smb_fname->flags); + if (cap_smb_fname == NULL) { + TALLOC_FREE(cappath); + errno = ENOMEM; + return -1; + } + ret = SMB_VFS_NEXT_LISTXATTR(handle, cap_smb_fname, list, size); + if (ret == -1) { + saved_errno = errno; + } + TALLOC_FREE(cappath); + TALLOC_FREE(cap_smb_fname); + if (saved_errno) { + errno = saved_errno; + } + return ret; } static int cap_removexattr(vfs_handle_struct *handle, const char *path, const char *name) |