diff options
author | Tim Prouty <tprouty@samba.org> | 2009-07-02 09:27:44 -0700 |
---|---|---|
committer | Tim Prouty <tprouty@samba.org> | 2009-07-06 15:38:36 -0700 |
commit | 258952aa85f2a68e2d2362522f6114c6a439f1e3 (patch) | |
tree | 696d8f4425cb6d82c95c0923ba1b0405d39a1f5e /source3/modules/vfs_cap.c | |
parent | 133e915a81510f543f6458f377857d4f1b680970 (diff) | |
download | samba-258952aa85f2a68e2d2362522f6114c6a439f1e3.tar.gz |
s3: Plumb smb_filename through SMB_VFS_UNLINK
Diffstat (limited to 'source3/modules/vfs_cap.c')
-rw-r--r-- | source3/modules/vfs_cap.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/source3/modules/vfs_cap.c b/source3/modules/vfs_cap.c index 4d16aa44ae..9348ab9554 100644 --- a/source3/modules/vfs_cap.c +++ b/source3/modules/vfs_cap.c @@ -226,15 +226,34 @@ static int cap_lstat(vfs_handle_struct *handle, struct smb_filename *smb_fname) return ret; } -static int cap_unlink(vfs_handle_struct *handle, const char *path) +static int cap_unlink(vfs_handle_struct *handle, + const struct smb_filename *smb_fname) { - 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_UNLINK(handle, cappath); + + /* 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_UNLINK(handle, smb_fname_tmp); + + TALLOC_FREE(smb_fname_tmp); + return ret; } static int cap_chmod(vfs_handle_struct *handle, const char *path, mode_t mode) |