diff options
Diffstat (limited to 'source3/modules/vfs_cap.c')
-rw-r--r-- | source3/modules/vfs_cap.c | 26 |
1 files changed, 23 insertions, 3 deletions
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; } |