From 3cb0e521e1bdddde972b6fd08fb86f7fe73da8d5 Mon Sep 17 00:00:00 2001 From: Tim Prouty Date: Thu, 2 Jul 2009 13:39:20 -0700 Subject: s3: Plumb smb_filename through SMB_VFS_NTIMES --- source3/modules/vfs_cap.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'source3/modules/vfs_cap.c') diff --git a/source3/modules/vfs_cap.c b/source3/modules/vfs_cap.c index 9348ab9554..7e363b6be7 100644 --- a/source3/modules/vfs_cap.c +++ b/source3/modules/vfs_cap.c @@ -301,16 +301,36 @@ static int cap_chdir(vfs_handle_struct *handle, const char *path) return SMB_VFS_NEXT_CHDIR(handle, cappath); } -static int cap_ntimes(vfs_handle_struct *handle, const char *path, +static int cap_ntimes(vfs_handle_struct *handle, + const struct smb_filename *smb_fname, struct smb_file_time *ft) { - char *cappath = capencode(talloc_tos(), path); + struct smb_filename *smb_fname_tmp = NULL; + char *cappath = NULL; + NTSTATUS status; + int ret; + + cappath = capencode(talloc_tos(), smb_fname->base_name); if (!cappath) { errno = ENOMEM; return -1; } - return SMB_VFS_NEXT_NTIMES(handle, cappath, ft); + + /* Setup temporary smb_filename structs. */ + status = copy_smb_filename(talloc_tos(), smb_fname, + &smb_fname_tmp); + if (!NT_STATUS_IS_OK(status)) { + errno = map_errno_from_nt_status(status); + return -1; + } + + smb_fname_tmp->base_name = cappath; + + ret = SMB_VFS_NEXT_NTIMES(handle, smb_fname_tmp, ft); + + TALLOC_FREE(smb_fname_tmp); + return ret; } -- cgit