From 637901c24288740d51f28e2378c02d956dd7b17d Mon Sep 17 00:00:00 2001 From: Aravind Srinivasan Date: Thu, 3 Sep 2009 20:46:10 +0000 Subject: vfs catia: Fix the double translation that was happening with createfile and open. Since the catia translation is implemented for open, it should not also be done in createfile. By removing createfile from catia, translation is now done correctly for the primary open path. In order to support systems that have custom createfile implementations that don't eventually call SMB_VFS_OPEN, SMB_VFS_TRANSLATE_NAME has been expanded to take an additional argument that specifies direction. Signed-off-by: Tim Prouty --- source3/include/vfs.h | 11 +++++++++-- source3/include/vfs_macros.h | 8 ++++---- 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'source3/include') diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 38d60a0aec..ed49d1fd28 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -158,6 +158,11 @@ struct smb_filename; handle = handle->next; \ } +enum vfs_translate_direction { + vfs_translate_to_unix = 0, + vfs_translate_to_windows +}; + /* Available VFS operations. These values must be in sync with vfs_ops struct (struct vfs_fn_pointers and struct vfs_handle_pointers inside of struct vfs_ops). @@ -302,7 +307,8 @@ struct vfs_fn_pointers { struct lock_struct *plock); NTSTATUS (*translate_name)(struct vfs_handle_struct *handle, - char **mapped_name); + char **mapped_name, + enum vfs_translate_direction direction); /* NT ACL operations. */ @@ -650,7 +656,8 @@ void smb_vfs_call_strict_unlock(struct vfs_handle_struct *handle, struct files_struct *fsp, struct lock_struct *plock); NTSTATUS smb_vfs_call_translate_name(struct vfs_handle_struct *handle, - char **mapped_name); + char **mapped_name, + enum vfs_translate_direction direction); NTSTATUS smb_vfs_call_fget_nt_acl(struct vfs_handle_struct *handle, struct files_struct *fsp, uint32 security_info, diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index 7cc5579e25..8ca7f373bf 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -345,10 +345,10 @@ #define SMB_VFS_NEXT_STRICT_UNLOCK(handle, fsp, plock) \ smb_vfs_call_strict_unlock((handle)->next, (fsp), (plock)) -#define SMB_VFS_TRANSLATE_NAME(conn, mapped_name) \ - smb_vfs_call_translate_name((conn)->vfs_handles, (mapped_name)) -#define SMB_VFS_NEXT_TRANSLATE_NAME(handle, mapped_name) \ - smb_vfs_call_translate_name((handle)->next, (mapped_name)) +#define SMB_VFS_TRANSLATE_NAME(conn, mapped_name, direction) \ + smb_vfs_call_translate_name((conn)->vfs_handles, (mapped_name), (direction)) +#define SMB_VFS_NEXT_TRANSLATE_NAME(handle, mapped_name, direction) \ + smb_vfs_call_translate_name((handle)->next, (mapped_name), (direction)) #define SMB_VFS_NEXT_STRICT_UNLOCK(handle, fsp, plock) \ smb_vfs_call_strict_unlock((handle)->next, (fsp), (plock)) -- cgit