summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_catia.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2016-02-26 14:53:12 -0800
committerRalph Boehme <slow@samba.org>2016-03-01 15:25:22 +0100
commitc74ae37fe6df0c7a80733e6ed3ae8844345743a5 (patch)
tree24e10adbe609d1e99badd8e046e545d9aec2e0de /source3/modules/vfs_catia.c
parentfb4778f4e9834af556bd5aac177fc04e7f09f152 (diff)
downloadsamba-c74ae37fe6df0c7a80733e6ed3ae8844345743a5.tar.gz
VFS: Modify opendir to take a const struct smb_filename * instead of const char *
Preparing to reduce use of lp_posix_pathnames(). Uses the same techniques as commit 616d068f0cebb8e50a855b6e30f36fccb7f5a3c8 (synthetic_smb_fname()) to cope with modules that modify the incoming pathname. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'source3/modules/vfs_catia.c')
-rw-r--r--source3/modules/vfs_catia.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c
index f65ed4c7e78..9f42e5f52a3 100644
--- a/source3/modules/vfs_catia.c
+++ b/source3/modules/vfs_catia.c
@@ -269,23 +269,38 @@ static NTSTATUS catia_string_replace_allocate(connection_struct *conn,
}
static DIR *catia_opendir(vfs_handle_struct *handle,
- const char *fname,
- const char *mask,
- uint32_t attr)
+ const struct smb_filename *smb_fname,
+ const char *mask,
+ uint32_t attr)
{
char *name_mapped = NULL;
NTSTATUS status;
DIR *ret;
+ struct smb_filename *mapped_smb_fname = NULL;
- status = catia_string_replace_allocate(handle->conn, fname,
- &name_mapped, vfs_translate_to_unix);
+ status = catia_string_replace_allocate(handle->conn,
+ smb_fname->base_name,
+ &name_mapped,
+ vfs_translate_to_unix);
if (!NT_STATUS_IS_OK(status)) {
errno = map_errno_from_nt_status(status);
return NULL;
}
- ret = SMB_VFS_NEXT_OPENDIR(handle, name_mapped, mask, attr);
+ mapped_smb_fname = synthetic_smb_fname(talloc_tos(),
+ name_mapped,
+ NULL,
+ NULL);
+ if (mapped_smb_fname == NULL) {
+ TALLOC_FREE(mapped_smb_fname);
+ errno = ENOMEM;
+ return NULL;
+ }
+
+ ret = SMB_VFS_NEXT_OPENDIR(handle, mapped_smb_fname, mask, attr);
+
TALLOC_FREE(name_mapped);
+ TALLOC_FREE(mapped_smb_fname);
return ret;
}