summaryrefslogtreecommitdiff
path: root/source3/torture
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/torture
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/torture')
-rw-r--r--source3/torture/cmd_vfs.c21
1 files changed, 20 insertions, 1 deletions
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 <old> <new>\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;