From 5a09ba460cb757823e1deb8b2f2ae762765846c0 Mon Sep 17 00:00:00 2001 From: Tim Prouty Date: Tue, 30 Jun 2009 17:04:38 -0700 Subject: s3: Plumb smb_filename through SMB_VFS_RENAME --- source3/torture/cmd_vfs.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'source3/torture') diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c index 0a682c7fd9..9585d6d226 100644 --- a/source3/torture/cmd_vfs.c +++ b/source3/torture/cmd_vfs.c @@ -511,12 +511,31 @@ static NTSTATUS cmd_lseek(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, static NTSTATUS cmd_rename(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv) { int ret; + struct smb_filename *smb_fname_src = NULL; + struct smb_filename *smb_fname_dst = NULL; + NTSTATUS status; + if (argc != 3) { printf("Usage: rename \n"); return NT_STATUS_OK; } - ret = SMB_VFS_RENAME(vfs->conn, argv[1], argv[2]); + status = create_synthetic_smb_fname_split(mem_ctx, argv[1], NULL, + &smb_fname_src); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + status = create_synthetic_smb_fname_split(mem_ctx, argv[2], NULL, + &smb_fname_dst); + if (!NT_STATUS_IS_OK(status)) { + TALLOC_FREE(smb_fname_src); + return status; + } + + ret = SMB_VFS_RENAME(vfs->conn, smb_fname_src, smb_fname_dst); + TALLOC_FREE(smb_fname_src); + TALLOC_FREE(smb_fname_dst); if (ret == -1) { printf("rename: error=%d (%s)\n", errno, strerror(errno)); return NT_STATUS_UNSUCCESSFUL; -- cgit