From 4e3656b8d1d0bf8c0c4ade01332e7384ea890810 Mon Sep 17 00:00:00 2001 From: Tim Prouty Date: Tue, 16 Jun 2009 12:01:13 -0700 Subject: s3: Change SMB_VFS_OPEN to take an smb_filename struct This was a little messy because of all of the vfs modules I had to touch. Most of them were pretty straight forward, but the streams modules required a little attention to handle smb_filename. Since the use of smb_filename enables the vfs modules to access the raw, over-the-wire stream, a little bit of the handling that was being done by split_ntfs_stream_name has now been shifted into the individual stream modules. It may be a little more code, but overall it gives more flexibility to the streams modules, while also allowing correct stream handling. --- source3/modules/vfs_catia.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'source3/modules/vfs_catia.c') diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c index 2870254bfb..8d1c87a9fc 100644 --- a/source3/modules/vfs_catia.c +++ b/source3/modules/vfs_catia.c @@ -133,18 +133,30 @@ static SMB_STRUCT_DIRENT *catia_readdir(vfs_handle_struct *handle, } static int catia_open(vfs_handle_struct *handle, - const char *fname, + struct smb_filename *smb_fname, files_struct *fsp, int flags, mode_t mode) { - char *name = to_unix(talloc_tos(), fname); + char *name; + char *tmp_base_name; + int ret; + name = to_unix(talloc_tos(), smb_fname->base_name); if (!name) { errno = ENOMEM; return -1; } - return SMB_VFS_NEXT_OPEN(handle, name, fsp, flags, mode); + + tmp_base_name = smb_fname->base_name; + smb_fname->base_name = name; + + ret = SMB_VFS_NEXT_OPEN(handle, name, fsp, flags, mode); + + smb_fname->base_name = tmp_base_name; + TALLOC_FREE(name); + + return ret; } static int catia_rename(vfs_handle_struct *handle, -- cgit