summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_snapper.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2016-03-01 17:25:25 -0800
committerRalph Boehme <slow@samba.org>2016-03-03 09:04:14 +0100
commit8e88b9783dec751fe5bd4750923b62b978080885 (patch)
tree82bc4c83f0361d933d5480aa7ebc1cdd440faa22 /source3/modules/vfs_snapper.c
parentac8fba6ef7093836eb6988e749325b69e7a7fde1 (diff)
downloadsamba-8e88b9783dec751fe5bd4750923b62b978080885.tar.gz
VFS: Modify chmod_acl to take a const struct smb_filename * instead of const char *
Preparing to reduce use of lp_posix_pathnames(). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'source3/modules/vfs_snapper.c')
-rw-r--r--source3/modules/vfs_snapper.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/source3/modules/vfs_snapper.c b/source3/modules/vfs_snapper.c
index 0a0f5eb1cca..fb9936931c0 100644
--- a/source3/modules/vfs_snapper.c
+++ b/source3/modules/vfs_snapper.c
@@ -2741,29 +2741,44 @@ static int snapper_gmt_setxattr(struct vfs_handle_struct *handle,
}
static int snapper_gmt_chmod_acl(vfs_handle_struct *handle,
- const char *fname, mode_t mode)
+ const struct smb_filename *smb_fname,
+ mode_t mode)
{
time_t timestamp;
char *stripped;
ssize_t ret;
int saved_errno;
char *conv;
+ struct smb_filename *conv_smb_fname = NULL;
- if (!snapper_gmt_strip_snapshot(talloc_tos(), handle, fname,
- &timestamp, &stripped)) {
+ if (!snapper_gmt_strip_snapshot(talloc_tos(),
+ handle,
+ smb_fname->base_name,
+ &timestamp,
+ &stripped)) {
return -1;
}
if (timestamp == 0) {
- return SMB_VFS_NEXT_CHMOD_ACL(handle, fname, mode);
+ return SMB_VFS_NEXT_CHMOD_ACL(handle, smb_fname, mode);
}
conv = snapper_gmt_convert(talloc_tos(), handle, stripped, timestamp);
TALLOC_FREE(stripped);
if (conv == NULL) {
return -1;
}
- ret = SMB_VFS_NEXT_CHMOD_ACL(handle, conv, mode);
+ conv_smb_fname = synthetic_smb_fname(talloc_tos(),
+ conv,
+ NULL,
+ NULL);
+ if (conv_smb_fname == NULL) {
+ TALLOC_FREE(conv);
+ errno = ENOMEM;
+ return -1;
+ }
+ ret = SMB_VFS_NEXT_CHMOD_ACL(handle, conv_smb_fname, mode);
saved_errno = errno;
TALLOC_FREE(conv);
+ TALLOC_FREE(conv_smb_fname);
errno = saved_errno;
return ret;
}