static int
catia_chmod_acl(vfs_handle_struct *handle,
- const char *path,
+ const struct smb_filename *smb_fname,
mode_t mode)
{
char *mapped_name = NULL;
+ struct smb_filename *mapped_smb_fname = NULL;
NTSTATUS status;
int ret;
+ int saved_errno;
status = catia_string_replace_allocate(handle->conn,
- path, &mapped_name, vfs_translate_to_unix);
+ smb_fname->base_name,
+ &mapped_name,
+ vfs_translate_to_unix);
if (!NT_STATUS_IS_OK(status)) {
errno = map_errno_from_nt_status(status);
return -1;
}
- ret = SMB_VFS_NEXT_CHMOD_ACL(handle, mapped_name, mode);
+ mapped_smb_fname = synthetic_smb_fname(talloc_tos(),
+ mapped_name,
+ NULL,
+ NULL);
+ if (mapped_smb_fname == NULL) {
+ TALLOC_FREE(mapped_name);
+ errno = ENOMEM;
+ return -1;
+ }
+ ret = SMB_VFS_NEXT_CHMOD_ACL(handle, mapped_smb_fname, mode);
+ saved_errno = errno;
TALLOC_FREE(mapped_name);
+ TALLOC_FREE(mapped_smb_fname);
+ errno = saved_errno;
return ret;
}