summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_netatalk.c
diff options
context:
space:
mode:
authorTim Prouty <tprouty@samba.org>2009-06-30 17:04:38 -0700
committerTim Prouty <tprouty@samba.org>2009-07-06 15:38:29 -0700
commit5a09ba460cb757823e1deb8b2f2ae762765846c0 (patch)
tree3c09af9ee0067e30c62826d48e9ca8eef39a16fe /source3/modules/vfs_netatalk.c
parentc41e5e1342a06456b4a5b101f46a394d6a4252bb (diff)
downloadsamba-5a09ba460cb757823e1deb8b2f2ae762765846c0.tar.gz
samba-5a09ba460cb757823e1deb8b2f2ae762765846c0.tar.bz2
samba-5a09ba460cb757823e1deb8b2f2ae762765846c0.zip
s3: Plumb smb_filename through SMB_VFS_RENAME
Diffstat (limited to 'source3/modules/vfs_netatalk.c')
-rw-r--r--source3/modules/vfs_netatalk.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/source3/modules/vfs_netatalk.c b/source3/modules/vfs_netatalk.c
index ed35922359..0e20beca41 100644
--- a/source3/modules/vfs_netatalk.c
+++ b/source3/modules/vfs_netatalk.c
@@ -222,24 +222,28 @@ exit_rmdir:
/* File operations */
-static int atalk_rename(struct vfs_handle_struct *handle, const char *oldname, const char *newname)
+static int atalk_rename(struct vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname_src,
+ const struct smb_filename *smb_fname_dst)
{
int ret = 0;
- char *adbl_path = 0;
- char *orig_path = 0;
+ char *oldname = NULL;
+ char *adbl_path = NULL;
+ char *orig_path = NULL;
SMB_STRUCT_STAT adbl_info;
SMB_STRUCT_STAT orig_info;
- TALLOC_CTX *ctx;
-
- ret = SMB_VFS_NEXT_RENAME(handle, oldname, newname);
+ NTSTATUS status;
- if (!oldname) return ret;
+ ret = SMB_VFS_NEXT_RENAME(handle, smb_fname_src, smb_fname_dst);
- if (!(ctx = talloc_init("rename_file")))
+ status = get_full_smb_filename(talloc_tos(), smb_fname_src, &oldname);
+ if (!NT_STATUS_IS_OK(status)) {
return ret;
+ }
- if (atalk_build_paths(ctx, handle->conn->origpath, oldname, &adbl_path, &orig_path,
- &adbl_info, &orig_info) != 0)
+ if (atalk_build_paths(talloc_tos(), handle->conn->origpath, oldname,
+ &adbl_path, &orig_path, &adbl_info,
+ &orig_info) != 0)
goto exit_rename;
if (S_ISDIR(orig_info.st_ex_mode) || S_ISREG(orig_info.st_ex_mode)) {
@@ -250,7 +254,9 @@ static int atalk_rename(struct vfs_handle_struct *handle, const char *oldname, c
atalk_unlink_file(adbl_path);
exit_rename:
- talloc_destroy(ctx);
+ TALLOC_FREE(adbl_path);
+ TALLOC_FREE(orig_path);
+ TALLOC_FREE(orig_path);
return ret;
}