summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_cap.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2017-05-24 11:35:50 -0700
committerJeremy Allison <jra@samba.org>2017-05-31 22:50:22 +0200
commit12b801d9d7856f1bb50619962f7e9cb94e75087f (patch)
tree3f2680ac6ce0d1dff13f652782a16d4e2643c8bd /source3/modules/vfs_cap.c
parent892476b555f57bcbe40883c533e208c81be168c9 (diff)
downloadsamba-12b801d9d7856f1bb50619962f7e9cb94e75087f.tar.gz
s3: VFS: Change SMB_VFS_REMOVEXATTR 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.c32
1 files changed, 29 insertions, 3 deletions
diff --git a/source3/modules/vfs_cap.c b/source3/modules/vfs_cap.c
index 91f624ee96b..fe70d781d07 100644
--- a/source3/modules/vfs_cap.c
+++ b/source3/modules/vfs_cap.c
@@ -711,16 +711,42 @@ static ssize_t cap_listxattr(vfs_handle_struct *handle,
return ret;
}
-static int cap_removexattr(vfs_handle_struct *handle, const char *path, const char *name)
+static int cap_removexattr(vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname,
+ const char *name)
{
- char *cappath = capencode(talloc_tos(), path);
+ struct smb_filename *cap_smb_fname = NULL;
+ char *cappath = capencode(talloc_tos(), smb_fname->base_name);
char *capname = capencode(talloc_tos(), name);
+ int ret;
+ int saved_errno = 0;
if (!cappath || !capname) {
errno = ENOMEM;
return -1;
}
- return SMB_VFS_NEXT_REMOVEXATTR(handle, cappath, capname);
+ cap_smb_fname = synthetic_smb_fname(talloc_tos(),
+ cappath,
+ NULL,
+ NULL,
+ smb_fname->flags);
+ if (cap_smb_fname == NULL) {
+ TALLOC_FREE(cappath);
+ TALLOC_FREE(capname);
+ errno = ENOMEM;
+ return -1;
+ }
+ ret = SMB_VFS_NEXT_REMOVEXATTR(handle, cap_smb_fname, capname);
+ if (ret == -1) {
+ saved_errno = errno;
+ }
+ TALLOC_FREE(cappath);
+ TALLOC_FREE(capname);
+ TALLOC_FREE(cap_smb_fname);
+ if (saved_errno) {
+ errno = saved_errno;
+ }
+ return ret;
}
static int cap_fremovexattr(vfs_handle_struct *handle, struct files_struct *fsp, const char *path)